Version: 1.00, by AntiOnline
Developer Last Online: Jun 2004
Version: 2.2.x
Rating:
Released: 03-06-2002
Last Update: Never
Installs: 156
No support by the author.
Greetings All:
Updated 3/11/2002: Hack now shows the date and time each search was made, plus the number of results. Also included is the security fix by firefly (thanks).
Updated 3/8/2002: It now also links those search words to the previous search results.
Here's just a little fun feature that I added for my users, and thought that I would share with everyone else. It works with versions 2.03 and up, requires no modifications to your database, and should take less than 2 minutes to install:
This hack displays the last 10 searches made by your users on your main site search page. It uses your censor options to make sure nothing naughty shows up (unless, that is, you want it to).
P.S - no i did not copy the blue idea form here..lol i just noticed how alike they are.., well sort of but nto really (it was my works old color scheme.
Originally posted by Crazy Mofo how can you make it like here so it doesnt show the black lines?
Change the PHP code in search.php like this:
PHP Code:
// begin last search hack by JP
$colstart1="<td bgcolor='{ secondaltcolor }'><smallfont>";
$colstart2="<td align='center' bgcolor=' { firstaltcolor }' width=15%><smallfont>";
$colend="</smallfont></td>";
$lastsearches=$DB_site->query('SELECT searchid,postids,dateline,querystring FROM search LEFT JOIN user USING (userid) WHERE queryst
ring!="" AND usergroupid NOT IN (5,6,7) ORDER BY searchid desc LIMIT 0,10');
while ($lastsearchcount=$DB_site->fetch_array($lastsearches)):
$lastsearchdate=vbdate($dateformat,$lastsearchcount[dateline]);
$lastsearchtime=vbdate($timeformat,$lastsearchcount[dateline]);
$ourlastquery=$lastsearchcount[querystring];
$ourlastquery=bbcodeparse($ourlastquery);
$ourlastquery=censortext($ourlastquery);
$lastsearchresultscount="$lastsearchcount[postids]";
$lastsearchresultscount=explode(",",$lastsearchresultscount);
$lastsearchresultscount=sizeof($lastsearchresultscount);
$lastsearchmatches.="$lastsearchresultscount posts<br>";
$lastsearchkeywords.="<a href='search.php?s=&action=showresults&searchid=$lastsearchcount[searchid]&sortby=lastpost&sortorder=desce
nding'>$ourlastquery</a><br>";
$lastsearchtimestamp.="$lastsearchdate at $lastsearchtime<br>";
endwhile;
$lastsearch="<tr>".$colstart2.$lastsearchmatches.$colend.$colstart1.$lastsearchkeywords.$colend.$colstart2.$lastsearchtimestamp.$co
lend."</tr>";
// end last search hack by JP
It will also use alternating colours for the columns
patvdv your code is giving me error can you check your code as i'd like to have your layout
Mone'
Quote:
Originally posted by patvdv
Change the PHP code in search.php like this:
PHP Code:
// begin last search hack by JP
$colstart1="<td bgcolor='{ secondaltcolor }'><smallfont>";
$colstart2="<td align='center' bgcolor=' { firstaltcolor }' width=15%><smallfont>";
$colend="</smallfont></td>";
$lastsearches=$DB_site->query('SELECT searchid,postids,dateline,querystring FROM search LEFT JOIN user USING (userid) WHERE queryst
ring!="" AND usergroupid NOT IN (5,6,7) ORDER BY searchid desc LIMIT 0,10');
while ($lastsearchcount=$DB_site->fetch_array($lastsearches)):
$lastsearchdate=vbdate($dateformat,$lastsearchcount[dateline]);
$lastsearchtime=vbdate($timeformat,$lastsearchcount[dateline]);
$ourlastquery=$lastsearchcount[querystring];
$ourlastquery=bbcodeparse($ourlastquery);
$ourlastquery=censortext($ourlastquery);
$lastsearchresultscount="$lastsearchcount[postids]";
$lastsearchresultscount=explode(",",$lastsearchresultscount);
$lastsearchresultscount=sizeof($lastsearchresultscount);
$lastsearchmatches.="$lastsearchresultscount posts<br>";
$lastsearchkeywords.="<a href='search.php?s=&action=showresults&searchid=$lastsearchcount[searchid]&sortby=lastpost&sortorder=desce
nding'>$ourlastquery</a><br>";
$lastsearchtimestamp.="$lastsearchdate at $lastsearchtime<br>";
endwhile;
$lastsearch="<tr>".$colstart2.$lastsearchmatches.$colend.$colstart1.$lastsearchkeywords.$colend.$colstart2.$lastsearchtimestamp.$co
lend."</tr>";
// end last search hack by JP
It will also use alternating colours for the columns