$b["avg_rating"]) ? -1 : 1; } function cmp_avg_rev($a, $b) { if ($a["avg_rating"] == $b["avg_rating"]) { return 0; } return ($a["avg_rating"] < $b["avg_rating"]) ? -1 : 1; } function cmp_tot($a, $b) { if ($a["total"] == $b["total"]) { return 0; } return ($a["total"] > $b["total"]) ? -1 : 1; } $posts_per_page=$user["searchprods"]?$user["searchprods"]:10; if(($type!="prod")&&($type!="group")&&($type!="party")&&($type!="board")&&($type!="user")&&($type!="bbs")) { $type="prod"; } $what=trim($what); if($what) { conn_db(); $mywhat=strtr($what," ","%"); $subquery="%".$mywhat."%"; if($type=="prod") { $query="SELECT count(0) FROM prods WHERE prods.name LIKE '".$subquery."'"; $result=mysql_query($query); $nb_posts=mysql_result($result,0); if(($page<=0)||(!$page)) { $page=1; //ceil($nb_posts/$posts_per_page); } $query="SELECT prods.id,prods.name,prods.views,prods.type,prods.date,prods.party,prods.party_year,prods.party_place,prods.partycompo,prods.group1,prods.group2,prods.group3,parties1.name as partyname FROM prods LEFT JOIN parties as parties1 ON parties1.id=prods.party WHERE prods.name LIKE '".$subquery."' ORDER BY name"; $query.=" LIMIT ".(($page-1)*$posts_per_page).",".$posts_per_page; } elseif($type=="group") { $query="SELECT count(0) FROM groups WHERE name LIKE '".$subquery."' OR acronym LIKE '".$subquery."'"; $result=mysql_query($query); $nb_posts=mysql_result($result,0); if(($page<=0)||(!$page)) { $page=1; //ceil($nb_posts/$posts_per_page); } $query="SELECT id,name,acronym,web FROM groups WHERE name LIKE '".$subquery."' OR acronym LIKE '".$subquery."' ORDER BY name"; $query.=" LIMIT ".(($page-1)*$posts_per_page).",".$posts_per_page; } elseif($type=='party') { $query="SELECT count(0) FROM parties WHERE name LIKE '".$subquery."'"; $result=mysql_query($query); $nb_posts=mysql_result($result,0); if(($page<=0)||(!$page)) { $page=1; //ceil($nb_posts/$posts_per_page); } $query="SELECT id,name,web FROM parties WHERE name LIKE '".$subquery."' ORDER BY name"; $query.=" LIMIT ".(($page-1)*$posts_per_page).",".$posts_per_page; } elseif($type=='board') { $query="SELECT count(0) FROM bbses WHERE name LIKE '".$subquery."' OR sysop LIKE '".$subquery."' OR phonenumber LIKE '".$subquery."'"; $result=mysql_query($query); $nb_posts=mysql_result($result,0); if(($page<=0)||(!$page)) { $page=1; //ceil($nb_posts/$posts_per_page); } $query="SELECT id,name,sysop,phonenumber FROM bbses WHERE name LIKE '".$subquery."' OR sysop LIKE '".$subquery."' OR phonenumber LIKE '".$subquery."' ORDER BY name"; $query.=" LIMIT ".(($page-1)*$posts_per_page).",".$posts_per_page; } elseif($type=="user") { $query="SELECT count(0) FROM users WHERE nickname LIKE '".$subquery."'"; $result=mysql_query($query); $nb_posts=mysql_result($result,0); if(($page<=0)||(!$page)) { $page=1; //ceil($nb_posts/$posts_per_page); } $query="SELECT id,nickname,avatar,glops,quand FROM users WHERE nickname LIKE '".$subquery."' ORDER BY nickname"; $query.=" LIMIT ".(($page-1)*$posts_per_page).",".$posts_per_page; } elseif($type=='bbs') { $query="SELECT COUNT(distinct bbs_topics.id) FROM bbs_topics LEFT JOIN bbs_posts ON bbs_topics.id=bbs_posts.topic WHERE bbs_topics.topic LIKE '".$subquery."' OR bbs_posts.post LIKE '".$subquery."'"; $result=mysql_query($query); $nb_posts=mysql_result($result,0); if(($page<=0)||(!$page)) { $page=1; //ceil($nb_posts/$posts_per_page); } $query="SELECT bbs_topics.id,bbs_topics.topic,bbs_topics.lastpost,bbs_posts.post FROM bbs_topics LEFT JOIN bbs_posts ON bbs_topics.id=bbs_posts.topic WHERE bbs_topics.topic LIKE '".$subquery."' OR bbs_posts.post LIKE '".$subquery."' GROUP BY bbs_topics.id ORDER BY bbs_topics.lastpost DESC"; $query.=" LIMIT ".(($page-1)*$posts_per_page).",".$posts_per_page; } $result=mysql_query($query); $nbresults=mysql_num_rows($result); while($tmp=mysql_fetch_array($result)) { if($type=="user") { if(!$tmp["nickname"]) { $tmp["nickname"]=$tmp["login"]; } } $results[]=$tmp; } if ($nbresults==1 && !$_GET["page"] && !$_GET["dontredirect"]) { switch($type) { case "prod": header("Location: prod.php?which=".$results[0][0]); exit(); break; case "group": header("Location: groups.php?which=".$results[0][0]); exit(); break; case "party": header("Location: party.php?which=".$results[0][0]); exit(); break; case "board": header("Location: bbses.php?which=".$results[0][0]); exit(); break; case "user": header("Location: user.php?who=".$results[0][0]); exit(); break; } } } ?>
search on pouët.net
 I'm looking for   and this is a [ >  | >  | >  | >  | >  | >  ] 


0): if($type=="prod") { for($i=0;$i<$nbresults;$i++) { unset($commentss); // unset($checktable); $checktable = array(); unset($rulez); unset($sucks); unset($total); //thumbs and avg math $query = "SELECT comments.rating,comments.who FROM comments WHERE comments.which='".$results[$i]["id"]."'"; $result=mysql_query($query); while($tmp=mysql_fetch_array($result)) { $commentss[]=$tmp; } for($ii=0;$ii27): if (strlen($results[$i]["groupn1"])>10 && $results[$i]["groupacron1"]) $results[$i]["groupn1"]=$results[$i]["groupacron1"]; if (strlen($results[$i]["groupn2"])>10 && $results[$i]["groupacron2"]) $results[$i]["groupn2"]=$results[$i]["groupacron2"]; if (strlen($results[$i]["groupn3"])>10 && $results[$i]["groupacron3"]) $results[$i]["groupn3"]=$results[$i]["groupacron3"]; endif; //get platforms $query="select platforms.name from prods_platforms, platforms where prods_platforms.prod='".$results[$i]["id"]."' and platforms.id=prods_platforms.platform"; $result=mysql_query($query); $check=0; $results[$i]["platform"]=""; while($tmp = mysql_fetch_array($result)) { if ($check>0) $results[$i]["platform"].=","; $check++; $results[$i]["platform"].=$tmp["name"]; } //get array of sceneorgrecommendations for these results $result=mysql_query("SELECT * from sceneorgrecommended where prodid=".$results[$i]["id"]." ORDER BY type"); while($tmp=mysql_fetch_array($result)) { $sceneorgrecommends[]=$tmp; } } //get max_views for popularity $result=mysql_query("SELECT MAX(views) FROM prods"); $max_views=mysql_result($result,0); } ?>
\n"; if($i%2) { print(""); } else { print(""); } $typess = explode(",", $results[$i]["type"]); print("\n"); ?> ".$results[$i]["party_place"].$placeadj." at ".$results[$i]["partyname"]." ".sprintf("%02d",$results[$i]["party_year"])."".$compophrase."
\n"); break; case 2: case 22: case 32: case 42: case 52: case 62: case 72: case 82: case 92: $placeadj="nd"; print("\n"); break; case 3: case 23: case 33: case 43: case 53: case 63: case 73: case 83: case 93: $placeadj="rd"; print("\n"); break; case 97: print("\n"); break; case 98: print("\n"); break; case 99: print("\n"); break; default: $placeadj="th"; print("\n"); break; } } else { $placeadj = "??"; print("\n"); } } else { print("\n"); } if( ($results[$i]["date"]!="0000-00-00") && (strlen($results[$i]["date"])>0) ) { $rdate=explode("-",$results[$i]["date"]); switch($rdate[1]) { case "01": $rmonth="January"; break; case "02": $rmonth="February"; break; case "03": $rmonth="March"; break; case "04": $rmonth="April"; break; case "05": $rmonth="May"; break; case "06": $rmonth="June"; break; case "07": $rmonth="July"; break; case "08": $rmonth="August"; break; case "09": $rmonth="September"; break; case "10": $rmonth="October"; break; case "11": $rmonth="November"; break; case "12": $rmonth="December"; break; } print("\n"); } else { print("\n"); } if($results[$i]["avg_rating"]>0) $thumbgfx="gfx/rulez.gif"; elseif($results[$i]["avg_rating"]==0) $thumbgfx="gfx/isok.gif"; else $thumbgfx="gfx/sucks.gif"; printf("\n",$results[$i]["avg_rating"]); if ($results[$i]["total"]) { print("\n"); } else {print("\n"); } //popularity bar print("\n"); ?> 0): ?>

name
group
release party
release date
rating rating rating # popularity
"); if(count($sceneorgrecommends)): print(""); endif; if($results[$i]["cdc"]): print(""); endif; print(""); $platforms = explode(",", $results[$i]["platform"]); for($kkk=0;$kkk
"); for($k=0;$k"); } print("

".strtolower(stripslashes($results[$i]["name"]))."
 "); for($k=0;$k"); } print("
"); cdcstack($results[$i]["cdc"]); // for($ii=0;$ii<$results[$i]["cdc"];$ii++): print("\"cdc\""); // endfor; print("
 
"> "> "> ".$results[$i]["party_place"].$placeadj." at ".$results[$i]["partyname"]." ".sprintf("%02d",$results[$i]["party_year"])."".$compophrase."
".$results[$i]["party_place"].$placeadj." at ".$results[$i]["partyname"]." ".sprintf("%02d",$results[$i]["party_year"])."".$compophrase."
disqualified at ".$results[$i]["partyname"]." ".sprintf("%02d",$results[$i]["party_year"])."".$compophrase."
for ".$results[$i]["partyname"]." ".sprintf("%02d",$results[$i]["party_year"])."
not shown at ".$results[$i]["partyname"]." ".sprintf("%02d",$results[$i]["party_year"])."".$compophrase."
".$results[$i]["party_place"].$placeadj." at ".$results[$i]["partyname"]." ".sprintf("%02d",$results[$i]["party_year"])."".$compophrase."
".$results[$i]["party_place"].$placeadj." at ".$results[$i]["partyname"]."
 
".$rmonth." ".$rdate[0]."
 
\n
 %.2f \"average
\n".$results[$i]["total"]."\n0\n"); $pourcent = floor($results[$i]["views"]*100/$max_views); //print($pourcent."%<\td>\n"); DoBar($pourcent); print("
=2): ?>

  previous page
 
next page
 
\n"); } else { print("\n"); } print("\n"); if($results[$i]["web"]) { print("\n"); } else { print("\n"); } if($nb_prods) { print("\n"); } else { print("\n"); } print("\n"); } ?> 1): ?>

groups
websites prods
".$results[$i]["name"]); if($results[$i]["acronym"]) print(" [".$results[$i]["acronym"]."]"); print("
".strtolower($results[$i]["web"])."
".$nb_prods."
=2): ?>

  previous page
 
next page
 
\n"); } else { print("\n"); } print("\n"); if($results[$i]["web"]) { print("\n"); } else { print("\n"); } if($nb_prods) { print("\n"); } else { print("\n"); } print("\n"); } ?> 1): ?>

party name
websites prods
".$results[$i]["name"]."
".strtolower($results[$i]["web"])."
".$nb_prods."
=2): ?>

  previous page
 
next page
 
\n"); } else { print("\n"); } print("\n"); if($results[$i]["web"]) { print("\n"); } else { print("\n"); } if($nb_prods) { print("\n"); } else { print("\n"); } print("\n"); } ?> 1): ?>

party name
websites prods
".$results[$i]["name"]."
".strtolower($results[$i]["web"])."
".$nb_prods."
=2): ?>

  previous page
 
next page
 
\n"); } else { print("\n"); } print("\n"); if($results[$i]["sysop"]) { print("\n"); } else { print("\n"); } if($results[$i]["phonenumber"]) { print("\n"); } else { print("\n"); } print("\n"); } ?> 1): ?>

board name
sysop number
".$results[$i]["name"]."
".strtolower($results[$i]["sysop"])."
".strtolower($results[$i]["phonenumber"])."
=2): ?>

  previous page
 
next page
 
1): ?>

nickname
glops registered
">" width="16" height="16" border="0" alt="">
  ">


=2): ?>

  previous page
 
next page
 
1): ?>

topic
last post
">\$1",$p); //$p = str_replace($v,"".$v."",$p); } */ $s = preg_replace("/(\s+)/"," ",$s); $s = htmlspecialchars(mb_strcut($s,max(0,stripos($s,$a[0])-50),100,"utf-8")); foreach ($a as $v2) { $s = preg_replace("/(".$v2.")/i","$1",$s); } echo $s; ?>
$1",$s); } // foreach($a as $v) // $p = preg_replace("/(".addcslashes($v,"/*").")/i","\$1",$p); // $p = str_replace($v,"".$v."",$p); echo "... ".$s." ..."; ?>
=2): ?>

  previous page
 
next page
 


"); endif; ?>