Go Back   vb.org Archive > vBulletin Modifications > Archive > vB.org Archives > vBulletin 3.0 > vBulletin 3.0 Beta Releases

Reply
 
Thread Tools
Filter threads by post icon Details »»
Filter threads by post icon
Version: 1.01, by JMPZ JMPZ is offline
Developer Last Online: Dec 2005 Show Printable Version Email this Page

Version: 3.0.7 Rating:
Released: 04-25-2005 Last Update: Never Installs: 6
Is in Beta Stage  
No support by the author.

I couldn't understand why nobody had created this hack yet, so I made it myself.

This allows users to filter the threads by the icon. They do this by clicking on the icon in the forum thread listing. It then only shows threads with that same post icon.

Switching between pages works, as well as using the column sort functions. It is not designed to work properly with any other sort options but it might.

When posts are filtered, a "Unfilter" link is shown in the column header for thread post icons which, when clicked, removes the filter and returns the view to page 1.

Only 1 file needs to be modified, and 2 templates.

In forumdisplay.php, find
PHP Code:
globalize($_REQUEST, array('perpage' => INT'pagenumber' => INT'daysprune' => INT)); 
Replace with:
PHP Code:
//Post icon filter hack
//globalize($_REQUEST, array('perpage' => INT, 'pagenumber' => INT, 'daysprune' => INT));
globalize($_REQUEST, array('perpage' => INT'pagenumber' => INT'daysprune' => INT'picon'=> INT));
//*Post icon filter hack 

Find:
PHP Code:
    if ($daysprune != -1)
    {
        
$datecut "AND lastpost >= " . (TIMENOW - ($daysprune 86400));
        
$show['noposts'] = false;
    }
    else
    {
        
$datecut '';
        
$show['noposts'] = true;
    } 
And add immediately after it:
PHP Code:
//Post icon filter hack
    
