Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
 [Solved] Display/Sort forum threadlist with xthread field ?
ZiNgA BuRgA Offline
Fag
*******
Posts: 3,357
Joined: Jan 2008
Post: #11
RE: Display/Sort forum threadlist with xthread field ?
(03-11-2012 12:39 PM)akm Wrote:  Am assuming the 'key' is the key setup at ACP custom thread field setup (which put in a |code| box in previous post), but not sure what the 'name' 'myfield' is referring to ?
I guess the wording could be improved there.  'name' refers to 'key'.
In a sense, it's just restating the obvious - a key is a key.

By the way, filtering has little to do with sorting.  From memory, you just need to enable filtering to enable sorting, but you don't need to worry about its template variables.

My Blog
03-12-2012 10:08 AM
Find all posts by this user Quote this message in a reply
akm Offline
Member
***
Posts: 115
Joined: Nov 2011
Post: #12
RE: Display/Sort forum threadlist with xthread field ?
(03-12-2012 10:08 AM)ZiNgA BuRgA Wrote:  
(03-11-2012 12:39 PM)akm Wrote:  Am assuming the 'key' is the key setup at ACP custom thread field setup (which put in a |code| box in previous post), but not sure what the 'name' 'myfield' is referring to ?
I guess the wording could be improved there.  'name' refers to 'key'.
In a sense, it's just restating the obvious - a key is a key.
By the way, filtering has little to do with sorting.  
From memory, you just need to enable filtering to enable sorting, but you don't need to worry about its template variables.

Thank you for the followup !

Guess am still not understanding the terminology, and not maybe not asking the question correctly (trouble with beginners)...
1. If thread field key = ct_
2. If thread field title = Custom Thread:
3. How to modify template 'ct_forumdisplay_threadlist' for modify search option...

<option value="starter" {$sortsel['starter']}>{$lang->sort_by_starter}</option>

...to change from search by 'author' to search by 'Custom Thread:' (textfield input) with...

<option value="???" {$sortsel['???']}>Custom Thread:</option>

Assume ??? would include the thread field key = 'ct_' ?
And a 'name' = ___ ?

Or am still totally off track on this one ?

Thanks again for your help !
03-12-2012 11:23 AM
Find all posts by this user Quote this message in a reply
ZiNgA BuRgA Offline
Fag
*******
Posts: 3,357
Joined: Jan 2008
Post: #13
RE: Display/Sort forum threadlist with xthread field ?
Again, no name at all.  You can set the name to absolutely anything and XThreads won't care, and it won't affect any code whatsoever.

It's just the key that matters.

My Blog
03-12-2012 08:51 PM
Find all posts by this user Quote this message in a reply
RateU Offline
Administrator
*******
Posts: 2,350
Joined: Mar 2010
Post: #14
RE: Display/Sort forum threadlist with xthread field ?
(03-12-2012 11:23 AM)akm Wrote:  <option value="???" {$sortsel['???']}>Custom Thread:</option>

Assume ??? would include the thread field key = 'ct_' ?
Based on the documentation:
undoc.html Wrote:To sort by a thread field, prefix its key with tf_
undoc.html Wrote:eg {$sortsel['tf_myfield']}
where myfield = key

So, based on this custom field:
(03-12-2012 11:23 AM)akm Wrote:  1. If thread field key = ct_
this code:
(03-12-2012 11:23 AM)akm Wrote:  <option value="???" {$sortsel['???']}>Custom Thread:</option>
will be come something like this:

HTML Code
<option value="tf_ct_" {$sortsel['tf_ct_']}>Sort by: {$GLOBALS['threadfields_x']['ct_']['title']}</option>


03-13-2012 02:13 AM
Find all posts by this user Quote this message in a reply
akm Offline
Member
***
Posts: 115
Joined: Nov 2011
Post: #15
[Update2] RE: Display/Sort forum threadlist with xthread field ?
(03-12-2012 08:51 PM)ZiNgA BuRgA Wrote:  Again, no name at all.  You can set the name to absolutely anything and XThreads won't care, and it won't affect any code whatsoever.
It's just the key that matters.

Thank you for the clarification !
Think may be getting it, but was also thinking key needed to go b4 name (key_name) but Rateu cleared me up (name_key_ works) below.
And did use 'any name' (used custthrd_ ).

(03-13-2012 02:13 AM)RateU Wrote:  
(03-12-2012 11:23 AM)akm Wrote:  <option value="???" {$sortsel['???']}>Custom Thread:</option>
Assume ??? would include the thread field key = 'ct_' ?
Based on the documentation:
undoc.html Wrote:To sort by a thread field, prefix its key with tf_
undoc.html Wrote:eg {$sortsel['tf_myfield']}
where myfield = key
So, based on this custom field:
(03-12-2012 11:23 AM)akm Wrote:  1. If thread field key = ct_
this code:
(03-12-2012 11:23 AM)akm Wrote:  <option value="???" {$sortsel['???']}>Custom Thread:</option>
will be come something like this:

HTML Code
<option value="tf_ct_" {$sortsel['tf_ct_']}>Sort by: {$GLOBALS['threadfields_x']['ct_']['title']}</option>


Thank you for the code help !
'Name b4 key' was very helpful.

Now the sort box display is there (scrnshot attached), but it is still sorting by 'author'.

Not sure how to change that, but will look closer at undoc and templates.

Any other place should be looking ?

Quote:Also am trying to figure out how to take out the 'author' from the multi thread display and replace with the input from the ct_ textbox field (no link required).
Is that possible, without too much code editing, and does the undoc' address that modification ?
Will take more looks at in the meantime, and hopefully figure it out.
Am able to just omit the 'author' display by commenting out...
<div class="author smalltext">{$thread['profilelink']}</div>
...but have no idea how to replace with the ct_ textbox characters.
Any clues on that one ?
Update... think got that one with...
<div>{$GLOBALS['threadfields']['ct_']}</div>

Ps: [Update2] Do need to do some editing at forumdisplay.php ( // Sort by which field? ) for the sorting question ?


Attached File(s) Thumbnail(s)
   

Thanks again for your help !
(This post was last modified: 03-13-2012 12:16 PM by akm.)
03-13-2012 09:14 AM
Find all posts by this user Quote this message in a reply
ZiNgA BuRgA Offline
Fag
*******
Posts: 3,357
Joined: Jan 2008
Post: #16
RE: Display/Sort forum threadlist with xthread field ?
(03-13-2012 09:14 AM)akm Wrote:  Now the sort box display is there (scrnshot attached), but it is still sorting by 'author'.
Well, it works fine here...
http://mybbhacks.zingaburga.com/forumdis...http://mybbhacks.zingaburga.com/forumdisplay.php?fid=25&sor

Check your URL after sorting.

My Blog
03-13-2012 02:00 PM
Find all posts by this user Quote this message in a reply
akm Offline
Member
***
Posts: 115
Joined: Nov 2011
Post: #17
RE: Display/Sort forum threadlist with xthread field ?
(03-13-2012 02:00 PM)ZiNgA BuRgA Wrote:  
(03-13-2012 09:14 AM)akm Wrote:  Now the sort box display is there (scrnshot attached), but it is still sorting by 'author'.
Well, it works fine here...
http://mybbhacks.zingaburga.com/forumdis...http://mybbhacks.zingaburga.com/forumdisplay.php?fid=25&sor
Check your URL after sorting.

Thanks for followup.
URL looks similar to what u show...
Quote:/forumdisplay.php?fid=25&sortby=tf_tbg
and what custthrd_ct_ shows...
Quote:/forumdisplay.php?selectall=&fid=24&sortby=custthrd_ct_&order=desc
...except for the 'selectall=&' and '&order=desc' parts.

Obviously not sure what that means.
Tried modifying template tp_forumdisplay_threadlist, <input type="hidden" name="selectall" value="{$allselected}" /> part, but no luck there, anything else should look at...

Code:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
<tr>
{$inlinemodcol}
</tr>
{$selectall}
{$announcementlist}	
{$threads}
{$nullthreads}
<tr>
<td class="tfoot" align="right" colspan="{$colspan}">
<form action="forumdisplay.php" method="get">
<input type="hidden" name="selectall" value="{$allselected}" />
<input type="hidden" name="fid" value="{$fid}" />
<select class="smalltext" name="sortby">
<option value="subject" {$sortsel['subject']}>
Sort by Contractor Name:
</option>
<!-- how to use xthread field below so will actually sort by ??? -->
<option value="custhrd_ct_" {$sortsel['custthrd_ct_']}>Sort by  {$GLOBALS['threadfields_x']['ct_']['title']}</option>
<!-- take out all other sort options below
<option value="lastpost" {$sortsel['lastpost']}>{$lang->sort_by_lastpost}</option>
<option value="starter" {$sortsel['starter']}>{$lang->sort_by_starter}</option>
<option value="started" {$sortsel['started']}>{$lang->sort_by_started}</option>
{$ratingsort}...


Thanks again for your help !
(This post was last modified: 03-13-2012 03:09 PM by akm.)
03-13-2012 03:08 PM
Find all posts by this user Quote this message in a reply
ZiNgA BuRgA Offline
Fag
*******
Posts: 3,357
Joined: Jan 2008
Post: #18
RE: Display/Sort forum threadlist with xthread field ?
(03-13-2012 03:08 PM)akm Wrote:  and what custthrd_ct_ shows...
Quote:/forumdisplay.php?selectall=&fid=24&sortby=custthrd_ct_&order=desc
Try
Quote:/forumdisplay.php?selectall=&fid=24&sortby=tf_ct_&order=desc
Quote:/forumdisplay.php?selectall=&fid=24&sortby=tf_custthrd_ct_&order=desc

My Blog
03-13-2012 04:13 PM
Find all posts by this user Quote this message in a reply
akm Offline
Member
***
Posts: 115
Joined: Nov 2011
Post: #19
RE: Display/Sort forum threadlist with xthread field ?
(03-13-2012 04:13 PM)ZiNgA BuRgA Wrote:  
(03-13-2012 03:08 PM)akm Wrote:  and what custthrd_ct_ shows...
Quote:/forumdisplay.php?selectall=&fid=24&sortby=custthrd_ct_&order=desc
Try
Quote:/forumdisplay.php?selectall=&fid=24&sortby=tf_ct_&order=desc
Quote:/forumdisplay.php?selectall=&fid=24&sortby=tf_custthrd_ct_&order=desc

Thank you for the suggestions !
Tried both (and both changing template and inserting URL into browser) and still not sortiing per ct_ .
Have ct_ with (3) test threads (ct_ = textbox characters)...
1. ct_ =  a  (subject=c,auth=t)
2. ct_ =  p  (subject=b,auth=a)
3. ct_ =  z  (subject=a,auth=a)
When sort by ct_ (desc or asc), z ends up in middle and a & p exchange places, and nothing is by the respective desc or asc... so not sure what it is sorting by.
Sorting by subject works fine (desc and asc).
Seems like the testing setup is correct, and the template setup is correct, so not sure why not working.
Will give the grey cells a bit more time and then more T&E.
Must be missing something quite obvious at this end.

Thanks again for your help !
03-14-2012 02:49 AM
Find all posts by this user Quote this message in a reply
ZiNgA BuRgA Offline
Fag
*******
Posts: 3,357
Joined: Jan 2008
Post: #20
RE: Display/Sort forum threadlist with xthread field ?
You can check MyBB's debug page ("advanced details" link at bottom of each page) and see if the query is sorting by the thread field.

My Blog
03-14-2012 07:21 AM
Find all posts by this user Quote this message in a reply

« Next Oldest | Next Newest »

 Standard Tools
Forum Jump: