Back to vBulletin 3.0 Add-Ons

Ignore maxresults in "Search by username"
Mod Version: 1.00, by azher

This modification is in the archives.
vB Version: 3.0.0 Rating: (0 vote - 0 average) Installs: 3
Released: 03 Apr 2004 Last Update: Never Downloads: 0
Not Supported  

Hello everyone,

I've been lurking for the past several years and figured I should probably start sharing a few quick hacks to "give back". I did a quick search but couldn't find anything that did this....

What this does: Makes "Find all posts by (member name)" actually find ALL posts by that member and ignores the value you specify (via the AdminCP) for your maximum search results (maxresults). This maxresults limit is also ignored if someone specifies a username in your "advanced search" options.

It's good for boards that want to keep the maxresults limited for performance reasons, however still want to allow members to search for all their (or someone else's) past posts.

On to the hack: This one is real quick, only three lines are edited in one file.

In search.php:

1. Find:

PHP Code:
if ($vboptions['maxresults'] > AND $numitems $vboptions['maxresults']) 
Change to:

PHP Code:
if ($vboptions['maxresults'] > AND $numitems $vboptions['maxresults'] AND !$search['searchuser']) 
2. Find:

PHP Code:
$threads $DB_site->query("
                SELECT threadid
                FROM " 
TABLE_PREFIX "thread AS thread
                LEFT JOIN " 
TABLE_PREFIX "deletionlog AS delthread ON(delthread.primaryid = thread.threadid AND delthread.type = 'thread')
                WHERE forumid IN(" 
implode(', '$forumids) . ")
                AND thread.lastpost >= 
$datecut
                AND visible = 1
                AND delthread.primaryid IS NULL
                ORDER BY lastpost DESC
                LIMIT  
$vboptions[maxresults]
"
); 
Change to:

PHP Code:
$threads $DB_site->query("
                SELECT threadid
                FROM " 
TABLE_PREFIX "thread AS thread
                LEFT JOIN " 
TABLE_PREFIX "deletionlog AS delthread ON(delthread.primaryid = thread.threadid AND delthread.type = 'thread')
                WHERE forumid IN(" 
implode(', '$forumids) . ")
                AND thread.lastpost >= 
$datecut
                AND visible = 1
                AND delthread.primaryid IS NULL
                ORDER BY lastpost DESC
"
); 
3. Remove:

PHP Code:
LIMIT " . ($vboptions['maxresults'] * 2) . " 
This has been tested on our medium-sized boards (350k posts, 3k users) running vB3 gold and everything seems to be in order.

Download

No files for download.


vblts.ru supports vBulletin®, 2022-2024