'); print('
'. ''. ''. ''. '
 Online Games > Search > '.$search.' ('.$maxrec.')


Please enter a search string.


'); } //============================================================== else{ $tstr=array(); $ln=strlen($search); $x=0; $d=" "; $s=""; for($i=0;$i<$ln;$i++){ $c=substr($search,$i,1); if($c==$d){if($s!=""){$tstr[$x++]=$s;$s="";} $d=" ";} else{ if($c=='"')$d='"'; elseif(($c>='0' && $c<='9') or ($c>='a' && $c<='z') or $c==" " or $c=="|"){ $s.=$c; } } } if($s!=""){$tstr[$x++]=$s;$s="";} //$tstr=explode(" ",$search); $maxrec=$x-1; $sqlfilter=""; $newstr=""; for($i=0;$i<=$maxrec;$i++){ $s=$tstr[$i]; if($s!=" " && strlen($s)>2){ if(substr($s,0,2)=="m|"){$sqlfilter.=" and d.member_id=".substr($s,2);} else{$sqlfilter.=" and d.search like '%".$s."%'";} if(strpos($s," "))$newstr.='"'.$s.'" '; else $newstr.=$s." "; } } //print($sqlfilter); $newstr=trim($newstr); //----------------------------------------------------------------- if($newstr==""){ //print('

'); print('
'. ''. ''. ''. '
 Online Games > Search > '.$search.' ('.$maxrec.')


Please enter a search string with more the two letters.


'); } else{ $search=$newstr; $sqlfilter=" and (".substr($sqlfilter,5).")"; $recstart=1; if(isset($_GET['st'])){ $recstart=$_GET['st']; } $maxshown=10; $grandtotal=0; $totalcnt=0+$recstart; //----------------------------------------------------------------- require("../inc/db.php"); $db = mysql_connect($dbserver,$dbuser,$dbpw); mysql_select_db($dbname,$db); //----------------------------------------------------------------- $result=mysql_query("select count(*) as cnt from ap_game_data d where url<>'' and status=1".$sqlfilter,$db); if( ($row=mysql_fetch_array($result)) ){$maxrec=$row['cnt'];} mysql_free_result($result); //----------------------------------------------------------------- if($recstart==1 && $search!=""){ $ip=$_SERVER['REMOTE_ADDR']; if($ip=="")$ip="none"; $searchstr=str_replace("'","'",strip_tags(trim($newstr))); mysql_query("update log_search set hits=hits+1,dt=now(),ip='".$ip."' where keywords='".$searchstr."'",$db); if(mysql_affected_rows()==0)mysql_query("insert into log_search(keywords,hits,data_type,type,dt,ip) values('".$searchstr."',1,0,0,now(),'".$ip."')",$db); } //----------------------------------------------------------------- //print('

'); print('
'. ''. ''); $rcnt=1; /* if( ($result = mysql_query("select d.data_id,d.title,d.des,d.picture,d.filesize,d.cat_id,d.created_dt,d.member_id". ",(TO_DAYS(now())-TO_DAYS(d.hit_dt)+1) numdays". ",(d.hit_cnt+hit_quick) as total". ",((d.hit_cnt+hit_quick)/(TO_DAYS(now())-TO_DAYS(d.hit_dt)+1)) as avgcnt". ",CONCAT(m.name_first,' ',m.name_last) as name,website,cp_name,cp_website". ",cat_string,f.format_name,d.rate_avg,rate_cnt". " from ap_game_data d,ap_members m,ap_game_cat c,ref_format f". " where d.url<>'' and d.status=1 and d.member_id=m.member_id and d.cat_id=c.cat_id and d.format_id=f.format_id".$sqlfilter. " order by (d.rate_avg*(rate_cnt/2)) desc,rate_cnt desc LIMIT ".($recstart-1).",".$maxshown,$db)) ){ //*/ if( ($result = mysql_query("select d.data_id,d.title,d.des,d.picture,d.filesize,d.cat_id,d.created_dt,d.member_id". ",author_name as name,author_url as website,author_cp_name as cp_name,author_cp_url as cp_website". ",cat_string,f.format_name,d.rate_avg,rate_cnt". " from ap_game_data d,ap_game_cat c,ref_format f". " where d.url<>'' and d.status=1 and d.cat_id=c.cat_id and d.format_id=f.format_id".$sqlfilter. " order by (d.rate_avg*(rate_cnt/2)) desc,rate_cnt desc LIMIT ".($recstart-1).",".$maxshown,$db)) ){ while( ($row = mysql_fetch_array($result))){ if(++$rcnt>1){if($grandtotal>0)print('');print('');$rcnt=0;} print(addrow($row,$totalcnt)); $grandtotal++; $totalcnt++; } mysql_free_result($result); if($grandtotal==0)print(''); else{ if(++$rcnt==1)print(''); if($grandtotal>0)print(''); } } else{ print(''); } mysql_close($db); print('
 Online Games > Search > '.$search.' ('.$maxrec.')


No Results Found.






We are currently updating our database.
Please use our search feature at a later time.


'. '

'.writepages($maxrec,$maxshown,$recstart,"searchgame.php?search=".$search."&").'
'); } //=========================================================== } include('../inc/apodfoot2.php'); //=========================================================== //=== FUNCTION ============================================== //=========================================================== function addrow($row,$totalcnt){ $lnk='gotogame.php?id='.$row['data_id']; $lnkDetail='details.php?id='.$row['data_id']; //-- GET AUTHOR ---------------------------- $author=''; if($row['name']!=''){ if($row['website']!='') $author=''.$row['name'].''; else $author=$row['name']; } if($row['cp_name']!='' && $row['name']!=$row['cp_name']){ if($row['cp_website']!='') $author.=' ['.$row['cp_name'].']'; else $author.=' ['.$row['cp_name'].']'; } $author.="
- view all games by author"; $fsize=''; if($row['filesize']>0)$fsize='('.$row['filesize'].'kb)'; $catname=$row['cat_string']; //--------------------------------------------- $av=$row['rate_avg']; $av_cnt=$row['rate_cnt']; $av_str="
Average Rating: None"; if($av_cnt>0)$av_str="
Average Rating: ".number_format($av,2)." of 5.00 (from ".$av_cnt." ratings)"; //-- CREATE STRING ---------------------------- if($row['picture']=="none")$gamepix="none"; else $gamepix="a/".(substr($row['picture'],0,1).'/'.$row['picture']); return ''.$totalcnt.''. ''.$row['title'].' '.$fsize.'
'. 'by '.$author.'
'. '
Category: '.$row['format_name'].' : '.$row['cat_string'].$av_str."
". '

'.$row['des'].'   submitted '.fmtdate('m/j/y',$row['created_dt']).'
'. ''; } //=========================================================== ?>