vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3.6 Add-ons (https://vborg.vbsupport.ru/forumdisplay.php?f=194)
-   -   Forum Display Enhancements - Filter Threads By Post Icon (https://vborg.vbsupport.ru/showthread.php?t=123339)

Wired1 08-07-2006 10:00 PM

Filter Threads By Post Icon
 
The 3.5.x version of this hack can be found here.

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!

------------------
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

Quote:

Originally Posted by Benj
anyway of having a vba block that only shows new threads with a certain post icon .... just a thought

That'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.


Quote:

Originally Posted by ragintajin
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

Quote:

Originally Posted by Stoebi
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:
Code:

        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:
Code:

// 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 :)


All times are GMT. The time now is 02:12 PM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.02577 seconds
  • Memory Usage 1,736KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (2)bbcode_code_printable
  • (3)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (2)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete