PDA

View Full Version : Ability to search by users who are guests


Paul
05-17-2002, 03:19 PM
Hi,

Currently, when a person attempts to search by user name, the search results will only return posts made by registered users. How can I add functionality so that searches can be made on unregistered guests? Any ideas? Many thanks!

Paul

Xenon
05-17-2002, 03:50 PM
hmm, i have not tested, but i think this should work:

open search.php

goto line 451

shold look so:

if (trim($query)=="" and $DB_site->num_rows($users)==0) {


change it so:
if (trim($query)=="") {


after
$userssql=" AND (1=0 ";
while ($user=$DB_site->fetch_array($users)) {
$userssql.=" OR post.userid='$user[userid]'";
}
$userssql.=")";


add this:


if($DB_site->num_rows($users)==0 {
$userssql=" AND post.postusername='$searchuser' ";

}


hope this could help :)

it finds only the exact usernames i think, but you can surely optimize it ^^