Invalid ID

'); } else{ $gid=$_GET['id']; $maxshown=10; $sql=""; $recstart=1; if(isset($_GET['st'])) $recstart=$_GET['st']; $tp="0"; if(isset($_GET['tp'])) $tp=$_GET['tp']; if($tp=="1")$sql=" and member_id<>''"; elseif($tp=="2")$sql=" and member_id is null"; require("../inc/db.php"); $db = mysql_connect($dbserver,$dbuser,$dbpw); mysql_select_db($dbname,$db); dp_review($gid,$sql,$maxshown,$recstart); mysql_close($db); } //==================================================================================== function dp_review($gid,$sql,$maxshown,$recstart){ global $db; print("document.write('
');\n"); //-- GET GAME NAME ---------------------------- $gametitle=""; if( ($result = mysql_query("select title from ap_game_data where data_id=".$gid,$db)) ){ if( ($rs= mysql_fetch_array($result)) ){ $gametitle=$rs['title'];} mysql_free_result($result); } //-- GET MAX RECORDS ---------------------------- $maxrec=0; if( ($result = mysql_query("select count(*) as cnt from ap_review where status<=1 and data_type=0 and data_id=".$gid.$sql,$db)) ){ if( ($rs= mysql_fetch_array($result)) ){ $maxrec=$rs['cnt'];} mysql_free_result($result); } print("function revLoadPage(pg){ajaxSubmitGameReviewList(".$gid.",".$maxrec.",pg,'revlist');}\n"); print("document.write('
Reviews for ".str_replace("'","\'",$gametitle)." (".$maxrec.")
');\n"); print("document.write('
...
');\n"); write_review($gid); print("document.write('
');"); /* if($maxrec>0){ if($rs_rev = mysql_query("select a.guestname,a.review,a.dt,r.rev_rating_name,a.member_id". " from ap_review a,ref_rev_rating r". " where a.rev_rating_id=r.rev_rating_id and a.status<=1 and a.data_type=0 and a.data_id=".$gid.$sql. " order by a.dt desc LIMIT ".($recstart-1).",".$maxshown,$db) ){ $review_cnt=$recstart; while( ($rs= mysql_fetch_array($rs_rev)) ){ if($rs['member_id']<>"")$name=(''.$rs['guestname'].' '); else $name=('(Guest)  '); print("document.write('
".$review_cnt.". ".clean($rs['rev_rating_name'])." | by ".clean($name)." on ".fmtdate('l M j, Y h:i A',$rs['dt'])."
    ".clean($rs['review'])."
');"); $review_cnt++; } mysql_free_result($rs_rev); print("document.write('
".writepagesform($maxrec,$maxshown,$recstart,"reviewpg")."
');"); } }//*/ print("document.write('
');"); print("document.write('
');\n"); print("revLoadPage(1);"); } //==================================================================================== function write_review($gid){ print("function revLoadImages(){if(document.images){star_0=new Image;star_0.src='/img/star_0.gif';star_1=new Image;star_1.src='/img/star_1.gif';}}\n"); print("var revRated;revRated=0;\n"); print("function revRateReset(){revRateStar(0);revRated=0;document.submitreview.revtext.value='';}"); print("function revRateStar(num){var i;i=1;while(i<=num){document.images['rate1'+i].src=star_1.src; i++; } while(i<=5){document.images['rate1'+i].src=star_0.src; i++;}"); print("document.submitreview.revrate.value=num;revRated=1;revWratingDes(num,1);document.submitreview.submit.focus();}"); print("function revWratingDes(num,bd){switch(num+''){case '0':val='No rating';break; case '1':val='Waste of time';break; case '2':val='Not good, but worth a look ';break; case '3':val='Decent, could be better ';break; case '4':val='Good, I liked it ';break; case '5':val='Excellent!! I\'ll play this again!';break;}if(bd==0)ge('ratingdes').innerHTML=val;else ge('ratingdes').innerHTML=''+val+'';}\n"); print("function revSubmit(fm){fm.revtext.value=trim(fm.revtext.value);if(fm.revtext.value==''){alert('Please write a review.');fm.revtext.focus();return;}"); print('count=1;i=0;pos=0;do{pos=fm.revtext.value.substring(i).indexOf(" ");if(pos>=0)i+=pos+1;if(pos>0)count++;}while(pos>=0&&pos<40);'); print('if(pos>=40|| (fm.revtext.value.length-i)>=40){alert("Please do not write SUPER LONG words.");fm.revtext.focus();return;}'); print('else if(count<2){alert("Please write more then 2 words. Thank You."); fm.revtext.focus();return;}'); print('var badwords= new Array("fuck","shit","dick","asshole","pussy","penis","blowjob","bitch","slut","cunt","twat","anal");'); print("var tempstr= fm.revtext.value.toLowerCase();"); print('for(i=0;i=0){alert("Please do not use the word ["+badwords[i]+"].");fm.revtext.focus();return;}}'); //print("if(revRated==0){alert('Please select a rating.');return;}"); print("ajaxSubmitGameReview('".$gid."',fm.revrate.value,fm.revtext.value);}\n"); print("revLoadImages();\n"); print("document.write('
');"); print("document.write('');\n"); print("document.write('');\n"); print("document.write('
Rating: ');\n"); print("document.write('');\n"); print("document.write('');\n"); print("document.write('');\n"); print("document.write('');\n"); print("document.write('   
');\n"); print("document.write('
');\n"); print("document.write('
');"); print("document.write('
');\n"); } //==================================================================================== function clean($s){ return str_replace("'","\'",str_replace("\r"," ",str_replace("\n"," ",$s))); } ?>