PDA

View Full Version : Forum Display Enhancements - Filter Threads By Post Icon


Wired1
07 Aug 2006, 23:07
The 3.5.x version of this hack can be found here (http://www.vbulletin.org/forum/showthread.php?t=98978).

This hack allows you to click on a post icon, and it will show only the threads with this particular post icon. Once this happens an unfilter button will appear, allowing the user to once again view all threads.

As for WHY someone would want this, here's an answer to that question:

Some forums use the forum icons to convey if a thread has been sufficiently answered or not, or to convey some other meaning. If a poster wants to look for unanswered threads, they could sort by the icon used for the thread.

Think of this as a poor man's thread prefix hack

# of php page edits: 1
# of template edits: 2

Should take less than 5 min to install.

Don't forget to hit INSTALL! (http://www.vbulletin.org/forum/vborg_miscactions.php?do=installhack&threadid=123339)

------------------
9-27-06: updated version number, clarified instructions, no actual code change

Benj
07 Aug 2006, 23:18
thanks alot for this will be using :D

Wired1
07 Aug 2006, 23:42
No problemo.

Benj
08 Aug 2006, 00:00
anyway of having a vba block that only shows new threads with a certain post icon .... just a thought

ragintajin
08 Aug 2006, 03:11
How server intensive is this?

Wired1
08 Aug 2006, 04:01
anyway of having a vba block that only shows new threads with a certain post icon .... just a thoughtThat'd be a different hack, as it wouldn't be a filter, nor would it be in the main thread view of a forum. It's certainly doable though, I'd post it in the request area.


How server intensive is this?Damned if I know lol! Can't see it as being that intensive, I'd guess less than a search, as the basic idea is something like IF ICON THEN SHOW ELSE HIDE

Stoebi
08 Aug 2006, 06:01
Hi, nice hack, but i would like to sort "picon = 0" too, please.

Regards, Stoebi

Wired1
08 Aug 2006, 13:22
Hi, nice hack, but i would like to sort "picon = 0" too, please.

Regards, Stoebi

For whatever reason, picon 0 and 1 are the same thing, works on 1 just fine. This may take a bit to figure out. If anyone has an idea, feel free to chime in.

oz_moses
28 Sep 2006, 02:25
nice work, I really like this.

I did find step 2 slightly different from your instructions when using VB 3.6.1 - here's what I did instead

After:
if ($daysprune != -1)
{
if ($vbulletin->userinfo['userid'] AND in_coventry($vbulletin->userinfo['userid'], true))
{
$tachyjoin = "LEFT JOIN " . TABLE_PREFIX . "tachythreadpost AS tachythreadpost ON " .
"(tachythreadpost.threadid = thread.threadid AND tachythreadpost.userid = " . $vbulletin->userinfo['userid'] . ")";
$datecut = " AND (thread.lastpost >= " . (TIMENOW - ($daysprune * 86400)) . " OR tachythreadpost.lastpost >= " . (TIMENOW - ($daysprune * 86400)) . ")";
}
else
{
$datecut = "AND lastpost >= " . (TIMENOW - ($daysprune * 86400));
$tachyjoin = "";
}
$show['noposts'] = false;
}
else
{
$tachyjoin = "";
$datecut = "";
$show['noposts'] = true;
}


Add:
// Start Filter Threads By Post Icon Code Snippet

if ($picon > 0 && is_numeric($picon) && $picon < 5000) { //who knows if all this is necessary - better safe than sorry
$pqr = " AND thread.iconid = '$picon' ";
$datecut .= $pqr;
} else
$picon = "";

// End Filter Threads By Post Icon Code Snippet


Demo at http://www.gothetahs.com/forum/index.php if anyone's interested.

Wired1
28 Sep 2006, 02:47
thanks. Clarified the instructions to be more vague :)

RobParker
30 Dec 2006, 16:04
Installed and this works fine.

Has anyone been able to add a collapsable box to the top of their forums which includes the post icons and allows you to filter by post icons from there (similar to what the SomethingAwful forums use for those familar with them)?

bigdm
08 Apr 2007, 19:10
is there a way i can set it to display the icons for all, but only let registered members filter posts??

*im sure there is, i just cant work it out