if ($picon && 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 "";
//*post icon filter hack 

Find:
PHP Code:
        $pagenav construct_page_nav($totalthreads"forumdisplay.php?$session[sessionurl]f=$forumid""&sort=$sortfield&order=$sortorder&pp=$perpage&daysprune=$daysprune"); 
Replace with:

PHP Code:

//Post icon filter hack
//        $pagenav = construct_page_nav($totalthreads, "forumdisplay.php?$session[sessionurl]f=$forumid", "&sort=$sortfield&order=$sortorder&pp=$perpage&daysprune=$daysprune");
        
$pagenav construct_page_nav($totalthreads"forumdisplay.php?$session[sessionurl]f=$forumid""&sort=$sortfield&order=$sortorder&pp=$perpage&daysprune=$daysprune&picon=$picon");
//*post icon filter hack 
UPDATE 1.00 TO 1.01 ADD THIS MODIFICATION
Find:
PHP Code:
    $sorturl "forumdisplay.php?$session[sessionurl]f=$forumid&daysprune=$daysprune"
And add immediately after it:
PHP Code:
//Post icon filter hack
    
if ($pqr) {
      
$noiconurl $sorturl;
      
$sorturl .= "&picon=$picon";
      }
//*post icon filter hack 



Ok, for the templates, in threadbit, find:
Code:
<img src="$thread[threadiconpath]" alt="$thread[threadicontitle]" border="0" />
And replace it with:
Code:
<a href="$sorturl&amp;picon=$thread[threadiconid]"><img src="$thread[threadiconpath]" alt="$thread[threadicontitle]" border="0" /></a>
Then in FORUMDISPLAY find:
Code:
	<if condition="$show['threadicons']">
		<td class="thead" colspan="2">&nbsp;</td>
	<else />
		<td class="thead">&nbsp;</td>
	</if>
And replace it with:

Code:
	<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>
It's working fine on our board. If you have any questions, just ask!

Show Your Support

  • This modification may not be copied, reproduced or published elsewhere without author's permission.

Comments
  #12  
Old 05-03-2005, 04:55 PM
JMPZ JMPZ is offline
 
Join Date: Feb 2005
Location: Illinois
Posts: 8
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Lynne
Where is "$noiconurl" defined? I'm just wondering because mine won't 'unfilter' and since I don't see that defined, I'm thinking that may be the culprit.
My good sir, you have found a bug, and a BIG one at that. It's missing. Here's the missing part. I'll add it to the first post obviously.

In forumdisplay.php, find:
PHP Code:
    $sorturl "forumdisplay.php?$session[sessionurl]f=$forumid&amp;daysprune=$daysprune"
And add immediately after it:
PHP Code:
//Post icon filter hack
    
if ($pqr) {
      
$noiconurl $sorturl;
      
$sorturl .= "&amp;picon=$picon";
      }
//*post icon filter hack 
Thanks for pointing it out. Sorry I missed that part.
Reply With Quote
  #13  
Old 05-05-2005, 12:22 PM
Lord Brar's Avatar
Lord Brar Lord Brar is offline
 
Join Date: Jul 2004
Posts: 102
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Woah! I've been looking for something like this.... can't wait for you to make it stable
Reply With Quote
  #14  
Old 08-19-2005, 08:10 PM
Fry Fry is offline
 
Join Date: Aug 2004
Location: Minooka, IL
Posts: 1
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Will this work with 3.5?
Reply With Quote
  #15  
Old 08-22-2005, 02:21 AM
hobbes747 hobbes747 is offline
 
Join Date: Jul 2005
Posts: 31
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I got it to work on RC2, but I had to change the variables a wee bit.

Beware, I'm a vBulletin novice, so I don't know if this compromises security or anything. If someone could verify that it's okay, that would be awesome.

The very first step, look for this instead
PHP Code:
$perpage =  $vbulletin->input->clean_gpc('r''perpage'TYPE_UINT);
$pagenumber $vbulletin->input->clean_gpc('r''pagenumber'TYPE_UINT);
$daysprune $vbulletin->input->clean_gpc('r''daysprune'TYPE_INT);
$sortfield $vbulletin->input->clean_gpc('r''sortfield'TYPE_STR); 
Immediately after, add this
PHP Code:
$picon $vbulletin->input->clean_gpc('r''picon'TYPE_INT); 
The second step is okay, but you have to be sure you are at the right $daysprune or it just won't work.

The third step, look for this instead
PHP Code:
$pagenav construct_page_nav($pagenumber$perpage$totalthreads'forumdisplay.php?' $vbulletin->session->vars['sessionurl'] . "f=$forumid"""
            
. (!empty($vbulletin->GPC['perpage']) ? "&amp;pp=$perpage"")
            . (!empty(
$vbulletin->GPC['sortfield']) ? "&amp;sort=$sortfield"")
            . (!empty(
$vbulletin->GPC['sortorder']) ? "&amp;order=" $vbulletin->GPC['sortorder'] : "")
            . (!empty(
$vbulletin->GPC['daysprune']) ? "&amp;daysprune=$daysprune""
Immediately after, add this
PHP Code:
. (!empty($vbulletin->GPC['picon']) ? "&amp;picon=$picon""
Everything else was the same I think. :nervous:
Reply With Quote
  #16  
Old 09-18-2005, 10:14 PM
thenetbox thenetbox is offline
 
Join Date: Mar 2002
Posts: 184
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

thank you!! Installed
Reply With Quote
  #17  
Old 09-18-2005, 10:26 PM
thenetbox thenetbox is offline
 
Join Date: Mar 2002
Posts: 184
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Also... do you know if choosing a category/thread/post icon can be made mandatory?
Reply With Quote
  #18  
Old 10-04-2005, 04:16 PM
thenetbox thenetbox is offline
 
Join Date: Mar 2002
Posts: 184
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Also.. how do you remove "No Icon" from the list?
Reply With Quote
  #19  
Old 10-20-2005, 08:46 AM
Wasim Wasim is offline
 
Join Date: Feb 2005
Posts: 65
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Is there any plan to make a Vb 3.5 version of this hack?

I'd really like one.
Reply With Quote
  #20  
Old 10-21-2005, 10:54 PM
Wired1's Avatar
Wired1 Wired1 is offline
 
Join Date: Nov 2003
Location: Orlando, FL, USA
Posts: 1,361
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Ok, 3.5.0 version is up:

https://vborg.vbsupport.ru/showthread.php?t=98978

AGAIN, THIS IS UNTESTED SO FAR. Shouldn't crash or anything though, too simple.
Reply With Quote
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 01:27 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.04731 seconds
  • Memory Usage 2,340KB
  • Queries Executed 26 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (4)bbcode_code
  • (14)bbcode_php
  • (1)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_post
  • (1)navbar
  • (6)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (10)post_thanks_box
  • (10)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (10)post_thanks_postbit_info
  • (9)postbit
  • (10)postbit_onlinestatus
  • (10)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.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/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_postinfo_query
  • fetch_postinfo
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete