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)
-   -   vB3 15 Most Recent Searches Made By Our Members (https://vborg.vbsupport.ru/showthread.php?t=61424)

chapsrulez 07-26-2004 05:15 PM

Quote:

Originally Posted by Boofo
I don't use these tables in any of the queries. You might want to check the code again. ;)

forosearch
forouser

"foro" is my table prefix.

gcurrey 07-31-2004 02:56 PM

Boofo - Great mod! Do you have some php code that can be run to view ALL searches done which the admin can install/hide somewhere separately from the VB output to keep track of all searches? Maybe this admin version could have a text box so you can specify the amount of entries to display.

qxh 08-12-2004 11:28 PM

Yeah tables with a prefix have problems with this hack.

cybermomcafe 08-18-2004 10:38 PM

I can't get it to work... i use vb3_ as my table prefix... any way to make it work?

Thanks!!

Here's the error I get...

Database error in vBulletin 3.0.3:
Code:

Database error in vBulletin 3.0.3:

Invalid SQL: SELECT search.searchid,search.orderedids,search.dateline,search.query,search.userid,user.username,user.userid,user.usergroupid FROM vb3_search,vb3_user WHERE query!='' AND user.userid = search.userid AND usergroupid NOT IN (5,6,7) ORDER BY searchid desc LIMIT 0,15
mysql error: Unknown table 'search' in field list

mysql error number: 1109


cybermomcafe 08-18-2004 11:51 PM

I got it to work...

I changed the SELECT query (line 14 of the part to be added to search.php) from:

Code:

$lastsearches=$DB_site->query("SELECT search.searchid,search.orderedids,search.dateline,search.query,search.userid,user.username,user.userid,user.usergroupid FROM " . TABLE_PREFIX . "search," . TABLE_PREFIX . "user WHERE query!='' AND user.userid = search.userid AND usergroupid NOT IN (5,6,7) ORDER BY searchid desc LIMIT 0,15");
to (the table prefix on my board is vb3_)...

Code:

$lastsearches=$DB_site->query("SELECT vb3_search.searchid,vb3_search.orderedids,vb3_search.dateline,vb3_search.query,vb3_search.userid,vb3_user.username,vb3_user.userid,vb3_user.usergroupid FROM " . TABLE_PREFIX . "search," . TABLE_PREFIX . "user WHERE query!='' AND vb3_user.userid = vb3_search.userid ORDER BY searchid desc LIMIT 0,15");
I removed the usergroups, because I wanted mod/admin searches to show.

I also wrapped the search_forums template edit with this conditional, because I wanted only Admin to see the recent searches.

Code:

<if condition="$bbuserinfo[usergroupid] == 6">

</if>

thanks Boofo!

cybermomcafe 08-19-2004 01:13 AM

One more question... Is there some sort of time limit that the most recent searches are cached for?

When I tested it around 8pm it listed like 4 searches, now it's a bit after 10 and they aren't listed any more?

Thanks!

Boofo 08-20-2004 05:00 PM

Quote:

Originally Posted by cybermomcafe
I can't get it to work... i use vb3_ as my table prefix... any way to make it work?

Thanks!!

Here's the error I get...

Database error in vBulletin 3.0.3:
Code:

Database error in vBulletin 3.0.3:
 
Invalid SQL: SELECT search.searchid,search.orderedids,search.dateline,search.query,search.userid,user.username,user.userid,user.usergroupid FROM vb3_search,vb3_user WHERE query!='' AND user.userid = search.userid AND usergroupid NOT IN (5,6,7) ORDER BY searchid desc LIMIT 0,15
mysql error: Unknown table 'search' in field list
 
mysql error number: 1109


Try this query:

PHP Code:

$lastsearches=$DB_site->query(
SELECT search.searchid,search.orderedids,search.dateline,search.query,search.userid,use    r.username,user.userid,user.usergroupid 
FROM " 
TABLE_PREFIX "search AS search," TABLE_PREFIX "user AS user 
WHERE query!='' 
AND user.userid = search.userid 
 AND usergroupid NOT IN (5,6,7) 
ORDER BY searchid desc LIMIT 0,15 
"
); 


weirdpixels 08-23-2004 12:34 PM

*clicks install
thats now 100 installs well done :)

kenji4861 09-11-2004 02:14 PM

Works great on VB3.0.3 THANK YOU!

Boofo 09-11-2004 07:39 PM

Quote:

Originally Posted by kenji4861
Works great on VB3.0.3 THANK YOU!

Don't forget the install button. ;)


All times are GMT. The time now is 09:34 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.01248 seconds
  • Memory Usage 1,743KB
  • 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_code_printable
  • (1)bbcode_php_printable
  • (3)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (4)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