PDA

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


Wired1
08-07-2006, 10:00 PM
The 3.5.x version of this hack can be found here (https://vborg.vbsupport.ru/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! (https://vborg.vbsupport.ru/vborg_miscactions.php?do=installhack&threadid=123339)

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

Benj
08-07-2006, 10:18 PM
thanks alot for this will be using :D

Wired1
08-07-2006, 10:42 PM
No problemo.

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

ragintajin
08-08-2006, 02:11 AM
How server intensive is this?

Wired1
08-08-2006, 03:01 AM
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-08-2006, 05:01 AM
Hi, nice hack, but i would like to sort "picon = 0" too, please.

Regards, Stoebi

Wired1
08-08-2006, 12:22 PM
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
09-28-2006, 01:25 AM
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
09-28-2006, 01:47 AM
thanks. Clarified the instructions to be more vague :)

RobParker
12-30-2006, 03:04 PM
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
04-08-2007, 06:10 PM
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
04-09-2007, 11:49 PM
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
04-13-2007, 07:43 AM
Bookmarked for the future use..

Thanks for great hack, Wired :)

Muellmann
04-14-2007, 01:09 AM
That's cool, i have installed it.

nicolerork
04-17-2007, 12:19 AM
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-05-2007, 05:18 PM
is there a way to display the post icons in a list on the forumdisplay?

Skedoozy
05-11-2007, 08:18 PM
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
05-11-2007, 08:27 PM
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
05-25-2007, 12:05 PM
hmm... doesn't seem to work on v3.6.7 PL1. Any ideas?

SBlueman
05-26-2007, 06:26 PM
Very cool, I combined this mod with the Require post icon (https://vborg.vbsupport.ru/showthread.php?t=140073) mod and am happy with the results. Thanks!

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

IceFanatic
06-04-2007, 04:19 AM
Does this work with 3.6.7 PL1???

I've wanted this forever!

Skedoozy
06-05-2007, 11:06 PM
Yeah, this stopped working with 3.6.7 PL1. Pleasssssssse update!?

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

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

IceFanatic
06-15-2007, 08:03 PM
Any update for v3.6.7 PL1?

ABMAC
06-18-2007, 05:26 PM
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
07-16-2007, 10:06 PM
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
08-12-2007, 04:24 PM
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
08-18-2007, 01:34 PM
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
08-20-2007, 07:14 PM
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
08-26-2007, 06:51 AM
Fantastic, thanks.

sensimilla
09-22-2007, 11:37 AM
Its not working for me. vb 3.6.8 with seo enabled

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

SBlueman
10-15-2007, 04:30 AM
Anyone know if this can work on 3.6.8?

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

SBlueman
11-10-2007, 10:47 PM
Any word on an update for this?

Wired1
11-16-2007, 05:25 AM
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
01-03-2008, 06:47 PM
Is this working for 3.6.8? Really would like this awesome mod.

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

SBlueman
01-28-2008, 05:46 AM
Any chance this can work once again?

Caerydd
01-31-2008, 12:34 PM
I might be interested in this ^^

Wired1
02-06-2008, 03:23 AM
I'll try to take a look at it again this weekend.

sub_ubi
03-06-2008, 04:50 PM
This mod combined with Post Icons Forum Permissions (https://vborg.vbsupport.ru/showthread.php?t=162809) would be incredible - no more need for subforums. If only this mod worked with 3.6.8!

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

Any luck on seeing if this can work again?

noonespecial
04-04-2008, 10:09 PM
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-04-2008, 10:11 PM
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
04-10-2008, 11:31 PM
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
05-08-2008, 12:04 AM
Any luck on getting this to work? Right now you click on the post icons and get nothing....

SBlueman
05-08-2008, 12:06 AM
$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
05-27-2008, 05:53 AM
If a fix could be found for later versions of 3.6x, I too would be very appreciative.

- Reid

Strike3ForumsMH
05-30-2008, 12:41 AM
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
05-31-2008, 08:12 AM
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
06-04-2008, 06:59 PM
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
07-11-2008, 01:04 PM
How about 3.7.X? Wired1... you still around?

canntoon
07-27-2008, 04:05 PM
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
09-13-2008, 06:30 PM
Any update on this please? Would love this for 3.7

srh
01-08-2009, 10:48 PM
I could really use this for ver. 3.7.x

Any alternatives?

boggseric
01-13-2010, 02:55 AM
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
07-01-2010, 05:31 PM
will this mod work with vb 4.0.4?

vidan
07-18-2010, 07:23 AM
work on 4.04 or not?

zippokid
01-26-2011, 02:02 PM
wish this would be redone for 4.0

vidan
02-12-2011, 04:23 AM
yes wired pls

kpmedia
06-10-2011, 05:50 PM
Does not work on 3.8.4

Nook_Neformat
09-25-2011, 11:47 AM
iwish it was updated for 3.8 :(