vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3.0 Full Releases (https://vborg.vbsupport.ru/forumdisplay.php?f=33)
-   -   Ignore maxresults in "Search by username" (https://vborg.vbsupport.ru/showthread.php?t=63359)

azher 04-01-2004 10:00 PM

Ignore maxresults in "Search by username"
 
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.

gmarik 04-03-2004 06:23 AM

Would be nice to search your own threads as well...

azher 04-03-2004 04:58 PM

Hello again,

UPDATE: Added a quick bugfix and "feature enhancement" ;) that allows more than the maxresults limit for "New Posts" and "Today's Posts", as well.

And yes, it works for searching your own (or other people's) threads as well. :D

denby 04-13-2006 09:17 PM

Is there an update for 3.5.4? I've had a go myself and I just can't get it working. :confused:

I want to return all the posts made in the last 24 hours without limit. Any help would be most appreciated. :)


All times are GMT. The time now is 08:31 AM.

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.01076 seconds
  • Memory Usage 1,732KB
  • 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
  • (5)bbcode_php_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (4)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
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete