Mod Name | Description | Tags | Likes |
\n";
$query= mysql_real_escape_string ($query);
if ($mode=="tags"){
if ($query=="dns"){
$qu_str="SELECT * FROM mods WHERE tags LIKE '%$query%'";
}else{
$qu_str="SELECT * FROM mods WHERE tags LIKE '%$query%' AND tags NOT LIKE '%dns%'";
}
}else if ($mode=="sb"){
if (is_numeric($query)==true){
echo "";
$qu_str="SELECT * FROM mods WHERE owner=$query";
}else{
$qu_str="SELECT * FROM mods WHERE tags NOT LIKE '%dns%' AND (tags LIKE '%$query%' OR name LIKE '%$query%' OR overview LIKE '%$query%')";
}
}
$res = mysql_query($qu_str." ORDER BY likes DESC",$handle) or SQLerror("MySQL Query Error","Error on searching database.mods.tags for '$query'");
$alternate=1;
// Get projects loop
$is_result=false;
$count=0;
while ($hash = mysql_fetch_assoc($res)){
$count++;
$is_result=true;
if ($alternate==0){
$bgcolor="#FFFFFF";
}else{
$bgcolor="#FFFFBD";
}
// Owner name from id (by Phitherek_)
$name="";
$q=0;
$q = mysql_query("SELECT name FROM users WHERE id=".$hash['owner']);
if ($q){
$qr = mysql_fetch_array($q) or print("");
$name=$qr['name'];
}
// End of Phitherek_' s code
$image="images/topicicon_read.jpg";
if ($hash['icon'])
$image="icon/".$hash['icon'];
// Owner name instead of id (by Phitherek_)
echo " | {$hash['name']} by $name | ";
// End of Phitherek_' s change
$overview=str_replace("\\'","'",$hash['overview']);
echo "$overview | ";
echo "".tagLinks($hash['tags'])." | ";
echo "{$hash['likes']} |
\n";
$alternate=1-$alternate;
}
$endtime = microtime(true);
$duration = $endtime - $starttime; //calculates total time taken
if ($is_result==false)
echo "no search results found |
";
else
echo "$count results in $duration seconds |
";
echo "";
?>