Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
 Filter Threads By Thread Prefix - MyBB 1.6 Only
RateU Offline
Administrator
*******
Posts: 2,350
Joined: Mar 2010
Post: #1
Filter Threads By Thread Prefix - MyBB 1.6 Only
Now, we can filter threads by the default MyBB thread prefix using XThreads.

Then, we need to edit our forumdisplay_thread template:
Find:

Code:
{$thread['threadprefix']}


Replace with:

HTML Code
<a href="{$forumurl_q}filterxt_prefix={$thread['prefix']}">{$thread['threadprefix']}</a>


With the modification above, we can filter threads by thread prefix (click the thread prefix).


Additional Info:

The filter format should be like this:

Code:
filterxt_prefix=prefix_id


Example:
We want to display threads which has thread prefix id = 2 only. So, the filter format should be like this:

Code:
filterxt_prefix=2


And, we can use an array for this too. The format should be like this:

Code:
filterxt_prefix[]=prefix_id_a&filterxt_prefix[]=prefix_id_b&filterxt_prefix[]=prefix_id_c


Example:
We want to display threads which has thread prefix id = 1, threads which has thread prefix id = 2 and threads which has thread prefix id = 3. The filter format should be like this:

Code:
filterxt_prefix[]=1&filterxt_prefix[]=2&filterxt_prefix[]=3


With this concept, as an optional, we can place the thread prefix filter in our forumdisplay_threadlist template manually.
Example:

HTML Code
<a href="{$forumurl_q}filterxt_prefix[]=1&amp;filterxt_prefix[]=2&amp;filterxt_prefix[]=3">Display Prefix 1, Prefix 2 and Prefix 3</a>


(This post was last modified: 02-05-2011 12:38 PM by RateU.)
11-05-2010 07:20 AM
Find all posts by this user Quote this message in a reply
leefish Offline
Hamster
*****
Posts: 1,009
Joined: Apr 2010
Post: #2
RE: Filter Threads By Thread Prefix - MyBB 1.6 Only
Yay, thanks RateU - I was feeling a bit lost looking at that prefix thing so this is a big help.


[Image: leelink.gif]
MYBB1.6 & XThreads
11-05-2010 08:20 AM
Visit this user's website Find all posts by this user Quote this message in a reply
AglioEoliO Offline
Junior Member
**
Posts: 39
Joined: Jan 2008
Post: #3
RE: Filter Threads By Thread Prefix - MyBB 1.6 Only
Thanks RateU Biggrin
11-05-2010 09:00 AM
Find all posts by this user Quote this message in a reply
x-Treme Offline
Member
***
Posts: 68
Joined: May 2010
Post: #4
RE: Filter Threads By Thread Prefix - MyBB 1.6 Only
Instead of editing the template, I edited the prefix itself. more specifically, the "Display Style" area of the prefix. I simply placed the filter link before the prefix display.
Example:

Code:
<a href="./forumdisplay.php?fid=37&filterxt_prefix=7"><strong>[prefix text]</strong></a>


both ways will work.


Forum Freebies
11-05-2010 09:06 AM
Find all posts by this user Quote this message in a reply
ZiNgA BuRgA Offline
Fag
*******
Posts: 3,357
Joined: Jan 2008
Post: #5
RE: Filter Threads By Thread Prefix - MyBB 1.6 Only
Thanks RateU Smile

@x-Treme: probably the main issue with that is that it forces the prefix to a single forum, but if that's all you need, then it works fine as well Tongue

My Blog
(This post was last modified: 11-05-2010 09:18 AM by ZiNgA BuRgA.)
11-05-2010 09:17 AM
Find all posts by this user Quote this message in a reply
x-Treme Offline
Member
***
Posts: 68
Joined: May 2010
Post: #6
RE: Filter Threads By Thread Prefix - MyBB 1.6 Only
Never thought of that. But that is all I need it for, so I'll leave it as is for now.
Great feature though.

Forum Freebies
11-05-2010 10:06 AM
Find all posts by this user Quote this message in a reply
Imran Offline
Member
***
Posts: 204
Joined: Apr 2010
Post: #7
RE: Filter Threads By Thread Prefix - MyBB 1.6 Only
Thank You very much RateU Smile

[Image: logo.png]

[Image: twitter.png]
11-05-2010 04:35 PM
Visit this user's website Find all posts by this user Quote this message in a reply
RateU Offline
Administrator
*******
Posts: 2,350
Joined: Mar 2010
Post: #8
Filtering Thread By Thread Icon
Filtering Thread By Thread Icon:

Filtering threads by thread icon (works in both version - MyBB 1.4 and MyBB 1.6), should be similar with filtering thread by thread prefix. Change prefix to icon.

Then, we need to edit our forumdisplay_thread template:
Find:

Code:
{$icon}


Replace with:

HTML Code
<a href="{$forumurl_q}filterxt_icon={$thread['icon']}">{$icon}</a>


If we want to put the thread icon filter manually in forumdisplay_threadlist template, we can use URL like this:

HTML Code
<a href="{$forumurl_q}filterxt_icon=icon_id"><img src="{$icon_cache['icon_id']['path']}" alt="{$icon_cache['icon_id']['name']}" title="{$icon_cache['icon_id']['name']}" /></a>

Replace icon_id with Icon ID.

We can use an array for this too.

Additional Info:

This is an example URL for displaying all threads with prefix_id=1 and post_icon_id=2:

HTML Code
<a href="{$forumurl_q}filterxt_prefix=1&amp;filterxt_icon=2">Whatever</a>


(This post was last modified: 02-05-2011 12:38 PM by RateU.)
11-06-2010 03:11 AM
Find all posts by this user Quote this message in a reply
leefish Offline
Hamster
*****
Posts: 1,009
Joined: Apr 2010
Post: #9
RE: Filter Threads By Thread Prefix - MyBB 1.6 Only
Hi RateU, I am working on a forum set up and I wanted to use this trick on the similar threads - This is the content of my res_showthread_similarthreads_bit

Code:
<tr>
	<td align="center" class="{$trow}" width="2%">{$icon}</td>
	<td class="{$trow}">{$similar_thread['threadprefix']}<a href="{$similar_thread['threadlink']}">{$similar_thread['subject']}</a></td>
	
	</tr>


But when I try and put the XThreads filter fix in as so

Code:
<a href="{$forumurl_q}filterxt_prefix={$thread['prefix']}">{$thread['threadprefix']}</a>


it does not work - but - if you do it like as below, it does

Code:
<tr>
	<td align="center" class="{$trow}" width="2%">{$icon}</td>
	<td class="{$trow}"><a href="{$forumurl_q}filterxt_prefix={$thread['prefix']}">{$similar_thread['threadprefix']}</a><a href="{$similar_thread['threadlink']}">{$similar_thread['subject']}</a></td>
	
	</tr>


Just my addition Smile



[Image: leelink.gif]
MYBB1.6 & XThreads
11-15-2010 11:45 PM
Visit this user's website Find all posts by this user Quote this message in a reply
RateU Offline
Administrator
*******
Posts: 2,350
Joined: Mar 2010
Post: #10
RE: Filter Threads By Thread Prefix - MyBB 1.6 Only
For the showthread_similarthreads_bit template, maybe you mean like this, Lee?

HTML Code
<a href="{$forumurl_q}filterxt_prefix={$similar_thread['prefix']}">{$similar_thread['threadprefix']}</a>


11-16-2010 01:47 AM
Find all posts by this user Quote this message in a reply

« Next Oldest | Next Newest »

 Standard Tools
Forum Jump: