vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   Member Archives (https://vborg.vbsupport.ru/forumdisplay.php?f=202)
-   -   Most popular searches hack... (https://vborg.vbsupport.ru/showthread.php?t=13768)

claypots 04-11-2001 08:05 PM

I've been looking for a hack like this for a long time and saw it here (lists the last ten searches):

http://www.sitepointforums.com/search.php

Did this get distributed here? Anyone know where I can get it?

Freddie Bingham 04-11-2001 08:26 PM

The searches are stored in the search table and you can quite easily duplicate what Wayne has done.

Wayne Luke 04-11-2001 09:41 PM

In search.php look for:
PHP Code:

  $searchforumbits=getsearchforums(); 

Under it add:
PHP Code:

  //WL 26-MAR-2001
  //Show Last Ten Searches.
  
$latestsearches $DB_site->query("SELECT searchid, querystring, username, dateline FROM search LEFT JOIN user on (search.userid=user.userid) WHERE querystring <> '' ORDER BY dateline DESC LIMIT 10");
  
$toggle "#DEDEDE";
  while (
$latestsearch=$DB_site->fetch_array($latestsearches)) {
    
$latestsearch['date']=vbdate($dateformat,$latestsearch['dateline']);
    
$latestsearch['time']=vbdate($timeformat,$latestsearch['dateline']);
    if (
$toggle%2==0) {
      
$backcolor="#DEDEDE";
    } else {
      
$backcolor="#EFEFEF";
    }
    eval(
"\$searchbits .= \"".gettemplate("search_latestbit")."\";");
    
$toggle++;
  }
  
//End Latest Searches. 

Create a template called search_latestbit:
Code:

<tr color="$backcolor">
  <td><normalfont><a href="search.php?s=$session[sessionhash]&action=showresults&searchid=$latestsearch[searchid]">$latestsearch[querystring]</a></normalfont></td>
  <td>$latestsearch[date]&nbsp;$latestsearch[time]</td>
</tr>

Modify your searchintro template to include:
Code:

<table bgcolor="#FFFFFF" border=0 cellpadding=4 cellspacing=1 width="100%">
<tr bgcolor="#6c6081"><TD COLSPAN=2>
  <normalfont color="#afa3c5" class=thtcolor><B>Last Ten Searches</B></normalfont></td></tr>
<tr>
<tr bgcolor="#6c6081">
  <td width="65%"><normalfont color="#f5d300">Search Text</normalfont></td>
  <td width="35%"><normalfont color="#f5d300">Performed At:</normalfont></td>
</tr>
$searchbits
</table>


claypots 04-12-2001 12:32 AM

Wow, thanks. I'll try this!

MrLister 04-12-2001 12:55 AM

Thanks!!!!!! YOU DA MAN!

Wayne Luke 04-12-2001 04:48 AM

No problem. I will share any code that doesn't jeopardize the competitiveness or financial stability of my communities.


All times are GMT. The time now is 11:47 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.01380 seconds
  • Memory Usage 1,729KB
  • 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
  • (2)bbcode_php_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (6)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