PDA

View Full Version : [Add-on] Thread Prefixes: Quick Prefix Filter


gavinzac
04 Sep 2006, 12:56
Requires Thread Prefixes:
http://www.vbulletin.org/forum/showthread.php?t=123033

This just adds a little drop down to filter a forum by prefix. It will only show up if the forum has prefixes enabled. On my site I use it so that I don't need to have lots of little subforums, I have one central forum per area of the site and this filter lets them see all of one prefix type in the manner of a subforum, which in my opinion is tidier. See screenshots for my example.

Admin CP -> Styles & Templates -> Style manager --> [Style you want to edit] --> Edit templates --> Forum Display --> FORUMDISPLAY

Find:
<if condition="$pagenav">

Insert above/before: <!-- START FILTER TEMPLATE EDIT -->
<td class="smallfont"></form>
<form action="forumdisplay.php" method="get">
<input type="hidden" name="s" value="$session[sessionhash]" />
<input type="hidden" name="f" value="$forumid" />
<input type="hidden" name="page" value="$pagenumber" />
<input type="hidden" name="pp" value="$perpage" />
<input type="hidden" name="sort" value="lastpost" $sort[lastpost] />
<input type="hidden" name="order" value="desc" $order[desc] />
<input type="hidden" name="daysprune" value="-1" $daysprunesel[all] />
<if condition="$show['threadprefix']">
Show this type of thread: $threadprefixes
<input type="submit" class="button" value="Show" /></form></if></td>
<!-- END FILTER TEMPLATE EDIT -->

You can edit the "type of thread" text to whatever suits your forum.

Its working fine on mine, just let me know if there are any errors.

If you use it, please click Install! (http://www.vbulletin.org/forum/vborg_miscactions.php?do=installhack&threadid=125776) :)

Ascor
04 Sep 2006, 17:36
very nice and usefull, thank you, installed :)

Hornstar
05 Sep 2006, 10:00
you got a live demo, I think it may help me grasp this a little better.

Thanks.

gavinzac
05 Sep 2006, 16:18
you got a live demo, I think it may help me grasp this a little better.

Thanks.
http://www.speakout.biz/forum/problems-advice/

my site require registration but maybe someone else could post theirs?
Theres not much more to it than the screenshots anyway. its just a simple drop-down list that filters to threads with only the selected prefix.

kj_ugs
05 Sep 2006, 17:57
is it possible to limit this to one forum or is it site wide?

gavinzac
06 Sep 2006, 09:43
is it possible to limit this to one forum or is it site wide?
it only appears if a particular forum has Thread Prefixes enabled. you could limit it to one specific forum with thread prefixes enabled by adding an <if> statement around the whole thing.

Hornstar
14 Sep 2006, 10:43
I saw this release the other day and thought it was nothing special lol, but even before that I have been looking everywhere for the prefix hack, but wasnt searching for the word prefix led me knowwhere lol, so now that I understand what this does, it is really good.

Thanks, clicks install.

gavinzac
15 Sep 2006, 09:07
I saw this release the other day and thought it was nothing special lol, but even before that I have been looking everywhere for the prefix hack, but wasnt searching for the word prefix led me knowwhere lol, so now that I understand what this does, it is really good.

Thanks, clicks install.

yeah it might be better if i had a demo version. have you got it installed on a live, public site? :)

Simplicity
07 Oct 2006, 15:13
In the forums that this mod acts in (forums with active prefix fields) it seems to break the AJAX menu system. No dropdown menus work, however forums where it isnt running do have working AJAX menus.

Any idea why this would be?

vB v3.6.1

gavinzac
08 Oct 2006, 07:45
could i have a link to your forum to check it out? i presume you mean the DHTML menu, rather than an ajax modification?

Ascor
10 Oct 2006, 05:02
After upgrade to 3.6.2 an doing the template edit you can check the select box thread for moderation, but the counter say 0 post selectec and is not showing the "selected" color row :/

edit: and i have just cheked, same problem as Simplicity, the menu are out, ("forum tools" and "search in this forum")

AyeCapn
11 Oct 2006, 05:11
<if condition="$pagenav">

Searched for thss in 3.6.2 and couldn't find it in FORUMDISPLAY
:(

gavinzac
11 Oct 2006, 10:01
i guess theres something changed about 3.6.1+, i dont know i havent upgraded yet. Ill post any edits if/when i upgrade :( sorry guys, although i really dont see how this would affect any of that, its just a form and submit button.

AyeCapn
11 Oct 2006, 13:43
Dear gavinzac,

Due to repeated failures to meet expectations, your services will no longer be required with our firm. You have 15 minutes to clean out your desk. Security will escort you to the front door.

Have a nice day.

Sincerely,

The Management





:o

gavinzac
12 Oct 2006, 09:48
If you do want to put this into 3.6.2, just find the new topic button and put it in after that. I can't garauntee it'll work but I don't see why it wouldnt, its just a form. I'm guessing people have somehow screwed up the form that lets you inline moderate when they did this.

Janet Jackson
16 Oct 2006, 03:36
I tested this add-on just to see if it worked on a 3.6.2 board and it did (without affecting AJAX or moderation options). Unfortunately the forums where I have prefixes enabled aren't publicly visible, so I can't show you. Anyway, to be honest I find this (http://www.vbulletin.org/forum/showpost.php?p=1063727&postcount=50) a better solution myself.

gavinzac
16 Oct 2006, 10:01
glad to see i was right, it works :D

thats fair enough, two ways of doing the same things really, but you should really put rel="nofollow" on those links. search engines will go crazy. also, if theres a prefix thats not on the first page it'd be a pain to find one and then click it.

Janet Jackson
16 Oct 2006, 16:10
thats fair enough, two ways of doing the same things really, but you should really put rel="nofollow" on those links. search engines will go crazy.
It's there already ;)
also, if theres a prefix thats not on the first page it'd be a pain to find one and then click it.
Good point, didn't think of that.

Ascor
22 Oct 2006, 08:14
I confirm this was a template issus, now all work good in 3.6.2 ^^
Thank you Janet Jackson and thank's again gavinzakc :)

gavinzac
23 Oct 2006, 11:48
I confirm this was a template issus, now all work good in 3.6.2 ^^
Thank you Janet Jackson and thank's again gavinzakc :)
out of curiousity, what template are you using? i could have a look and see if theres some way to make them 100% compatible.

TheMilkCarton
19 Mar 2007, 11:37
This broke my inline moderation on the FORUMDISPLAY. The only forum where inline mod. would work was where I had thread prefixes installed.

I instead am using:<!-- START FILTER TEMPLATE EDIT -->
<if condition="$show['threadprefix']">
</form>
<td class="smallfont">
<form action="forumdisplay.php" method="get">
<input type="hidden" name="s" value="$session[sessionhash]" />
<input type="hidden" name="f" value="$forumid" />
<input type="hidden" name="page" value="$pagenumber" />
<input type="hidden" name="pp" value="$perpage" />
<input type="hidden" name="sort" value="lastpost" $sort[lastpost] />
<input type="hidden" name="order" value="desc" $order[desc] />
<input type="hidden" name="daysprune" value="-1" $daysprunesel[all] />
<strong>Filter by prefix:</strong> $threadprefixes
<input type="submit" class="button" value="Show" /></form></td></if>
<!-- END FILTER TEMPLATE EDIT -->

I reverted the FORUMDISPLAY completely and started adding code back in until I narrowed it down that this was what was causing my problems..

Well, anyway, in case anyone else was having this problem, there's the fix. :)

gavinzac
20 Mar 2007, 09:40
This broke my inline moderation on the FORUMDISPLAY. The only forum where inline mod. would work was where I had thread prefixes installed.

I instead am using:<!-- START FILTER TEMPLATE EDIT -->
<if condition="$show['threadprefix']">
<td class="smallfont"></form>
<form action="forumdisplay.php" method="get">
<input type="hidden" name="s" value="$session[sessionhash]" />
<input type="hidden" name="f" value="$forumid" />
<input type="hidden" name="page" value="$pagenumber" />
<input type="hidden" name="pp" value="$perpage" />
<input type="hidden" name="sort" value="lastpost" $sort[lastpost] />
<input type="hidden" name="order" value="desc" $order[desc] />
<input type="hidden" name="daysprune" value="-1" $daysprunesel[all] />
<strong>Filter by prefix:</strong> $threadprefixes
<input type="submit" class="button" value="Show" /></form></td></if>
<!-- END FILTER TEMPLATE EDIT -->

I reverted the FORUMDISPLAY completely and started adding code back in until I narrowed it down that this was what was causing my problems..

Well, anyway, in case anyone else was having this problem, there's the fix. :)


ah thanks TMC, i see where i fudged up now :D cant I edit my code as such to save anyone having to insert and then edit it?

twgogo
21 Mar 2007, 14:09
Good job~ ^^

Pottsy
18 Apr 2007, 08:05
I'm getting a javascript error (object required) when viewing a forumdisplay, only on forums with this hack and only on ie. This gives an error and disables navbar popups only in ie.

The error happens on the last line of this snippet (found in vbulletin_global):

// add popups to pagenav elements
var pagenavs = fetch_tags(document, 'td');
for (var n = 0; n < pagenavs.length; n++)
{
if (pagenavs[n].hasChildNodes() && pagenavs[n].firstChild.name && pagenavs[n].firstChild.name.indexOf('PageNav') != -1)


I've tried both blocks of code - the main mod and the one above. Using 3.6.5.

Any clues - I'm a bit stuck!

Pottsy
18 Apr 2007, 11:16
OK, I think I've fixed this (error and no pop up navbar in IE) - but you may want to check this because I am no coder...

This mod is a form, but it's stuck in the middle of another form. If the mod is displayed, it just terminates the first form. This is how I fixed it:

Admin CP -> Styles & Templates -> Style manager --> [Style you want to edit] --> Edit templates --> Forum Display --> FORUMDISPLAY

Find and delete:

<form action="inlinemod.php?forumid=$forumid" method="post" id="inlinemodform">
<input type="hidden" name="url" value="$url" />
<input type="hidden" name="s" value="$session[sessionhash]" />
<input type="hidden" name="forumid" value="$forumid" />


Find:

<if condition="$pagenav">


Insert above/before:

<!-- START FILTER TEMPLATE EDIT -->
<if condition="$show['threadprefix']">
<td class="smallfont">
<form action="forumdisplay.php" method="get">
<input type="hidden" name="s" value="$session[sessionhash]" />
<input type="hidden" name="f" value="$forumid" />
<input type="hidden" name="page" value="$pagenumber" />
<input type="hidden" name="pp" value="$perpage" />
<input type="hidden" name="sort" value="lastpost" $sort[lastpost] />
<input type="hidden" name="order" value="desc" $order[desc] />
<input type="hidden" name="daysprune" value="-1" $daysprunesel[all] />
Show only the following: $threadprefixes
<input type="submit" class="button" value="Show" /></form></td></if>
<!-- END FILTER TEMPLATE EDIT -->

<!-- Form code moved from section Threads List -->
<form action="inlinemod.php?forumid=$forumid" method="post" id="inlinemodform">
<input type="hidden" name="url" value="$url" />
<input type="hidden" name="s" value="$session[sessionhash]" />
<input type="hidden" name="forumid" value="$forumid" />
<!-- End of Form code moved from section Threads List -->

This works for me on 3.6.5, it removes the error message in IE, and doesn't break inline moderation.

gavinzac
19 Apr 2007, 18:31
Good work pottsy.

I will no longer be using this hack, or thread prefixes, so feel free to submit the correct code as your own modification for the latest version.

4x4 Mecca
30 Apr 2007, 02:17
Thanks Pottsy! You really helped.

kompakt
03 May 2007, 12:27
Thanks Pottsy, that worked for me too...

tspore
23 Nov 2007, 23:04
I know that this mod wasn't designed for it, as well as I am getting errors when using it on 3.6.8 with a bad if condition, but I was wondering 2 things?
#1 - Can we get it updated to work in 3.6.8?
Parse error: syntax error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting T_STRING or T_VARIABLE or T_NUM_STRING in ....
line #53

#2 - would it be possible to have a search for all the forums by prefix. Right now I can only within advanced search put words in for it to search, as well as it won't search multiple forums.

Thanks!!

sub_ubi
04 Apr 2008, 07:10
Thank you Pottsy, works great on 3.6.8 PL2!

Ronin Six
08 May 2008, 16:24
Anyone know if there's a similar mod to this (other than the Clickable Prefix Mod) for v3.7?

sub_ubi
20 Feb 2009, 17:37
would love to see something like this for 3.7/3.8!

Wonksta
08 May 2009, 13:58
would love to see something like this for 3.7/3.8!

Same!!!!!

Cagonni
09 Jun 2009, 05:10
would love to see something like this for 3.7/3.8!

it should be..

Alfa1
19 Dec 2010, 03:12
A vb 3.8.6 version would be nice to have.

Wonksta
30 Mar 2011, 08:02
A vb 3.8.6 version would be nice to have.
Bump!

st80m
14 May 2012, 17:49
I would love to see this mod for VB 4.1.12

Any thoughts of upgrading it?

sub_ubi
02 Aug 2012, 02:56
I'd like to see a vb4 version as well!