real_escape_string($gameid); $query = "select seq, baseurl, flash_file, id, title, description, category, largethumbnail, thumbnail, width, height, url, gameplays, rating, template, localflash, cloud, cloudflash, urlflash, source, localswf, localswfdir from games where seotitle='$gid' limit 0,1"; $result = $mysqli->query($query); error_log(mysql_error()); error_log("full screen mode for game $gid "); // echo $query; while($row = $result->fetch_assoc()) { $title=$row['title']; $maintitle = $title; $baseurl=$row['baseurl']; $cloudflash=$row['cloudflash']; $flash_file=$row['flash_file']; $localswf=$row['localswf']; $localswfdir=$row['localswfdir']; $flash_file = $localswfdir."/".$localswf; $thegameurl=$row['url']; $urlflash = $row['urlflash']; $localflash=$row['localflash']; $template=$row['template']; $height=$row['height']; $width=$row['width']; $fid=$row['id']; $source=$row['source']; $localflash=$row['localflash']; if ($localflash=='1' && ( $source=='localgl' || $source=='izzygames.com') ) { $flash_file="http://games.kidzsearch.com/computer/crawl/kidzsearchgl-$fid.swf"; if($cloudflash==1) { $flash_file="http://s3.amazonaws.com/kidz/kidzsearchgl-$fid.swf"; $localimgthumb='1'; $header_response = get_headers($flash_file, 1); $header_response = $header_response[0]; // print_r($header_response); if (stripos($header_response,'404') !== false || stripos($header_response,'forbid') !== false) { error_log("S3 CACHE MISSING for EMBED $flash_file "); $errormessage2="S3 CACHE MISSING EMBED for $flash_file "; $flash_file="http://games.kidzsearch.com/computer/crawl/kidzsearchgl-$fid.swf"; } } } $ksembed = str_replace("KSWIDTH","100%",$template); $ksembed = str_replace("KSHEIGHT","100%",$ksembed); $ksembed = str_replace("KSID",$fid,$ksembed); $ksembed = str_replace("KSFLASHFILEBASE",$baseurl,$ksembed); $ksembed = str_replace("KSFLASHFILE",$flash_file,$ksembed); $ksembed = str_replace("KSTITLE",$title,$ksembed); $ksembed=stripslashes($ksembed); $basebig="http"; //echo "SOURCE: $source "; // patch //securly iss with gamedistribution if( $source=="xxxgamedistribution" || $source=="xxxgameflare") { // see if gamedistribution has it instead (-77 is backup status) $mysqlid = new mysqli('localhost', 'gamez', 'zentech2', 'gamez-db'); $queryd = "select source, flashcheckresult, seq, status, value, plays, counter, baseurl, flash_file, id, title, instructions, tags, description, category, largethumbnail, thumbnail, width, height, url, gameplays, ismobile, rating, fullscreen, template, source, img1, localflash, cloud, fsonly, cloudflash, urlflash, direct, mobiledirect, islearning, mobileonly, altflash from games where title='$maintitle' and (source='lofgames' or source='gamemonetize' ) and (status > -1 || status='-77') and flashcheckresult > -1 order by source desc, seq desc limit 0,1"; // echo $queryd; $resultd = $mysqlid->query($queryd); if( mysqli_num_rows($resultd ) > 0){ while($rowd = $resultd->fetch_assoc()) { $width=$rowd['width']; $source=$rowd['source']; $height=$rowd['height']; $thegameurl=$rowd['url']; $template=$rowd['template']; $flash_file=$rowd['flash_file']; if($securewindow==1) $flash_file=str_replace("http:","https:",$flash_file); $id=$rowd['id']; $baseurl=$rowd['baseurl']; $fsonly="0"; $fstag="full screen · "; $fstag2="   play full screen "; } } } //echo $flash_file; // if gameflare, see if a paying source has it. // echo "SOURCE2: $source "; if($securewindow=='1') { $flash_file = str_replace("http:","https:",$flash_file); } // echo "SRC: (id: $id) ".$source; if($source=="xxxspilgames") { $fsonly="0"; $template=''; //$flash_file="https://cdn.gameplayer.io/embed/".$id; $fstag="full screen · "; $fstag2="   play full screen "; } $ksembed = str_replace("KSWIDTH",$width,$template); $ksembed = str_replace("KSHEIGHT",$height,$ksembed); $ksembed = str_replace("KSID",$id,$ksembed); $ksembed = str_replace("KSTITLE",$title,$ksembed); $ksembed = str_replace("KSFLASHFILEBASE",$baseurl,$ksembed); $ksembed = str_replace("KSFLASHFILE",$flash_file,$ksembed); // patch end if ( stripos($flash_file, 'https:') !== false ) { $securewindow=1; $basebig="https"; } if ( stripos($flash_file, 'gameflare') !== false ) { $securewindow=1; $basebig="https"; } if ( stripos($flash_file, 'gamepix') !== false ) { $securewindow=1; $basebig="https"; } if ( stripos($flash_file, 'gamemonetize') !== false ) { $securewindow=1; $basebig="https"; } if ( stripos($flash_file, 'html5') !== false ) { //$securewindow=1; //$basebig="https"; } if($securewindow==1) $flash_file=str_replace("http:","https:",$flash_file); if($securewindow==1) $ksembed=str_replace("http:","https:",$ksembed); //echo "FF: ".$flash_file; } ?> <?php echo "Playing ".$title; ?> (flash emulator) | KidzSearch Free Games '; } ?>