sportsfroma2
10 Apr 2007, 00:49
First off, Great hack, works well and is a great idea... Something I have been looking for quite some time. Thanks for this.

AS a result of how good this hack is, I have a couple of questions on how I would do a couple of things:

1) I would like to make it MANDATORY that a post icon (or would it be a thread icon?) has to be selected to start a new thread.

2) Is there any way to have different sets of thread/post icons depending on the forum/subforum?

3) Eliminate the hot threads/locked threads column, which is usually to the left of the post icons in the default template. I would like to do this so I can user bigger/wider post icons.

Thanks!

vitnuce
13 Apr 2007, 08:43
Bookmarked for the future use..

Thanks for great hack, Wired :)

Muellmann
14 Apr 2007, 02:09
That's cool, i have installed it.

nicolerork
17 Apr 2007, 01:19
Does this work for 3.6.5? I tried modifying the templates, but I couldn't even find some of the codes to change.

rokked
05 May 2007, 18:18
is there a way to display the post icons in a list on the forumdisplay?

Skedoozy
11 May 2007, 21:18
Hmm I have installed but when I click on a post icon it does not filter. The unfilter option comes up but everything is the same.

Skedoozy
11 May 2007, 21:27
nice work, I really like this.

I did find step 2 slightly different from your instructions when using VB 3.6.1 - here's what I did instead

After:
if ($daysprune != -1)
{
if ($vbulletin->userinfo['userid'] AND in_coventry($vbulletin->userinfo['userid'], true))
{
$tachyjoin = "LEFT JOIN " . TABLE_PREFIX . "tachythreadpost AS tachythreadpost ON " .
"(tachythreadpost.threadid = thread.threadid AND tachythreadpost.userid = " . $vbulletin->userinfo['userid'] . ")";
$datecut = " AND (thread.lastpost >= " . (TIMENOW - ($daysprune * 86400)) . " OR tachythreadpost.lastpost >= " . (TIMENOW - ($daysprune * 86400)) . ")";
}
else
{
$datecut = "AND lastpost >= " . (TIMENOW - ($daysprune * 86400));
$tachyjoin = "";
}
$show['noposts'] = false;
}
else
{
$tachyjoin = "";
$datecut = "";
$show['noposts'] = true;
}
Add:
// Start Filter Threads By Post Icon Code Snippet

if ($picon > 0 && is_numeric($picon) && $picon < 5000) { //who knows if all this is necessary - better safe than sorry
$pqr = " AND thread.iconid = '$picon' ";
$datecut .= $pqr;
} else
$picon = "";

// End Filter Threads By Post Icon Code Snippet
Demo at http://www.gothetahs.com/forum/index.php if anyone's interested.


This solved my problem. Thanks!!

Antivirus
25 May 2007, 13:05
hmm... doesn't seem to work on v3.6.7 PL1. Any ideas?

SBlueman
26 May 2007, 19:26
Very cool, I combined this mod with the Require post icon (http://www.vbulletin.org/forum/showthread.php?t=140073) mod and am happy with the results. Thanks!

SBlueman
03 Jun 2007, 07:30
Question....is there a way to ignore sticky threads when you sort?

IceFanatic
04 Jun 2007, 05:19
Does this work with 3.6.7 PL1???

I've wanted this forever!

Skedoozy
06 Jun 2007, 00:06
Yeah, this stopped working with 3.6.7 PL1. Pleasssssssse update!?

Skedoozy
09 Jun 2007, 22:01
Wired1 said he would be working on this during the weekend, hopefully we see an update! ;)

noonespecial
13 Jun 2007, 09:16
What if I wanted to show ... say threads with 4 different icons? But filter out the rest?

IceFanatic
15 Jun 2007, 21:03
Any update for v3.6.7 PL1?

ABMAC
18 Jun 2007, 18:26
hmm... doesn't seem to work on v3.6.7 PL1. Any ideas?

I just installed it on 3.6.7 and it works great!

bitHacker
16 Jul 2007, 23:06
Very Good mod.
However, when editing old threads and changing their icons, they don't apper in the forum display...
New threads show the thread post icon, and I was able to filter without a problem.

nevermind, did bad edit of the PHP file... my bad :-)

cynthetiq
12 Aug 2007, 17:24
I have been trying to get this to work on 3.6.8 and for some reason, I make the coding changes in the php file and the templates but I get nothing. I will go over my edits one more time to make sure I'm not doing something incorrect.

cynthetiq
18 Aug 2007, 14:34
I can't get this to work properly... I am using an extremepixels template and I don't have items to find an replace in the forumdisplay template. If you'd like to see my forumdisplay template I can try to PM or email it to you. I hit the 20000 char limit.


<tr>
<if condition="$show['threadicons']">
<td class="thead" colspan="2">&nbsp;</td>
<else />
<td class="thead">&nbsp;</td>
</if>

thanks in advance.

PhinisheDTom
20 Aug 2007, 20:14
Simple, easy to implement, and it works exactly as advertised. Thanks for your efforts! The only problem, though, is that most of my users keep up with recent activity by using "/search.php?do=getnew", and the hack doesn't work on the search results page. Any ideas about how the search PHP code and template can be modified to allow the threadbit part of the hack to filter search results by post icon?

-Tom

sensimilla
26 Aug 2007, 07:51
Fantastic, thanks.

sensimilla
22 Sep 2007, 12:37
Its not working for me. vb 3.6.8 with seo enabled

Skedoozy
28 Sep 2007, 20:43
I guess he couldn't get it to work with 3.6.7 and up. :/ shame. Really loved this mod.

SBlueman
15 Oct 2007, 05:30
Anyone know if this can work on 3.6.8?

Wired1
15 Oct 2007, 17:06
Completely forgot about this hack lol! I'll dig through the code sometime soon, see why it's not working.

SBlueman
10 Nov 2007, 23:47
Any word on an update for this?

Wired1
16 Nov 2007, 06:25
nope :) forgot again, busy @ work. I'll see if I can get to it this weekend. Most likely it'll be a minor code change to get it to work.

Rob1986
03 Jan 2008, 19:47
Is this working for 3.6.8? Really would like this awesome mod.

Wired1
07 Jan 2008, 14:23
Tried over the holidays, can't get it to work, dunno why.

SBlueman
28 Jan 2008, 06:46
Any chance this can work once again?

Caerydd
31 Jan 2008, 13:34
I might be interested in this ^^

Wired1
06 Feb 2008, 04:23
I'll try to take a look at it again this weekend.

sub_ubi
06 Mar 2008, 17:50
This mod combined with Post Icons Forum Permissions (http://www.vbulletin.org/forum/showthread.php?t=162809) would be incredible - no more need for subforums. If only this mod worked with 3.6.8!

SBlueman
11 Mar 2008, 06:06
I'll try to take a look at it again this weekend.

Any luck on seeing if this can work again?

noonespecial
04 Apr 2008, 23:09
is there a way to display the post icons in a list on the forumdisplay?

$icons = $vbulletin->db->query_read_slave("
SELECT iconid, iconpath, title, imagecategoryid
FROM " . TABLE_PREFIX . "icon AS icon
WHERE imagecategoryid NOT IN (0$badcategories)
ORDER BY title
");

if (!$vbulletin->db->num_rows($icons))
{
return false;
}

$show['posticons'] = false;

while ($icon = $vbulletin->db->fetch_array($icons))
{
$show['posticons'] = true;
eval('$posticonbits .="' . fetch_template('topicbits') . '";');
}

That's how I did it with a plugin on forumdisplay_start

noonespecial
04 Apr 2008, 23:11
Question....is there a way to ignore sticky threads when you sort?
This would be extremely helpful, I have looked at forumdisplay.php - and can't quite figure out how to get it to ignore stickies when sorted.

Any help?

noonespecial
11 Apr 2008, 00:31
This would be extremely helpful, I have looked at forumdisplay.php - and can't quite figure out how to get it to ignore stickies when sorted.

Any help?
Add $datecut to $stickies

SBlueman
08 May 2008, 01:04
Any luck on getting this to work? Right now you click on the post icons and get nothing....

SBlueman
08 May 2008, 01:06
$icons = $vbulletin->db->query_read_slave("
SELECT iconid, iconpath, title, imagecategoryid
FROM " . TABLE_PREFIX . "icon AS icon
WHERE imagecategoryid NOT IN (0$badcategories)
ORDER BY title
");

if (!$vbulletin->db->num_rows($icons))
{
return false;
}

$show['posticons'] = false;

while ($icon = $vbulletin->db->fetch_array($icons))
{
$show['posticons'] = true;
eval('$posticonbits .="' . fetch_template('topicbits') . '";');
}

That's how I did it with a plugin on forumdisplay_start

Also, how would I implement this? I am not understanding the instructions.

Strike3ForumsMH
27 May 2008, 06:53
If a fix could be found for later versions of 3.6x, I too would be very appreciative.

- Reid

Strike3ForumsMH
30 May 2008, 01:41
Actually, I got this to work on 3.68. After trying to rework everything and then going to upload, I saw that I simply missed a small file edit in the instructions. D'oh.

Thanks for the cool hack.

- Reid

Strike3ForumsMH
31 May 2008, 09:12
Simple, easy to implement, and it works exactly as advertised. Thanks for your efforts! The only problem, though, is that most of my users keep up with recent activity by using "/search.php?do=getnew", and the hack doesn't work on the search results page. Any ideas about how the search PHP code and template can be modified to allow the threadbit part of the hack to filter search results by post icon?

-Tom
Yeah, I would second this as well. It's really about the only thing wrong with the hack. Does anyone have a fix?

- Reid

Seiyaboy
04 Jun 2008, 19:59
Although people claim it doesn't work for 3.6.7PL1 and up, it works just fine for my vbulletin 3.6.10 forum. Thanks again for this wonderful mod.

trigatch4
11 Jul 2008, 14:04
How about 3.7.X? Wired1... you still around?

canntoon
27 Jul 2008, 17:05
Yeah I'm running 3.7.2 and I would really love to have this working. Are there even any similar alternatives at all? Seems like a common need for forums that nobody else has solved.

Manhand
13 Sep 2008, 19:30
Any update on this please? Would love this for 3.7

srh
08 Jan 2009, 23:48
I could really use this for ver. 3.7.x

Any alternatives?

boggseric
13 Jan 2010, 03:55
This pretty much works in 3.84 PL2. The only part that doesn't work is the unfilter link never shows up. Otherwise this filters the threads just like it is supposed to.


Once I figure out how to get that to work properly I will post the fix. For now you can do this:

On the last step of the instructions it says..

vB AdminCP -> Styles & Templates -> Style Manager -> (Select Style) -> Forum Display Templates -> FORUMDISPLAY

NOTE: there are 2 <if condition="$show['threadicons']"> lines. The 2nd one (that is preceded by <tr>) is the one to replace.


FIND:

<tr>
<if condition="$show['threadicons']">
<td class="thead" colspan="2">&nbsp;</td>
<else />
<td class="thead">&nbsp;</td>
</if>


REPLACE with:

<tr>
<if condition="$show['threadicons']">
<if condition="$picon">
<td class="thead" colspan="2"><a href="$noiconurl">Unfilter</a></td>
<else />
<td class="thead" colspan="2">&nbsp;</td>
</if>
<else />
<td class="thead">&nbsp;</td>
</if>


I simply changed it to this which ALWAYS displays the unfilter link (which just refreshes the page if they haven't filtered):

<if condition="$show['threadicons']">
<if condition="$picon">
<td class="thead" colspan="2"><a href="$noiconurl">Unfilter</a></td>
<else />
<td class="thead" colspan="2"><a href="$noiconurl">Unfilter</a>&nbsp;</td>
</if>
<else />
<td class="thead">&nbsp;</td>
</if>



Also note, on that last part of the instructions it mentions <tr>, those weren't in my template so I left that out.

rebatesmoney
01 Jul 2010, 18:31
will this mod work with vb 4.0.4?

vidan
18 Jul 2010, 08:23
work on 4.04 or not?

zippokid
26 Jan 2011, 15:02
wish this would be redone for 4.0

vidan
12 Feb 2011, 05:23
yes wired pls

kpmedia
10 Jun 2011, 18:50
Does not work on 3.8.4

Nook_Neformat
25 Sep 2011, 12:47
iwish it was updated for 3.8 :(