function writebody() { global $db, $domain, $sitename, $domain, $template, $gamesfolder, $thumbsfolder, $limitboxgames, $seo_on, $blogentriesshown, $enabledcode_on, $comments_on, $directorypath, $autoapprovecomments, $gamesonpage, $abovegames, $belowgames, $showwebsitelimit, $supportemail, $showblog, $blogentriesshown, $blogcharactersshown, $blogcommentpermissions, $blogcommentsshown, $blogfollowtags, $blogcharactersrss, $usrdata, $userid; $count = 0; $baser2 = "SELECT * FROM fas_categories where active='1'"; $baser1 = sqlcache('mainpagecats', $cachelife, $baser2); echo '<table width=\'720\' border=\'0\' cellpadding=\'0\' cellspacing=\'0\' align=\'center\'>'; foreach ($baser1 as $row) { $categorynamev = $row['name']; $categorynameu = preg_replace('#\\W#', '-', $categorynamev); if ($seo_on == 1) { $categoryurl = '' . $domain . '/browse/' . $row['ID'] . '-' . $categorynameu . '.html'; } else { $categoryurl = '' . $domain . '/index.php?action=browse&ID=' . $row['ID'] . ''; } echo '<tr> <td width=\'720\' valign=\'top\'> <table width=\'720\' border=\'0\'><div align=\'center\'> <tr> <td class=\'header\'><a href=\'' . $categoryurl . '\'>' . $categorynamev . ' Games</a></td> </tr> <tr> <td>'; echo '<table><tr> <td width=\'720\' align=\'center\' class=\'content\'><div align=\'center\'> '; $ir = $db->query(sprintf('SELECT * FROM fas_games WHERE category=\'%u\' ORDER BY rand() LIMIT 0,' . $limitboxgames . '', $row['ID'])); while ($row = $db->fetch_row($ir)) { $gamename = preg_replace('#\\W#', '-', $row['name']); if ($seo_on == 1) { $playlink = '' . $domain . '/play/' . $row['ID'] . '-' . $gamename . '.html'; } else { $playlink = '' . $domain . '/index.php?action=play&ID=' . $row['ID'] . ''; } echo ' <a href=\'' . $playlink . '\' title=\'' . $row['name'] . '\'> '; if ($row['type'] == 1) { echo ' <img src=\'' . $domain . '/' . $thumbsfolder . '/' . $row['thumb'] . '\' title=\'' . $row['name'] . '\' alt=\'' . $row['name'] . '\' width=\'80\' height=\'80\' border=\'0\' alt=\'' . $row['name'] . '\'>'; } else { echo ' <img src=\'' . $row['thumburl'] . '\' title=\'' . $row['name'] . '\' alt=\'' . $row['name'] . '\' width=\'80\' height=\'80\' border=\'0\' alt=\'' . $row['name'] . '\'>'; } echo ' </a> '; } echo '</div>'; echo ' </table>'; echo ' </td> </tr> </table> </td> </tr>'; } echo "</table>"; $pgname = 'Your resource for fantastic games!'; }
function writebody() { global $db, $domain, $suserid, $cachelife, $ir, $ir2, $r, $cname, $sponsor, $ads1, $ads2, $ads3, $bannersleft, $headerspace, $footerspace, $ID, $sitename, $domain, $template, $gamesfolder, $thumbsfolder, $limitboxgames, $seo_on, $blogentriesshown, $enabledcode_on, $comments_on, $fbcomments_on, $taf_on, $directorypath, $autoapprovecomments, $gamesonpage, $abovegames, $belowgames, $showwebsitelimit, $supportemail, $showblog, $blogentriesshown, $blogcharactersshown, $blogcommentpermissions, $blogcommentsshown, $blogfollowtags, $blogcharactersrss, $usrdata, $userid, $avatar_on, $gender_on, $aimg, $fimg, $mimg, $seoheading, $seotext, $showpages, $slogan; echo '<div id="container"> <div id="content-container"> <div id="side">'; include "includes/blocks.php"; echo '</div> <div id="content"> <div class="content_nav">Latest Games</div>'; $max = $gamesonpage; if (!isset($_GET['page'])) { $show = '1'; } else { $show = clean($_GET['page']); } $limits = ($show - 1) * $max; $sqltitle = 'homepage'; $baseir2 = "SELECT * FROM fas_games WHERE active='1' ORDER BY ID DESC LIMIT " . $limits . "," . $max; $baseir1 = sqlcache($sqltitle, $cachelife, $baseir2); if (isset($baseir1)) { foreach ($baseir1 as $row1) { $gamename = preg_replace('#\\W#', '-', $row1['name']); if ($seo_on == 1) { $playlink = '/play/' . $row1['ID'] . '-' . $gamename . '.html'; } else { $playlink = '/index.php?action=play&ID=' . $row1['ID'] . ''; } echo '<div id="game_holder"><a href=\'' . $playlink . '\'>'; if ($row1['type'] == 1) { echo '<div align="center"><img src=\'/' . $thumbsfolder . '/' . $row1['thumb'] . '\' width=\'90\' height=\'90\' alt= \'' . $row1['name'] . '\' title= \'' . $row1['name'] . '\' border=\'0px\' class=\'game_img\' /></a><br />'; } else { echo '<div align="center"><img src=\'' . $row1['thumburl'] . '\' width=\'90\' height=\'90\' alt= \'' . $row1['name'] . '\' title= \'' . $row1['name'] . '\' border=\'0px\' class=\'game_img\' /></a><br />'; } echo '</div></div>'; } } else { echo '<div align="center"> No games have been added yet! </div>'; } echo '</div></div></div>'; $pgname = 'Your resource for fantastic games!'; }
function writebody() { global $db, $domain, $sitename, $cachelife, $template, $gamesfolder, $thumbsfolder, $limitboxgames, $seo_on, $blogentriesshown, $enabledcode_on, $comments_on, $directorypath, $autoapprovecomments, $gamesonpage, $abovegames, $belowgames, $showwebsitelimit, $supportemail, $showblog, $blogentriesshown, $blogcharactersshown, $blogcommentpermissions, $blogcommentsshown, $blogfollowtags, $blogcharactersrss, $usrdata, $userid; $name = clean($_GET['name']); $show = clean($_GET['page']); $show = abs((int) $show); if (empty($show)) { $show = 1; } $limits = ($show - 1) * $max; $r2 = "SELECT * FROM fas_pageentries WHERE visible='1' order by title asc"; $sqltitle = "pagesmain"; $r1 = sqlcache($sqltitle, $cachelife, $r2); echo '<table width=\'100%\' border=\'0\' align=\'center\'> <tr> <td colspan=\'2\' class=\'header\'>Pages</td> </tr>'; //if(!$db->num_rows($r)){ //echo ' <tr> // <td colspan=\'2\' class=\'content\'>There currently are no pages.</td> // </tr>'; //} echo '<tr> <td valig=\'top\' class=\'content\' colspan=\'2\' class=\'content\'>'; foreach ($r1 as $in) { $title = $in['title']; $urltitle = str_replace(" ", "", $title); $category = $in['category']; $entryid = abs((int) $in['entryid']); if ($seo_on == 1) { $rburl = '' . $domain . '/pages/' . $entryid . '-' . $urltitle . '.html'; } else { $rburl = '' . $domain . '/index.php?action=page&entryid=' . $entryid; } $body = $in['body']; echo ' <a href=\'' . $rburl . '\' >' . $title . '</a><br> '; } echo "<p></td>\n\t\t\t</tr>\n</table>"; echo '<br /><br />'; }
function writebody() { global $db, $suserid, $pagetitle, $metatags, $metatitle, $metadescription, $entryid, $domain, $sitename, $cachelife, $template, $gamesfolder, $thumbsfolder, $limitboxgames, $seo_on, $blogentriesshown, $enabledcode_on, $comments_on, $directorypath, $autoapprovecomments, $gamesonpage, $abovegames, $belowgames, $showwebsitelimit, $supportemail, $showblog, $blogentriesshown, $blogcharactersshown, $blogcommentpermissions, $blogcommentsshown, $blogfollowtags, $blogcharactersrss, $usrdata, $userid; $entryid = clean($_GET['entryid']); $r3 = "SELECT * FROM fas_pageentries WHERE entryid='{$entryid}'"; $sqltitle = "pageenrty-" . $entryid; $r1 = sqlcache($sqltitle, $cachelife, $r3); foreach ($r1 as $r4) { $title = $r4['title']; $body = $r4['body']; $author = $r4['author']; $entrydate = $r4['entrydate']; $displaydate = date('d-m-Y', $entrydate); $visible = $r4['visible']; $category = $r4['category']; $tags = $r4['tags']; } // $chr_limit = 120; // $bodystring = preg_replace("!(http:/{2}[\w\.]{2,}[/\w\-\.\?\&\=\#]*)!e", "'<a href=\"\\1\" title=\"\\1\" target=\"_blank\">'.(strlen('\\1')>=$chr_limit ? substr('\\1',0,$chr_limit).'$add':'\\1').'</a>'", $bodystring); $bodystring = str_replace("[urlhead]", "<a href='http://", $body); $bodystring = str_replace("[urlmid]", "'>", $bodystring); $bodystring = str_replace("[urlend]", "</a>", $bodystring); $bodystring = str_replace("[imghead]", "<img src='http://", $bodystring); $bodystring = str_replace("[imgend]", "'>", $bodystring); $bodystring = str_replace("[bhead]", "<b>", $bodystring); $bodystring = str_replace("[bend]", "</b>", $bodystring); $bodystring = str_replace("[p]", "<p>", $bodystring); $bodystring = str_replace("\n\n", "<p>", $bodystring); $bodystring = str_replace("\n", "<br />", $bodystring); $body = str_replace("[br]", "<br>", $bodystring); echo '<table width=\'100%\' border=\'0\' align=\'center\'> <tr> <td colspan=\'2\' class=\'header\'>' . $title . ' </td> </tr> <tr> <td colspan=\'2\' class=\'content\'>' . $body . '</td> </tr> '; echo "</table>"; }
function writebody() { global $db, $cachelife, $domain, $sitename, $cachelife, $template, $gamesfolder, $thumbsfolder, $limitboxgames, $seo_on, $blogentriesshown, $enabledcode_on, $comments_on, $directorypath, $autoapprovecomments, $gamesonpage, $abovegames, $belowgames, $showwebsitelimit, $supportemail, $showblog, $blogentriesshown, $blogcharactersshown, $blogcommentpermissions, $blogcommentsshown, $blogfollowtags, $blogcharactersrss, $usrdata, $userid; $ID = clean($_GET['ID']); $ID = abs((int) $ID); $name = clean($_GET['name']); $max = $gamesonpage; $show = clean($_GET['page']); $show = abs((int) $show); if (empty($show)) { $show = 1; } $limits = ($show - 1) * $max; $r = "SELECT * FROM fas_comments WHERE gameid='{$ID}' and approved ='1' order by date desc LIMIT " . $limits . ", " . $max; $sqltitle = "gamecomments" . $show . "-" . $ID; $totalres = mysql_result($db->query('SELECT COUNT(ID) AS total FROM fas_comments WHERE gameid=\'' . $ID . '\' and approved=\'1\' '), 0); $totalpages = ceil($totalres / $max); echo '<table width=\'100%\' border=\'0\' align=\'center\'> <tr> <td colspan=\'2\' class=\'header\'> Comments Left For ' . $name . ' </td> </tr>'; $nr = mysql_query($r); if (!$db->num_rows($nr)) { echo ' <tr> <td colspan=\'2\' class=\'content\'>There currently are no comments left for this game.</td> </tr>'; } else { $r4 = sqlcache($sqltitle, $cachelife, $r); foreach ($r4 as $in) { $comment = $in['comment']; $commenter = abs((int) $in['commenter']); $date = date('d-m-Y', $in['date']); $nv1 = "SELECT * FROM fas_users WHERE userid='{$commenter}' limit 1 "; $sqltitle = "userprofile-" . $commenter; $nv3 = sqlcache($sqltitle, $cachelife, $nv1); foreach ($nv3 as $nv2) { $useridl = $nv2['userid']; if (!$username) { $username = "******"; } if ($commenter == '0') { $username = '******'; } else { $username = $nv2['username']; } if ($seo_on == 1) { $urlp = '' . $domain . '/showprofile/' . $useridl . '.html'; } else { $urlp = '' . $domain . '/index.php?action=showprofile&profile=' . $useridl; } if ($nv2['avatar'] == '1') { $avatarfileurl = '<p><img src=\'' . $domain . '/avatars/' . $nv2['avatarfile'] . '\' height=\'100\' width=\'100\' border=\'0\'>'; } else { $avatarfileurl = ''; } echo ' <tr> <td width=\'30%\' class=\'content\' style=\'padding:4px;\' valign=\'top\'><b>Posted By:</b> <a href="' . $urlp . '">' . $username . $avatarfileurl . '</a><p> <small><i><b>Posted On:</b> ' . $date . '</i></small> </td> <td valig=\'top\' class=\'content\' valign=\'top\'>' . $in['comment'] . '</td> </tr> <tr> <td width=\'100%\' colspan=\'2\' class=\'content\'> </td> </tr> '; } } } echo "</table>"; echo 'Pages: '; for ($i = 1; $i <= $totalpages; $i++) { if ($seo_on == 1) { $urk = '' . $domain . '/showcomments/' . $name . '/' . $ID . '/' . $i . '.html'; } else { $urk = '' . $domain . '/index.php?action=showcomments&name=' . $name . '&ID=' . $ID . '&page=' . $i . ''; } echo '<a href=\'' . $urk . '\' class=\'pagenat\'>' . $i . '</a> '; } echo '<br /><br />'; }
<?php echo '<div class="header"> Top Games </div> <div class="content">'; $minViews = 1; $count1 = 0; $newest2 = "SELECT * FROM fas_games WHERE `active`='1' AND Views>{$minViews} ORDER BY Views DESC"; $newest1 = sqlcache('newest', $cachelife, $newest2); if (isset($newest1)) { foreach ($newest1 as $row1) { $newestname = preg_replace('#\\W#', '-', $row1['name']); if ($row1['type'] == 1) { $img = "<img src='" . $domain . "/" . $thumbsfolder . "/" . $row1["thumb"] . "' alt='" . $newestname . "' class='minithumb' />"; } else { $img = "<img src='" . $row1["thumburl"] . "' alt='" . $newestname . "' class='minithumb' />"; } if ($count1 <= 4) { echo '<ul class=\'catmenu\'> <li>'; if ($seo_on == 1) { echo "<a href='" . $domain . "/play/" . $row1["ID"] . "-" . $newestname . ".html'>" . $img . titlelimit($row1["name"]) . " - (" . $row1["views"] . ")</a>"; } else { echo "<a href='" . $domain . "/index.php?action=play&ID=" . $row1["ID"] . "'>" . $img . titlelimit($row1["name"]) . " - (" . $row1["views"] . ")</a>"; } echo '</li> </ul>'; } $count1++; }
<?php echo '<div class="side_nav">Links</div> <div id="side_holder">'; $rlinkx2 = "SELECT * FROM fas_links where activate = '2' "; $rlinkx1 = sqlcache('sitewidelinks', $cachelife, $rlinkx2); echo '<ul class=\'catmenu\'>'; if (isset($rlinkx1)) { foreach ($rlinkx1 as $rlinkx) { echo '<li><a href=\'' . $rlinkx['url'] . '\' target="_blank">' . $rlinkx['title'] . '</a></li>'; } } else { echo '<li>No links have been added yet!</li>'; } echo '</ul>'; echo '<br />'; if ($seo_on == 1) { echo '<a href=\'' . $domain . '/links/\' title=\'Links\'> Add links >>></a>'; } else { echo '<a href=\'' . $domain . '/index.php?action=links\' title=\'Links\'> Add links >>></a>'; } echo '</div>';
$ID = clean($_GET['ID']); $ID = abs((int) $ID); $query = "SELECT Name FROM fas_categories WHERE ID={$ID}"; $result = mysql_query($query); $title = mysql_result($result, 0, "Name"); $max = $gamesonpage; if (!isset($_GET['page'])) { $show = '1'; } else { $show = clean($_GET['page']); } $limits = ($show - 1) * $max; $r2 = "SELECT * FROM fas_games WHERE category='{$ID}' && active='1' ORDER BY ID DESC LIMIT " . $limits . "," . $max; $sqltitle = "browse-cat" . $ID . "page " . $show; $r1 = sqlcache($sqltitle, $cachelife, $r2); $totalres = mysql_result($db->query('SELECT COUNT(ID) AS total FROM fas_games WHERE active=\'1\' and category=\'' . $ID . '\''), 0); $totalpages = ceil($totalres / $max); echo '<div class="header2">' . $title . '</div>'; $count = 0; if (!isset($r1)) { echo '<div class="content2">There currently are no games in this category.</div>'; } else { echo '<div class="content2">'; foreach ($r1 as $in) { $gamename = preg_replace('#\\W#', '-', $in['name']); if ($seo_on == 1) { $playlink = '' . $domain . '/play/' . $in['ID'] . '-' . $gamename . '.html'; } else { $playlink = '' . $domain . '/index.php?action=play&ID=' . $in['ID'] . ''; }
<?php echo '<div id="container"> <div id="content-container"> <div id="side">'; include "includes/blocks.php"; echo '</div> <div id="content"> <div class="content_nav">Partners</div> <table align=\'center\' border=\'0\' width=\'100%\'> <tr> <td align=\'center\' class=\'content\'>'; $rlinkx2 = "SELECT * FROM fas_links where activate != '0' ORDER BY activate desc "; $rlinkx1 = sqlcache('linkspage', $cachelife, $rlinkx2); foreach ($rlinkx1 as $row) { echo '<a href=\'' . $row['url'] . '\' target=\'_blank\'><font size=\'3\'>' . $row['title'] . '</font></a><br>'; } echo ' </td> </tr> </table> <hr width=\'85%\'> '; if (isset($_POST['submit'])) { $title = clean($_POST['title']); $url = clean($_POST['url']); $linkbackat = clean($_POST['linkbackat']);
<?php echo '<div class="header"> Top Users </div> <div class="content"> <ul class=\'catmenu\'>'; $tur1 = 'SELECT username, userid, plays FROM fas_users WHERE plays!="0" ORDER BY plays DESC LIMIT 0,15'; $tur = sqlcache('topplayers', $cachelife, $tur1); if (isset($tur)) { foreach ($tur as $r) { if ($seo_on == 1) { $urlp = '' . $domain . '/showprofile/' . $r['userid'] . '.html'; } else { $urlp = '' . $domain . '/index.php?action=showprofile&profile=' . $r['userid']; } $avatarfileurl = get_avatar($r['userid']); echo '<li><a href="' . $urlp . '"><img src="' . $domain . '/avatars/' . $avatarfileurl . '" alt="avatar" class="minithumb" />' . $r['username'] . ' - (' . $r['plays'] . ')</a></li>'; } } else { echo '<li>Either no there are no users or no users have played a game yet!</li>'; } echo '</ul> </div>';
function writebody() { global $db, $domain, $sitename, $cachelife, $template, $gamesfolder, $thumbsfolder, $limitboxgames, $seo_on, $blogentriesshown, $enabledcode_on, $comments_on, $directorypath, $autoapprovecomments, $gamesonpage, $abovegames, $belowgames, $showwebsitelimit, $supportemail, $showblog, $blogentriesshown, $blogcharactersshown, $blogcommentpermissions, $blogcommentsshown, $blogfollowtags, $blogcharactersrss, $usrdata, $userid; $name = clean($_GET['name']); $max = $blogentriesshown; $show = clean($_GET['page']); $show = abs((int) $show); if (empty($show)) { $show = 1; } $limits = ($show - 1) * $max; $r2 = "SELECT * FROM fas_blogentries WHERE visible='1' order by entryid desc LIMIT " . $limits . "," . $max; $sqltitle = "blogmain-page" . $show; $r1 = sqlcache($sqltitle, $cachelife, $r2); $totalres = mysql_result($db->query('SELECT COUNT(entryid) AS total FROM fas_blogentries where visible=\'1\' '), 0); $totalpages = ceil($totalres / $max); echo '<table width=\'100%\' border=\'0\' align=\'center\'> <tr> <td colspan=\'2\' class=\'header\'>Blog Entries</td> </tr>'; if (!$db->num_rows($r)) { echo ' <tr> <td colspan=\'2\' class=\'content\'>There currently are no blog entries.</td> </tr>'; } foreach ($r1 as $in) { $blogentry = $in['blogentry']; $author = $in['author']; $title = $in['title']; $entryid = abs((int) $in['entryid']); $entrydate = $in['entrydate']; if ($seo_on == 1) { $rburl = '' . $domain . '/blogentry/entryid/' . $entryid . '/1.html'; } else { $rburl = '' . $domain . '/index.php?action=blogentry&entryid=' . $entryid; } $body = $in['body']; if (strlen($body) > $blogcharactersshown) { $body = substr($body, 0, $blogcharactersshown); $body .= '...'; } $bodystring = str_replace("[urlhead]", "<a href='http://", $body); $bodystring = str_replace("[urlmid]", "'>", $bodystring); $bodystring = str_replace("[urlend]", "</a>", $bodystring); $bodystring = str_replace("[imghead]", "<img src='http://", $bodystring); $bodystring = str_replace("[imgend]", "'>", $bodystring); $bodystring = str_replace("[bhead]", "<b>", $bodystring); $bodystring = str_replace("[bend]", "</b>", $bodystring); $bodystring = str_replace("[p]", "<p>", $bodystring); $bodystring = str_replace("\n\n", "<p>", $bodystring); $bodystring = str_replace("\n", "<br />", $bodystring); $body = str_replace("[br]", "<br>", $bodystring); echo ' <tr> <td width=\'15%\' class=\'content\' style=\'padding:4px;\' valign=\'top\'><b>Posted By:</b> ' . $author . '</td> <td valig=\'top\' class=\'content\'><a href=\'' . $rburl . '\' >' . $title . '</a><p>' . $body . '</td> </tr> <tr> <td width=\'100%\' colspan=\'2\' class=\'content\'><small><i><b>Posted On:</b> ' . $entrydate . '</i></small></td> </tr> '; } echo "</table>"; echo 'Pages: '; for ($i = 1; $i <= $totalpages; $i++) { if ($seo_on == 1) { $urk = '' . $domain . '/blog/page/' . $i . '.html'; } else { $urk = '' . $domain . '/index.php?action=blog&page=' . $i . ''; } echo '<a href=\'' . $urk . '\' class=\'pagenat\'>' . $i . '</a> '; } echo '<br /><br />'; }
function writebody() { global $db, $domain, $sitename, $domain, $cachelife, $template, $gamesfolder, $thumbsfolder, $limitboxgames, $seo_on, $blogentriesshown, $enabledcode_on, $comments_on, $directorypath, $autoapprovecomments, $gamesonpage, $abovegames, $belowgames, $showwebsitelimit, $supportemail, $showblog, $blogentriesshown, $blogcharactersshown, $blogcommentpermissions, $blogcommentsshown, $blogfollowtags, $blogcharactersrss, $usrdata, $userid; $count = 0; $baser2 = "SELECT * FROM fas_categories where active='1'"; $baser1 = sqlcache('mainpagecats', $cachelife, $baser2); if ($baser1 == false) { //If no games are added to the category yet, display error. echo '<div class="msg">No categories added yet</div>'; return; } //end if $baser1 foreach ($baser1 as $row) { $categorynamev = $row['name']; $categorynameu = preg_replace('#\\W#', '-', $categorynamev); if ($seo_on == 1) { $categoryurl = '' . $domain . '/browse/' . $row['ID'] . '-' . $categorynameu . '.html'; } else { //else seo $categoryurl = '' . $domain . '/index.php?action=browse&ID=' . $row['ID'] . ''; } //end seo if ($count % 2 == 0) { echo '<div class="home_row"> <div class="home_category"> <div class="header2"> <div class="home_cat_title">' . $row['name'] . '</div> <div class="home_more"><a href=\'' . $categoryurl . '\'>View more</a></div> </div> <div class="content2">'; $catid1 = $row['ID']; $sqltitle = 'mainpagecat' . $catid1; $baseir2 = "SELECT * FROM fas_games WHERE category='{$catid1}' and active='1' ORDER BY rand() LIMIT 0," . $limitboxgames; $baseir1 = sqlcache($sqltitle, $cachelife, $baseir2); if (isset($baseir1)) { foreach ($baseir1 as $row) { $gamename = preg_replace('[^A-Za-z0-9]', '-', $row['name']); if ($seo_on == 1) { $playlink = '' . $domain . '/play/' . $row['ID'] . '-' . $gamename . '.html'; } else { //else seo $playlink = '' . $domain . '/index.php?action=play&ID=' . $row['ID'] . ''; } //end seo echo '<div class="home_wrap2"> <div class="home_img"> <a href=\'' . $playlink . '\'>'; if ($row['type'] == 1) { echo ' <img src=\'' . $domain . '/' . $thumbsfolder . '/' . $row['thumb'] . '\' alt= \'' . $gamename . '\' title= \'' . $gamename . '\' class="home_img" />'; } else { //else type echo ' <img src=\'' . $row['thumburl'] . '\' alt= \'' . $gamename . '\' title= \'' . $gamename . '\' class="home_img" />'; } //end type echo '</a> </div> </div>'; } //end foreach baseir1 } else { //else isset($baseir1) echo '<div> No games have been added to this category yet. </div>'; } //end isset($baseir1) echo '</div> </div>'; } else { //else count echo '<div class="home_category"> <div class="header2"> <div class="home_cat_title">' . $row['name'] . '</div> <div class="home_more"><a href=\'' . $categoryurl . '\'>View more</a></div> </div> <div class="content2">'; $catid1 = $row['ID']; $sqltitle = 'mainpagecat' . $catid1; $baseir2 = "SELECT * FROM fas_games WHERE category='{$catid1}' and active='1' ORDER BY rand() LIMIT 0," . $limitboxgames; $baseir1 = sqlcache($sqltitle, $cachelife, $baseir2); if (isset($baseir1)) { foreach ($baseir1 as $row) { $gamename = preg_replace('[^A-Za-z0-9]', '-', $row['name']); if ($seo_on == 1) { $playlink = '' . $domain . '/play/' . $row['ID'] . '-' . $gamename . '.html'; } else { $playlink = '' . $domain . '/index.php?action=play&ID=' . $row['ID'] . ''; } echo '<div class="home_wrap2"> <div class="home_img"> <a href=\'' . $playlink . '\'>'; if ($row['type'] == 1) { echo ' <img src=\'' . $domain . '/' . $thumbsfolder . '/' . $row['thumb'] . '\' class="home_img" alt=\'' . $gamename . '\' title= \'' . $gamename . '\' />'; } else { echo ' <img src=\'' . $row['thumburl'] . '\' class="home_img" alt= \'' . $gamename . '\' title= \'' . $gamename . '\' />'; } echo '</a> </div> </div>'; } } else { echo '<div> No games have been added to this category yet. </div>'; } echo '</div> </div> </div>'; } $count++; } //end foreach baser1 }
<div class="content_nav">Comments Left For ' . $name . '</div>'; echo '<table width=\'100%\' border=\'0\' align=\'center\'>'; $nr = mysql_query($r); if (!$db->num_rows($nr)) { echo ' <tr> <td colspan=\'2\' class=\'content\'>There currently are no comments left for this game.</td> </tr>'; } else { $r4 = sqlcache($sqltitle, $cachelife, $r); foreach ($r4 as $in) { $comment = $in['comment']; $commenter = abs((int) $in['commenter']); $date = date('M-d-Y', $in['date']); $nv1 = "SELECT * FROM fas_users WHERE userid='{$commenter}' limit 1 "; $sqltitle = "userprofile-" . $commenter; $nv3 = sqlcache($sqltitle, $cachelife, $nv1); foreach ($nv3 as $nv2) { $useridl = $nv2['userid']; if (empty($username)) { $username = "******"; } if ($commenter == '0') { $username = '******'; } else { $username = $nv2['username']; } if ($seo_on == 1) { $urlp = '' . $domain . '/showprofile/' . $useridl . '.html'; } else { $urlp = '' . $domain . '/index.php?action=showprofile&profile=' . $useridl; }
function writebody() { global $db, $cachelife, $domain, $suserid, $sitename, $cachelife, $template, $gamesfolder, $thumbsfolder, $limitboxgames, $seo_on, $blogentriesshown, $enabledcode_on, $comments_on, $directorypath, $autoapprovecomments, $gamesonpage, $abovegames, $belowgames, $showwebsitelimit, $supportemail, $showblog, $blogentriesshown, $blogcharactersshown, $blogcommentpermissions, $blogcommentsshown, $blogfollowtags, $blogcharactersrss, $usrdata, $userid, $username; $max = '70'; $userids = clean($_GET['profile']); if (!isset($suserid)) { $smessage = 'Please login to send a message.'; } else { $smessage = ' <form action="' . $domain . '/index.php?action=messages&case=compose" method="post"> <input size="40" name="subject" value="[No Subject]" > <textarea cols="50" rows="5" name="message" ></textarea><br> <input name="to" value="' . $userids . '" type="hidden"> <input name="submit" value="Send" type="submit"> </form> '; } if (empty($userids)) { echo 'No profile selected'; } else { $r = "SELECT * FROM fas_users WHERE userid='{$userids}' "; $sqltitle = "userprofile-" . $userids; $r1 = sqlcache($sqltitle, $cachelife, $r); foreach ($r1 as $r2) { $username = $r2['username']; $played = $r2['plays']; $aim = $r2['aim']; $icq = $r2['icq']; $msn = $r2['msn']; $yim = $r2['yim']; $location = $r2['location']; $job = $r2['job']; $website = $r2['website']; $link1 = $r2['link1']; $link2 = $r2['link2']; $link3 = $r2['link3']; $link4 = $r2['link4']; $link5 = $r2['link5']; $link6 = $r2['link6']; $link7 = $r2['link7']; $link8 = $r2['link8']; $sex = $r2['sex']; $interests = $r2['interests']; $bio = $r2['bio']; $avatar = $r2['avatar']; $avatarfile = $r2['avatarfile']; $joindate = $r2['joindate']; } if ($link1 != '') { $mylinks .= '<a href=\'http://' . $link1 . '\' target=\'_blank\'>' . $link1 . '</a><br>'; } if ($link2 != '') { $mylinks .= '<a href=\'http://' . $link2 . '\' target=\'_blank\'>' . $link2 . '</a><br>'; } if ($link3 != '') { $mylinks .= '<a href=\'http://' . $link3 . '\' target=\'_blank\'>' . $link3 . '</a><br>'; } if ($link4 != '') { $mylinks .= '<a href=\'http://' . $link4 . '\' target=\'_blank\'>' . $link4 . '</a><br>'; } if ($link5 != '') { $mylinks .= '<a href=\'http://' . $link5 . '\' target=\'_blank\'>' . $link5 . '</a><br>'; } if ($link6 != '') { $mylinks .= '<a href=\'http://' . $link6 . '\' target=\'_blank\'>' . $link6 . '</a><br>'; } if ($link7 != '') { $mylinks .= '<a href=\'http://' . $link7 . '\' target=\'_blank\'>' . $link7 . '</a><br>'; } if ($link8 != '') { $mylinks .= '<a href=\'http://' . $link8 . '\' target=\'_blank\'>' . $link8 . '</a>'; } if ($avatar == "1") { $avatarfileurl = '<img src=\'' . $domain . '/avatars/' . $avatarfile . '\' height=\'100\' width=\'100\'>'; } else { $avatarfileurl = ''; } if ($played >= $showwebsitelimit) { $webvar = ' <tr> <td class="content">Website:</th> <th class="content"><a href="http://' . $website . '" target="_blank" class="playlink">' . $website . '</a></th> </tr> '; } else { $webvar = ' '; } echo ' <table width="100%" align="center"> <tr> <td colspan=\'2\' class=\'header\'>User Profile: ' . $username . '</td> </tr> <tr> <td class="content" width="100">About Me:<br>' . $avatarfileurl . '</th> <th class="content" width="450">' . $bio . '</th> </tr> <tr> <td class="content">Interests:</th> <th class="content">' . $interests . '</th> </tr> <tr> <td class="content" >Games Played:</th> <th class="content">' . $played . '</th> </tr> <tr> <td class="content">Location:</th> <th class="content">' . $location . '</th> </tr> ' . $webvar . ' <tr> <td class="content">Occupation:<br></td> <td class="content">' . $job . '</td> </tr> <tr> <td class="content">Sex:</th> <th class="content">' . $sex . '</th> </tr> <tr> <td colspan=\'2\' class=\'header\'>Contact Info</td> </tr> <tr> <td class="content">AIM:</th> <th class="content">' . $aim . '</th> </tr> <tr> <td class="content">ICQ:</th> <th class="content">' . $icq . '</th> </tr> <tr> <td class="content">MSN:</th> <th class="content">' . $msn . '</th> </tr> <tr> <td class="content">Yahoo:</th> <th class="content">' . $yim . '</th> </tr> <tr> <td colspan=\'2\' class=\'header\'>Misc</td> </tr> <tr> <td class="content">My Links:<br><small>For such things as Myspace profile, FaceBook, Twitter,etc.</small></th> <th class="content"> ' . $mylinks . ' </th> </tr> <tr> <td class="header" colspan="2">Send ' . $username . ' a Message</td> </tr> <tr> <td class="content" colspan="2"> ' . $smessage . ' </td> </tr> '; $gua2 = "SELECT * FROM fas_games WHERE gameadder='{$userids}' AND active='1' ORDER BY dateadded DESC "; $sqltitle = "gameuseradded-" . $userids; if ($gua1 = sqlcache($sqltitle, $cachelife, $gua2)) { echo '<tr><td class="header" colspan="2">Games Added By ' . $username . '</td></tr> <tr><td class="content" colspan="2">'; foreach ($gua1 as $row) { $gamename = ereg_replace('[^A-Za-z0-9]', '', $row['name']); $type = clean($row['type']); $thumburl = clean($row['thumburl']); if ($type == 2) { $image = "<img src='{$thumburl}' width='55' width='55' />"; } else { $image = '<img src=\'' . $domain . '/' . $thumbsfolder . '/' . $row['thumb'] . '\' width=\'55\' width=\'55\' border=\'0\' alt=\'' . $row[name] . '\'>'; } if ($seo_on == 1) { $playlink = '' . $domain . '/play/' . $row['ID'] . '-' . $gamename . '.html'; } else { $playlink = '' . $domain . '/index.php?action=play&ID=' . $row['ID'] . ''; } echo ' <a href=\'' . $playlink . '\' class=\'playlink\'>' . $image . '</a> '; } echo '</td></tr>'; } $ube2 = "SELECT * FROM fas_blogentries WHERE author='{$username}' AND visible='1' ORDER BY entrydate DESC LIMIT 5"; $sqltitle = "userblogentries-" . $userids; if ($ube1 = sqlcache($sqltitle, $cachelife, $ube2)) { echo '<tr><td class="header" colspan="2">Latest Blog Posts By ' . $username . '</td></tr> <tr><td class="content" colspan="2">'; foreach ($ube1 as $row) { if ($seo_on == 1) { $rburl = '' . $domain . '/blogentry/entryid/' . $row[entryid] . '/1.html'; } else { $rburl = '' . $domain . '/index.php?action=blogentry&entryid=' . $row[entryid]; } echo '<a href=\'' . $rburl . '\' >' . $row[title] . '</a> - ' . $row[entrydate] . '<br>'; } echo '</td></tr>'; } echo '</table> '; } }
function account() { global $domain, $db, $seo_on, $usrdata, $utemplate, $template, $avatar_on, $gender_on, $aimg, $fimg, $mimg; if ($seo_on == 1) { $url1 = '' . $domain . '/myaccount/favorites/'; $url2 = '' . $domain . '/myaccount/changepassword/'; $url3 = '' . $domain . '/myaccount/'; $url4 = '' . $domain . '/messages/'; $url5 = '' . $domain . '/myaccount/changeavatar/'; $url6 = '' . $domain . '/myaccount/changequestion/'; $url7 = '' . $domain . '/myaccount/changeemail/'; } else { $url1 = '' . $domain . '/index.php?action=myaccount&cmd=favorites'; $url2 = '' . $domain . '/index.php?action=myaccount&cmd=changepassword'; $url3 = '' . $domain . '/index.php?action=myaccount'; $url4 = '' . $domain . '/index.php?action=messages'; $url5 = '' . $domain . '/index.php?action=myaccount&cmd=changeavatar'; $url6 = '' . $domain . '/index.php?action=myaccount&cmd=changequestion'; $url7 = '' . $domain . '/index.php?action=myaccount&cmd=changeemail'; } if (isset($_POST['newsletter'])) { $userid = $usrdata['userid']; $newsletter = clean($_POST['newsletter']); $utemplate = clean($_POST['template']); $aim = clean($_POST['aim']); $icq = clean($_POST['icq']); $msn = clean($_POST['msn']); $yim = clean($_POST['yim']); $location = clean($_POST['location']); $job = clean($_POST['job']); $website = clean($_POST['website']); $link1 = clean($_POST['link1']); $link2 = clean($_POST['link2']); $link3 = clean($_POST['link3']); $link4 = clean($_POST['link4']); $link5 = clean($_POST['link5']); $link6 = clean($_POST['link6']); $link7 = clean($_POST['link7']); $link8 = clean($_POST['link8']); $sex = clean($_POST['sex']); $interests = clean($_POST['interests']); $bio = clean($_POST['bio']); $ip = $_SERVER['REMOTE_ADDR']; mysql_query("UPDATE fas_users SET newsletter='{$newsletter}', template='{$utemplate}', aim='{$aim}', icq='{$icq}', msn='{$msn}', yim='{$yim}', location='{$location}',\njob='{$job}', website='{$website}', link1='{$link1}', link2='{$link2}', link3='{$link3}', link4='{$link4}', link5='{$link5}', link6='{$link6}', link7='{$link7}', link8='{$link8}', sex='{$sex}', interests='{$interests}', bio='{$bio}', ip='{$ip}' WHERE userid='{$userid}'"); echo '<div class=\'msg\'>Profile updated</div><p>'; } $userid = $usrdata['userid']; $ir = $db->query(sprintf('SELECT * FROM fas_users WHERE userid=\'%u\'', $userid)); $r2 = $db->fetch_row($ir); $username = $r2['username']; $plays = $r2['plays']; $newsletter = $r2['newsletter']; $utemplate = $r2['template']; $aim = $r2['aim']; $icq = $r2['icq']; $msn = $r2['msn']; $yim = $r2['yim']; $location = $r2['location']; $job = $r2['job']; $website = $r2['website']; $link1 = $r2['link1']; $link2 = $r2['link2']; $link3 = $r2['link3']; $link4 = $r2['link4']; $link5 = $r2['link5']; $link6 = $r2['link6']; $link7 = $r2['link7']; $link8 = $r2['link8']; $sex = $r2['sex']; $interests = $r2['interests']; $bio = $r2['bio']; $avatar = $r2['avatar']; $avatarfile = $r2['avatarfile']; if ($newsletter == "yes") { $nsel = "selected"; } else { $nsel = ""; } if ($sex == "m") { $msel = "selected"; } if ($sex == "f") { $fsel = "selected"; } $avatarfileurl = get_avatar($userid); echo '<table align=\'center\' width="100%"> <tr> <td colspan=\'4\' class=\'header\'>My Account</td> </tr> <tr> <td class=\'content\' style=\'padding:3px;\'><img src=\'' . $domain . '/avatars/' . $avatarfileurl . '\' height=\'100\' width=\'100\' /></td> <td colspan=\'3\' class=\'content\' style=\'padding:3px;\'><a href=\'' . $url1 . '\'>My Favorites</a> - <a href=\'' . $url2 . '\'>Change Password</a> - <a href= \'' . $url6 . '\'>Change security question/answer</a> - <a href= \'' . $url7 . '\'>Change email</a> - <a href= \'' . $url4 . '\'>Messages</a> - <a href= \'' . $url5 . '\'>Change Avatar</a> </td> </tr> <tr> <form action="' . $url3 . '" method="POST"> <td class="content">Games Played:</td> <td class="content">' . $plays . '</td> </tr> <tr> <td class="content">Newsletter:</td> <td class="content"><select type="dropdown" name="newsletter"> <option value="no">No</option> <option value="yes" ' . $nsel . ' >Yes</option> </select> </td> </tr> <tr> <td class="content">Template:</td> <td class="content"><select type="dropdown" name="template"> <option value="default">default</option>'; $theme = "SELECT * FROM fas_themes WHERE `active`='1'"; $theme = sqlcache('themes', $cachelife, $theme); foreach ($theme as $row2) { if ($row2['name'] == $utemplate) { $usel = "selected"; } else { $usel = NULL; } echo "<option value=" . $row2['name'] . " " . $usel . " >" . $row2['name'] . "</option>"; } echo ' </select> </td> </tr> <tr> <td class="content">Location:</td> <td class="content"><input name="location" type="text" size="50" value="' . $location . '"></td> </tr> <tr> <td class="content">Website:<br><small>(Leave off the http://)</small></td> <td class="content"><input name="website" type="text" size="50" value="' . $website . '"></td> </tr> <tr> <td class="content">Occupation:<br></td> <td class="content"><input name="job" type="text" size="50" value="' . $job . '"></td> </tr> <tr> <td class="content">Sex:</td> <td class="content"><select type="dropdown" name="sex" > <option value="u">Undisclosed</option> <option value="m" ' . $msel . '>Male</option> <option value="f" ' . $fsel . '>Female</option> </select></td> </tr> <tr> <td class="content">AIM:</td> <td class="content"><input name="aim" type="text" size="50" value="' . $aim . '"></td> </tr> <tr> <td class="content">ICQ:</td> <td class="content"><input name="icq" type="text" size="50" value="' . $icq . '"></td> </tr> <tr> <td class="content">MSN:</td> <td class="content"><input name="msn" type="text" size="50" value="' . $msn . '"></td> </tr> <tr> <td class="content">Yahoo:</td> <td class="content"><input name="yim" type="text" size="50" value="' . $yim . '"></td> </tr> <tr> <td class="content">Interests:<br><small>100 characters<br>HTML/scripts not allowed!</small></td> <td class="content"><textarea name="interests" rows="2" cols="50" >' . $interests . '</textarea></td> </tr> <tr> <td class="content">About Me:<br><small>250 characters<br>HTML/scripts not allowed!</small></td> <td class="content"><textarea name="bio" rows="4" cols="50" >' . $bio . '</textarea></td> </tr> <tr> <td class="content">My Cool Sites:<br><small>For your MySpace profile, FaceBook, Twitter, Etc. <br>(Leave off the http://)</small></td> <td class="content"> <input name="link1" type="text" size="50" value="' . $link1 . '"><br> <input name="link2" type="text" size="50" value="' . $link2 . '"><br> <input name="link3" type="text" size="50" value="' . $link3 . '"><br> <input name="link4" type="text" size="50" value="' . $link4 . '"><br> <input name="link5" type="text" size="50" value="' . $link5 . '"><br> <input name="link6" type="text" size="50" value="' . $link6 . '"><br> <input name="link7" type="text" size="50" value="' . $link7 . '"><br> <input name="link8" type="text" size="50" value="' . $link8 . '"> </td> </tr> <tr> <td class="content" colspan="4"> <input type="submit" name="submit" value="Submit Changes"> </td> </tr> </table>'; }
function writebody() { global $db, $domain, $sitename, $cachelife, $template, $gamesfolder, $thumbsfolder, $limitboxgames, $seo_on, $blogentriesshown, $enabledcode_on, $comments_on, $directorypath, $autoapprovecomments, $gamesonpage, $abovegames, $belowgames, $showwebsitelimit, $supportemail, $showblog, $blogentriesshown, $blogcharactersshown, $blogcommentpermissions, $blogcommentsshown, $blogfollowtags, $blogcharactersrss, $usrdata, $userid; $count = 0; $baser2 = "SELECT * FROM fas_categories where active='1'"; $baser1 = sqlcache('mainpagecats', $cachelife, $baser2); if ($baser1 == false) { //If no games are added to the category yet, display error. echo '<div class="msg">No categories added yet</div>'; return; } //end if $baser1 echo '<table width=\'99%\' border=\'0\' cellpadding=\'0\' cellspacing=\'0\' align=\'center\'>'; foreach ($baser1 as $row) { $categorynamev = $row['name']; $categorynameu = preg_replace('#\\W#', '-', $categorynamev); if ($seo_on == 1) { $categoryurl = '' . $domain . '/browse/' . $row['ID'] . '-' . $categorynameu . '.html'; } else { $categoryurl = '' . $domain . '/index.php?action=browse&ID=' . $row['ID'] . ''; } if ($count % 2 == 0) { echo '<tr> <td width=\'50%\' valign=\'top\'> <table width=\'97%\' border=\'0\'> <tr> <td class=\'header\'>' . $row['name'] . '</td> </tr> <tr> <td>'; echo '<table>'; $catid1 = $row['ID']; $sqltitle = 'mainpagecat' . $catid1; $baseir2 = "SELECT * FROM fas_games WHERE category='{$catid1}' and active='1' ORDER BY rand() LIMIT 0," . $limitboxgames; $baseir1 = sqlcache($sqltitle, $cachelife, $baseir2); if (isset($baseir1)) { foreach ($baseir1 as $row) { $gamename = preg_replace('#\\W#', '-', $row['name']); if ($seo_on == 1) { $playlink = '' . $domain . '/play/' . $row['ID'] . '-' . $gamename . '.html'; } else { $playlink = '' . $domain . '/index.php?action=play&ID=' . $row['ID'] . ''; } echo ' <tr> <td width=\'45\' height=\'45\' valign=\'top\' class=\'content\'> <a href=\'' . $playlink . '\'> '; if ($row['type'] == 1) { echo ' <img src=\'' . $domain . '/' . $thumbsfolder . '/' . $row['thumb'] . '\' width=\'45\' height=\'45\' border=\'0\'>'; } else { echo ' <img src=\'' . $row['thumburl'] . '\' width=\'45\' height=\'45\' border=\'0\'>'; } echo ' </a> </td> <td valign=\'top\' class=\'content\'><div class=\'gamehometitle\'>' . $row['name'] . '</div> <div class=\'gamehomedesc\'>' . desclimit($row['description']) . ' <a href=\'' . $playlink . '\'>Play</a></div></td> </tr>'; } } else { echo '<div> No games in this category yet. </div>'; } echo '<tr><td colspan=\'2\' class=\'content\'>'; echo '<a href=\'' . $categoryurl . '\'>Play more ' . $categorynamev . ' games</a>'; echo '</td></tr>'; echo ' </table>'; echo ' </td> </tr> </table> </td>'; } else { echo ' <td width=\'50%\' valign=\'top\'> <table width=\'97%\' border=\'0\'> <tr> <td class=\'header\'>' . $row['name'] . '</td> </tr> <tr> <td>'; echo '<table>'; $catid1 = $row['ID']; $sqltitle = 'mainpagecat' . $catid1; $baseir2 = "SELECT * FROM fas_games WHERE category='{$catid1}' and active='1' ORDER BY rand() LIMIT 0," . $limitboxgames; $baseir1 = sqlcache($sqltitle, $cachelife, $baseir2); if (isset($baseir1)) { foreach ($baseir1 as $row) { $gamename = preg_replace('#\\W#', '-', $row['name']); if ($seo_on == 1) { $playlink = '' . $domain . '/play/' . $row['ID'] . '-' . $gamename . '.html'; } else { $playlink = '' . $domain . '/index.php?action=play&ID=' . $row['ID'] . ''; } echo ' <tr> <td width=\'45\' height=\'45\' valign=\'top\' class=\'content\'> <a href=\'' . $playlink . '\'>'; if ($row['type'] == 1) { echo ' <img src=\'' . $domain . '/' . $thumbsfolder . '/' . $row['thumb'] . '\' width=\'45\' height=\'45\' border=\'0\'>'; } else { echo ' <img src=\'' . $row['thumburl'] . '\' width=\'45\' height=\'45\' border=\'0\'>'; } echo ' </a> </td> <td valign=\'top\' class=\'content\'><div class=\'gamehometitle\'>' . $row['name'] . '</div> <div class=\'gamehomedesc\'>' . desclimit($row['description']) . ' <a href=\'' . $playlink . '\'>Play</a></div></td> </tr>'; } } else { echo '<div> No games in this category yet. </div>'; } echo '<tr><td colspan=\'2\' class=\'content\'>'; echo '<a href=\'' . $categoryurl . '\'>Play more ' . $categorynamev . ' games</a>'; echo '</td></tr>'; echo ' </table>'; echo ' </td> </tr> </table> </td> </tr>'; } $count++; } echo "</table>"; $pgname = 'Your resource for fantastic games!'; }
function show() { global $domain, $db, $seo_on, $usrdata, $entryid, $suserid; // $r3 = $db->query(sprintf('SELECT * FROM fas_blogentries WHERE entryid=\'%u\'', $entryid)); // $r4 = $db->fetch_row($r3); $r3 = "SELECT * FROM fas_blogentries WHERE entryid='{$entryid}'"; $sqltitle = "blogenrty-" . $entryid; $r1 = sqlcache($sqltitle, $cachelife, $r3); foreach ($r1 as $r4) { $title = $r4['title']; $body = $r4['body']; $author = $r4['author']; $entrydate = $r4['entrydate']; $displaydate = date('d-m-Y', $entrydate); $visible = $r4['visible']; $category = $r4['category']; $tags = $r4['tags']; } $chr_limit = 120; $add = '...'; $bodystring = preg_replace("!(http:/{2}[\\w\\.]{2,}[/\\w\\-\\.\\?\\&\\=\\#]*)!e", "'<a href=\"\\1\" title=\"\\1\" target=\"_blank\">'.(strlen('\\1')>={$chr_limit} ? substr('\\1',0,{$chr_limit}).'{$add}':'\\1').'</a>'", $bodystring); $bodystring = str_replace("[urlhead]", "<a href='http://", $body); $bodystring = str_replace("[urlmid]", "'>", $bodystring); $bodystring = str_replace("[urlend]", "</a>", $bodystring); $bodystring = str_replace("[imghead]", "<img src='http://", $bodystring); $bodystring = str_replace("[imgend]", "'>", $bodystring); $bodystring = str_replace("[bhead]", "<b>", $bodystring); $bodystring = str_replace("[bend]", "</b>", $bodystring); $bodystring = str_replace("[p]", "<p>", $bodystring); $bodystring = str_replace("\n\n", "<p>", $bodystring); $bodystring = str_replace("\n", "<br />", $bodystring); $body = str_replace("[br]", "<br>", $bodystring); echo '<table width=\'100%\' border=\'0\' align=\'center\'> <tr> <td colspan=\'2\' class=\'header\'>' . $title . ' - ' . $entrydate . '</td> </tr> <tr> <td colspan=\'2\' class=\'content\'>' . $body . '</td> </tr> <tr> <td colspan=\'2\' class=\'content\'>Posted By: ' . $author . '</td> </tr> <tr> <td colspan=\'2\' class=\'content\'>Tags: ' . $tags . '</td> </tr> '; echo "</table>"; echo '<table width=\'100%\' border=\'0\' align=\'center\'> <tr> <td colspan=\'2\' class=\'header\'>Submit Comment</td> </tr> <tr> <td colspan=\'2\' class=\'content\'>'; if (!isset($suserid)) { echo 'You must be logged in to submit a comment</td></tr>'; } else { if ($seo_on == 1) { $sublink = '' . $domain . '/blogentry/submitcomment/'; } else { $sublink = '' . $domain . '/index.php?action=blogentry&cmd=submitcomment'; } echo ' Comment Title:<br> <form action=\'' . $sublink . '\' method=\'POST\'> <input type=\'hidden\' name=\'entryid\' value=\'' . $entryid . '\'> <input type=\'text\' size=\'40\' name=\'commenttitle\'><p>Body of Comment:<br> <small>(HTML and BBCode do not work.)</small><br> <textarea cols=\'35\' rows=\'5\' name=\'commentbody\'></textarea> <br> <input type=\'submit\' name=\'commentsubmit\' value=\'Add Comment\'> </form> </td> </tr> '; } echo "</table>"; listcomments(); }
function writebody() { global $db, $domain, $sitename, $cachelife, $template, $gamesfolder, $thumbsfolder, $limitboxgames, $seo_on, $blogentriesshown, $enabledcode_on, $comments_on, $directorypath, $autoapprovecomments, $gamesonpage, $abovegames, $belowgames, $showwebsitelimit, $supportemail, $showblog, $blogentriesshown, $blogcharactersshown, $blogcommentpermissions, $blogcommentsshown, $blogfollowtags, $blogcharactersrss, $usrdata, $userid; echo ' <table align=\'center\' border=\'0\' width=\'100%\'> <tr> <td class=\'header\'>Partners</td> </tr> <tr> <td align=\'center\' class=\'content\'> '; $rlinkx2 = "SELECT * FROM fas_links where activate != '0' ORDER BY activate desc "; $rlinkx1 = sqlcache('linkspage', $cachelife, $rlinkx2); foreach ($rlinkx1 as $row) { echo '<a href=\'' . $row['url'] . '\' target=\'_blank\'><font size=\'3\'>' . $row['title'] . '</font></a><br>'; } echo ' </td> </tr> </table> <hr width=\'85%\'> '; if (isset($_POST['submit'])) { $title = clean($_POST['title']); $url = clean($_POST['url']); $linkbackat = clean($_POST['linkbackat']); $emailaddress = clean($_POST['emailaddress']); $dateadded = time(); $IPaddress = $_SERVER['REMOTE_ADDR']; if (!$title || !$url) { echo '<div class=\'error\'>Title or URL was not filled.</div>'; include 'templates/' . $template . '/footer.php'; exit; } mysql_query("INSERT INTO fas_links SET \n\t\t\t\t\ttitle='{$title}',\n\t\t\t\t\turl='{$url}',\n\t\t\t\t\tdateadded='{$dateadded}',\n\t\t\t\t\tIPaddress='{$IPaddress}',\n\t\t\t\t linkbackreq='1',\n\t\t\t\t linkbackat='{$linkbackat}',\n\t\t\t\t emailaddress='{$emailaddress}'\n\t\t\t\t\t"); echo '<div class=\'msg\'>Link Added, waiting for verification.<p> <b><font size=\'4\'>If our link is not up on your end before we check, your link will be deleted without notice.</font><br /> '; } else { if ($seo_on == 1) { $submitlink = '' . $domain . '/links/'; } else { $submitlink = '' . $domain . '/index.php?action=links'; } echo ' <form action=\'' . $submitlink . '\' method=\'POST\'> <table align=\'center\' width=\'100%\'> <tr> <td class=\'header\'>Submit Your Link</td> </tr> <tr> <td class=\'content\'><b>If we do not see our link up on your end when we do our verification check, your link will be deleted with out notice or being activated.<p> If you take ours down later, we take yours down. <p>Please, don\'t waste your time or ours. <p>Our link:<br> Anchor: ' . $sitename . '<br> URL: ' . $domain . '<p></b></td> </tr> <tr> <td class=\'content\'>Enter your link info:</td> </tr> <tr> <td class=\'content\' align=\'center\'>Title: <input type=\'text\' name=\'title\' size=\'35\'></td> </tr> <tr> <td class=\'content\' align=\'center\'>URL: <input type=\'text\' name=\'url\' size=\'40\' value=\'http://\'></td> </tr> <tr> <td class=\'content\' align=\'center\'>Location of reciprocal link: <input type=\'text\' name=\'linkbackat\' size=\'40\' value=\'http://\'></td> </tr> <tr> <td class=\'content\' align=\'center\'>E-mail Address: <input type=\'text\' name=\'emailaddress\' size=\'40\' value=\'\'></td> </tr> <tr> <td class=\'content\' align=\'center\'><input type=\'submit\' name=\'submit\' value=\'Add Link\'></td> </tr> </table> </form>'; } }
function show() { global $domain, $db, $seo_on, $usrdata, $entryid, $suserid, $template, $cachelife, $gamesfolder, $thumbsfolder, $directorypath, $ads1, $ads2, $ads3, $showblog, $showpages; // $r3 = $db->query(sprintf('SELECT * FROM fas_blogentries WHERE entryid=\'%u\'', $entryid)); // $r4 = $db->fetch_row($r3); $r3 = "SELECT * FROM fas_blogentries WHERE entryid='{$entryid}'"; $sqltitle = "blogentry-" . $entryid; $r1 = sqlcache($sqltitle, $cachelife, $r3); foreach ($r1 as $r4) { $title = $r4['title']; $body = $r4['body']; $author = $r4['author']; $entrydate = $r4['entrydate']; $visible = $r4['visible']; $category = $r4['category']; $tags = $r4['tags']; } $chr_limit = 120; $add = '...'; $reg_exUrl = "/(http|https|ftp|ftps)\\:\\/\\/[a-zA-Z0-9\\-\\.]+\\.[a-zA-Z]{2,3}(\\/\\S*)?/"; if (preg_match($reg_exUrl, $body, $url)) { $bodystring = preg_replace($reg_exUrl, "<a href='" . $url[0] . "'>{$url[0]}</a> ", $body); } else { $bodystring = $body; } //$bodystring = ereg_replace("!(http:/{2}[\w\.]{2,}[/\w\-\.\?\&\=\#]*)!e", "'<a href=\"\\1\" title=\"\\1\" target=\"_blank\">'.(strlen('\\1')>=$chr_limit ? substr('\\1',0,$chr_limit).'$add':'\\1').'</a>'", $bodystring); $bodystring = str_replace("[url]", "<a href='http://", $bodystring); $bodystring = str_replace("[urlmid]", "'>", $bodystring); $bodystring = str_replace("[/url]", "</a>", $bodystring); $bodystring = str_replace("[img]", "<img alt='' src='http://", $bodystring); $bodystring = str_replace("[/img]", "' />", $bodystring); $bodystring = str_replace("[b]", "<b>", $bodystring); $bodystring = str_replace("[/b]", "</b>", $bodystring); $bodystring = str_replace("[i]", "<i>", $bodystring); $bodystring = str_replace("[/i]", "</i>", $bodystring); $bodystring = str_replace("[u]", "<u>", $bodystring); $bodystring = str_replace("[/u]", "</u>", $bodystring); $bodystring = str_replace("\n", "<br />", $bodystring); $body = str_replace("[br]", "<br />", $bodystring); echo '<div id="container"> <div id="content-container"> <div id="side">'; include "includes/blocks.php"; echo '</div> <div id="content"> <div class="content_nav">' . $title . ' - ' . $entrydate . '</div>'; echo '<table width=\'100%\' border=\'0\' align=\'center\'> <tr> <td colspan=\'2\' class=\'content\'>' . $body . '</td> </tr> <tr> <td colspan=\'2\' class=\'content\'>Posted By: ' . $author . '</td> </tr> <tr> <td colspan=\'2\' class=\'content\'>Tags: ' . $tags . '</td> </tr> '; echo '</table>'; echo '<div class="content_nav">Submit Comment</div>'; echo '<table width=\'100%\' border=\'0\' align=\'center\'> <tr> <td colspan=\'2\' class=\'content\'>'; if (!isset($suserid)) { echo 'You must be logged in to submit a comment</td></tr>'; } else { if ($seo_on == 1) { $sublink = '' . $domain . '/blogentry/submitcomment/'; } else { $sublink = '' . $domain . '/index.php?action=blogentry&cmd=submitcomment'; } echo ' Comment Title:<br /> <form action=\'' . $sublink . '\' method=\'post\'> <input type=\'hidden\' name=\'entryid\' value=\'' . $entryid . '\' /> <input type=\'text\' size=\'40\' name=\'commenttitle\' /><p>Body of Comment:</p><br /> <small>(HTML and BBCode do not work.)</small><br /> <textarea cols=\'35\' rows=\'5\' name=\'commentbody\'></textarea> <br /> <input type=\'submit\' name=\'commentsubmit\' value=\'Add Comment\' /> </form> </td> </tr> '; } echo '</table>'; listcomments(); }
function writebody() { global $db, $domain, $sitename, $cachelife, $template, $gamesfolder, $thumbsfolder, $limitboxgames, $seo_on, $blogentriesshown, $enabledcode_on, $comments_on, $directorypath, $autoapprovecomments, $gamesonpage, $abovegames, $belowgames, $showwebsitelimit, $supportemail, $showblog, $blogentriesshown, $blogcharactersshown, $blogcommentpermissions, $blogcommentsshown, $blogfollowtags, $blogcharactersrss, $usrdata, $userid, $r; $ID = clean($_GET['ID']); $ID = abs((int) $ID); $max = $gamesonpage; $show = clean($_GET['page']); if (empty($show)) { $show = 1; } $limits = ($show - 1) * $max; $r2 = "SELECT * FROM fas_games WHERE category='{$ID}' && active='1' ORDER BY ID DESC LIMIT " . $limits . "," . $max; $sqltitle = "browse-cat" . $ID . "page" . $show; $r1 = sqlcache($sqltitle, $cachelife, $r2); $totalres = mysql_result($db->query('SELECT COUNT(ID) AS total FROM fas_games WHERE active=\'1\' and category=\'' . $ID . '\''), 0); $totalpages = ceil($totalres / $max); echo '<table width=\'100%\' border=\'0\' align=\'center\'> <tr> <td colspan=\'2\' class=\'header\'>' . clean($_GET['name']) . ' Games</td> </tr>'; $count = 0; if (!isset($r1)) { echo ' <tr> <td colspan=\'2\' class=\'content\'><div align="center"><b>There currently are no games in this category.</b></div></td> </tr>'; } else { foreach ($r1 as $in) { $gamename = preg_replace('#\\W#', '-', $in['name']); if ($seo_on == 1) { $playlink = '' . $domain . '/play/' . $in['ID'] . '-' . $gamename . '.html'; } else { $playlink = '' . $domain . '/index.php?action=play&ID=' . $in['ID'] . ''; } if ($count % 2 == 0) { echo '<tr> <td width=\'50%\' valign=\'top\'> <table width=\'100%\' border=\'0\'> <tr> <td valign=\'top\' colspan=\'2\' class=\'header\'><b>' . titlelimit($in['name']) . '</b></td> </tr> <tr> <td width=\'55\' height=\'55\' valign=\'top\' class=\'content\'> <a href=\'' . $playlink . '\'> '; if ($in['type'] == 1) { echo ' <img src=\'' . $domain . '/' . $thumbsfolder . '/' . $in['thumb'] . '\' width=\'55\' height=\'55\' border=\'0\'>'; } else { echo ' <img src=\'' . $in['thumburl'] . '\' width=\'55\' height=\'55\' border=\'0\'>'; } echo ' </a> </td> <td valign=\'top\' class=\'content\'>' . desclimit($in['description']) . ' <a href=\'' . $playlink . '\' class=\'playlink\'><b>Play</b></a></td> </tr> </table> </td> '; } else { echo ' <td width=\'50%\' valign=\'top\'> <table width=\'100%\' border=\'0\'> <tr> <td valign=\'top\' colspan=\'2\' class=\'header\'><b>' . titlelimit($in['name']) . '</b></td> </tr> <tr> <td width=\'55\' height=\'55\' valign=\'top\' class=\'content\'> <a href=\'' . $playlink . '\'> '; if ($in['type'] == 1) { echo ' <img src=\'' . $domain . '/' . $thumbsfolder . '/' . $in['thumb'] . '\' width=\'55\' height=\'55\' border=\'0\'>'; } else { echo ' <img src=\'' . $in['thumburl'] . '\' width=\'55\' height=\'55\' border=\'0\'>'; } echo ' </a> </td> <td valign=\'top\' class=\'content\'>' . desclimit($in['description']) . ' <a href=\'' . $playlink . '\' class=\'playlink\'><b>Play</b></a></td> </tr> </table> </td> </tr>'; } $count++; } } echo "</table>"; echo 'Pages: '; for ($i = 1; $i <= $totalpages; $i++) { if ($seo_on == 1) { $urk = '' . $domain . '/browse/' . $ID . '-' . clean($_GET['name']) . '/page' . $i . '.html'; } else { $urk = '' . $domain . '/index.php?action=browse&ID=' . $ID . '&page=' . $i . ''; } echo '<a href=\'' . $urk . '\' class=\'pagenat\'>' . $i . '</a> '; } echo '<br /><br />'; $pgname = clean($_GET['name']); }
} //end isset($baseir1) echo '</div> </div>'; } else { //else count echo '<div class="home_category"> <div class="header2"> <div class="home_cat_title">' . $row['name'] . '</div> <div class="home_more"><a href=\'' . $categoryurl . '\'>View more</a></div> </div> <div class="content2">'; $catid1 = $row['ID']; $sqltitle = 'mainpagecat' . $catid1; $baseir2 = "SELECT * FROM fas_games WHERE category='{$catid1}' and active='1' ORDER BY rand() LIMIT 0," . $limitboxgames; $baseir1 = sqlcache($sqltitle, $cachelife, $baseir2); if (isset($baseir1)) { foreach ($baseir1 as $row) { $gamename = preg_replace('#\\W#', '-', $row['name']); if ($seo_on == 1) { $playlink = '' . $domain . '/play/' . $row['ID'] . '-' . $gamename . '.html'; } else { $playlink = '' . $domain . '/index.php?action=play&ID=' . $row['ID'] . ''; } echo '<div class="home_wrap"> <div class="home_img"> <a href=\'' . $playlink . '\'>'; if ($row['type'] == 1) { echo ' <img src=\'' . $domain . '/' . $thumbsfolder . '/' . $row['thumb'] . '\' class="home_img" alt=\'' . $gamename . '\' title= \'' . $gamename . '\' />'; } else { echo ' <img src=\'' . $row['thumburl'] . '\' class="home_img" alt= \'' . $gamename . '\' title= \'' . $gamename . '\' />';
<?php echo '<div class="header"> Latest Games </div> <div class="content">'; $count2 = 0; $latest2 = "SELECT * FROM fas_games WHERE `active`='1' ORDER BY ID DESC"; $latest1 = sqlcache('latest', $cachelife, $latest2); if (isset($latest1)) { foreach ($latest1 as $row2) { $latestname = preg_replace('#\\W#', '-', $row2['name']); if ($row2['type'] == 1) { $img = "<img src='" . $domain . "/" . $thumbsfolder . "/" . $row2["thumb"] . "' alt='" . $latestname . "' class='minithumb' />"; } else { $img = "<img src='" . $row2["thumburl"] . "' alt='" . $latestname . "' class='minithumb' />"; } if ($count2 <= 4) { echo '<ul class=\'catmenu\'> <li>'; if ($seo_on == 1) { echo "<a href='" . $domain . "/play/" . $row2["ID"] . "-" . $latestname . ".html'>" . $img . titlelimit($row2["name"]) . "</a>"; } else { echo "<a href='" . $domain . "/index.php?action=play&ID=" . $row2["ID"] . "'>" . $img . titlelimit($row2["name"]) . "</a>"; } echo '</li> </ul>'; } $count2++; } echo '<br />';
$image = '<img src=\'' . $thumburl . '\' width=\'55\' height=\'55\' alt=\'' . $gamename . '\' />'; } else { $image = '<img src=\'' . $domain . '/' . $thumbsfolder . '/' . $row['thumb'] . '\' width=\'55\' height=\'55\' border=\'0\' alt=\'' . $gamename . '\' />'; } if ($seo_on == 1) { $playlink = '' . $domain . '/play/' . $row['ID'] . '-' . $gamename . '.html'; } else { $playlink = '' . $domain . '/index.php?action=play&ID=' . $row['ID'] . ''; } echo ' <a href=\'' . $playlink . '\'>' . $image . '</a> '; } echo '</td></tr>'; } $ube2 = "SELECT * FROM fas_blogentries WHERE author='{$username}' AND visible='1' ORDER BY entrydate DESC LIMIT 5"; $sqltitle = "userblogentries-" . $userids; if ($ube1 = sqlcache($sqltitle, $cachelife, $ube2)) { echo '<tr><td class="header" colspan="2">Latest Blog Posts By ' . $username . '</td></tr> <tr><td class="content" colspan="2">'; foreach ($ube1 as $row) { if ($seo_on == 1) { $rburl = '' . $domain . '/blogentry/entryid/' . $row['entryid'] . '/1.html'; } else { $rburl = '' . $domain . '/index.php?action=blogentry&entryid=' . $row['entryid']; } echo '<a href=\'' . $rburl . '\' >' . $row['title'] . '</a> - ' . $row['entrydate'] . '<br>'; } echo '</td></tr>'; } echo '</table> </div></div></div>'; }
function writebody() { global $db, $domain, $sitename, $cachelife, $template, $gamesfolder, $thumbsfolder, $limitboxgames, $seo_on, $blogentriesshown, $enabledcode_on, $comments_on, $directorypath, $autoapprovecomments, $gamesonpage, $abovegames, $belowgames, $showwebsitelimit, $supportemail, $showblog, $blogentriesshown, $blogcharactersshown, $blogcommentpermissions, $blogcommentsshown, $blogfollowtags, $blogcharactersrss, $usrdata, $userid; $count = 0; $baser2 = "SELECT * FROM fas_categories where active='1'"; $baser1 = sqlcache('mainpagecats', $cachelife, $baser2); echo '<table width=\'99%\' border=\'0\' align=\'center\'>'; foreach ($baser1 as $row) { $categorynamev = $row['name']; $categorynameu = preg_replace('[^A-Za-z0-9]', '-', $categorynamev); if ($seo_on == 1) { $categoryurl = '' . $domain . '/browse/' . $row['ID'] . '-' . $categorynameu . '.html'; } else { $categoryurl = '' . $domain . '/index.php?action=browse&ID=' . $row['ID'] . ''; } echo '<tr> <td width=\'100%\' valign=\'top\'> <table width=\'100%\' border=\'0\'><div align=\'center\'> <tr> <td class=\'header\'>' . $row['name'] . '</td> </tr> <tr> <td>'; echo '<table><tr> <td width=\'755\' align=\'center\' class=\'content\'><div align=\'center\'>'; $catid1 = $row['ID']; $sqltitle = 'mainpagecat' . $catid1; $baseir2 = "SELECT * FROM fas_games WHERE category='{$catid1}' and active='1' ORDER BY rand() LIMIT 0," . $limitboxgames; $baseir1 = sqlcache($sqltitle, $cachelife, $baseir2); if (isset($baseir1)) { foreach ($baseir1 as $row) { $gamename = preg_replace('#\\W#', '-', $row['name']); if ($seo_on == 1) { $playlink = '' . $domain . '/play/' . $row['ID'] . '-' . $gamename . '.html'; } else { $playlink = '' . $domain . '/index.php?action=play&ID=' . $row['ID'] . ''; } echo '<a href=\'' . $playlink . '\' title=\'' . $row['name'] . '\'>'; if ($row['type'] == 1) { echo ' <img src=\'' . $domain . '/' . $thumbsfolder . '/' . $row['thumb'] . '\' width=\'80\' height=\'80\' style=\'margin:3px\' border=\'0\'>'; } else { echo ' <img src=\'' . $row['thumburl'] . '\' width=\'80\' height=\'80\' style=\'margin:3px\' border=\'0\'>'; } echo '</a>'; } } else { echo '<div> No games in this category yet. </div>'; } echo '<tr><td class=\'content\'>'; echo '<a href=\'' . $categoryurl . '\'>Play more ' . $categorynamev . ' games</a>'; echo '</td></tr></div>'; echo ' </table></div>'; echo ' </td> </tr> </table> </td>'; $count++; } echo "</table>"; $pgname = 'Your resource for fantastic games!'; }
function writebody() { global $db, $domain, $suserid, $cachelife, $sponsor, $ads1, $ads2, $ads3, $bannersleft, $headerspace, $footerspace, $sitename, $domain, $template, $gamesfolder, $thumbsfolder, $limitboxgames, $seo_on, $blogentriesshown, $enabledcode_on, $comments_on, $fbcomments_on, $taf_on, $directorypath, $autoapprovecomments, $gamesonpage, $abovegames, $belowgames, $showwebsitelimit, $supportemail, $showblog, $blogentriesshown, $blogcharactersshown, $blogcommentpermissions, $blogcommentsshown, $blogfollowtags, $blogcharactersrss, $usrdata, $userid, $avatar_on, $gender_on, $aimg, $fimg, $mimg, $seoheading, $seotext, $showpages; echo '<div id="container"> <div id="content-container"> <div id="side">'; include "includes/blocks.php"; echo '</div>'; $ID = clean($_GET['ID']); $ID = abs((int) $ID); $query = "SELECT Name FROM fas_categories WHERE ID={$ID}"; $result = mysql_query($query); $title = mysql_result($result, 0, "Name"); $max = $gamesonpage; if (!isset($_GET['page'])) { $show = '1'; } else { $show = clean($_GET['page']); } $limits = ($show - 1) * $max; $r2 = "SELECT * FROM fas_games WHERE category='{$ID}' && active='1' ORDER BY ID DESC LIMIT " . $limits . "," . $max; $sqltitle = "browse-cat" . $ID . "page " . $show; $r1 = sqlcache($sqltitle, $cachelife, $r2); $totalres = mysql_result($db->query('SELECT COUNT(ID) AS total FROM fas_games WHERE active=\'1\' and category=\'' . $ID . '\''), 0); $totalpages = ceil($totalres / $max); $count1 = 0; if (!isset($r1)) { echo '<div id="content"> <div class="content_nav">' . $title . ' Games</div> <div align="center">There currently are no games in this category.</div></div> </div></div>'; } else { echo '<div id="content"> <div class="content_nav">' . $title . ' Games</div>'; foreach ($r1 as $in) { $gamename = preg_replace('#\\W#', '-', $in['name']); if ($seo_on == 1) { $playlink = '' . $domain . '/play/' . $in['ID'] . '-' . $gamename . '.html'; } else { $playlink = '' . $domain . '/index.php?action=play&ID=' . $in['ID'] . ''; } echo '<div id="game_holder"> <a href="' . $playlink . '">'; if ($in['type'] == 1) { echo '<div align="center"><img src="' . $domain . '/' . $thumbsfolder . '/' . $in['thumb'] . '" alt="' . $gamename . '" title="' . $gamename . '" width="90" height="90" class="game_img"/>'; } else { echo '<div align="center"><img src="' . $in['thumburl'] . '" alt="' . $gamename . '" title="' . $gamename . '" width="90" height="100" class="game_img"/>'; } echo '</a></div>'; echo '</div>'; $count1++; } echo '<div style="clear:both"></div><div class="page-box"> ' . $totalres . ' game(s) - Page ' . $show . ' of ' . $totalpages; $pre = $show - '1'; $ne = $show + '1'; if ($seo_on == 1) { $previous = '' . $domain . '/browse/' . $ID . '-' . clean($_GET['name']) . '/page' . $pre . '.html'; $next = '' . $domain . '/browse/' . $ID . '-' . clean($_GET['name']) . '/page' . $ne . '.html'; } else { $previous = '' . $domain . '/index.php?action=browse&ID=' . $ID . '&page=' . $pre . ''; $next = '' . $domain . '/index.php?action=browse&ID=' . $ID . '&page=' . $ne . ''; } if ($totalpages > '1') { echo ' - '; if ($show > '1') { echo '<a href="' . $previous . '" class="page">Previous</a>'; } for ($i = 1; $i <= $totalpages; $i++) { if ($show - $i < '4' || $totalpages - $i < '7') { if ($i - $show < '4' || $i < '8') { if ($seo_on == 1) { $urk = '' . $domain . '/browse/' . $ID . '-' . clean($_GET['name']) . '/page' . $i . '.html'; } else { $urk = '' . $domain . '/index.php?action=browse&ID=' . $ID . '&page=' . $i . ''; } if ($show == $i) { echo '<a href="' . $urk . '" class="page-select">' . $i . '</a>'; } else { echo '<a href="' . $urk . '" class="page">' . $i . '</a>'; } } } } if ($show < $totalpages) { echo '<a href="' . $next . '" class="page">Next</a>'; } } echo '</div> </div></div></div>'; } }
</form>'; } echo '<tr> <td colspan=\'2\' class=\'content\'> <div align=\'center\'>' . $commentvar . '</div> </td> </tr>'; $rrr2 = "SELECT * FROM fas_comments WHERE gameid='{$ID}' AND approved='1' ORDER BY date DESC LIMIT 3"; $sqltitle = "gamecomments-" . $ID; if ($rrr1 = sqlcache($sqltitle, $cachelife, $rrr2)) { foreach ($rrr1 as $row) { $date = date('M-d-Y', $row['date']); $useridc = $row['commenter']; $rra2 = "SELECT * FROM fas_users WHERE userid='{$useridc}'"; $sqltitle = "userprofile-" . $row['commenter']; $rra1 = sqlcache($sqltitle, $cachelife, $rra2); foreach ($rra1 as $rra) { $useridl = $row['commenter']; $avatarfileurl = get_avatar($useridc); if ($seo_on == 1) { $urlp = '' . $domain . '/showprofile/' . $useridl . '.html'; } else { $urlp = '' . $domain . '/index.php?action=showprofile&profile=' . $useridl; } if ($row['commenter'] == '0') { $commenter = 'Guest'; } else { $commenter = $rra['username']; } echo '<tr> <td width=\'20%\' class=\'content\' style=\'padding:4px;\' valign=\'top\'>
if (isset($suserid)) { $query = mysql_query("SELECT `template` FROM `fas_users` WHERE `userid`='{$suserid}'"); $row = mysql_fetch_array($query); $user_template = $row['template']; } else { $user_template = ''; } if (!empty($user_template) && $user_template != "default") { $template = $user_template; } else { $query = mysql_query("SELECT `template` FROM `fas_themes` WHERE `default`='1'"); $row = mysql_fetch_array($query); $template = $row['template']; } $set2 = "SELECT * FROM fas_settings"; $set1 = sqlcache('sitesettings', '1', $set2); foreach ($set1 as $set) { $domain = $set['domain']; $directorypath = $set['directorypath']; $tzone = $set['tzone']; $slogan = $set['slogan']; $gamesfolder = $set['gamesfolder']; $thumbsfolder = $set['thumbsfolder']; $limitboxgames = $set['limitboxgames']; $email_on = $set['email_on']; $comments_on = $set['comments_on']; $taf_on = $set['taf_on']; $fbcomments_on = $set['fbcomments_on']; $autoapprovecomments = $set['autoapprovecomments']; $seo_on = $set['seo_on']; $sitename = $set['sitename'];
<?php echo '<div class="side_nav">Random Games</div> <div id="side_holder">'; $count2 = 0; $random2 = "SELECT * FROM fas_games WHERE `active`='1' ORDER BY RAND ()"; $random1 = sqlcache('random', $cachelife, $random2); if (isset($random1)) { foreach ($random1 as $row2) { $randomname = preg_replace('#\\W#', '-', $row2['name']); if ($row2['type'] == 1) { $img = "<img src='" . $domain . "/" . $thumbsfolder . "/" . $row2["thumb"] . "' alt='" . $randomname . "' title='" . $randomname . "' class='minithumb' />"; } else { $img = "<img src='" . $row2["thumburl"] . "' alt='" . $randomname . "' title='" . $randomname . "' class='minithumb' />"; } if ($count2 <= 4) { echo '<ul class=\'catmenu\'> <li>'; if ($seo_on == 1) { echo "<a href='" . $domain . "/play/" . $row2["ID"] . "-" . $randomname . ".html'>" . $img . titlelimit($row2["name"]) . "</a>"; } else { echo "<a href='" . $domain . "/index.php?action=play&ID=" . $row2["ID"] . "'>" . $img . titlelimit($row2["name"]) . "</a>"; } echo '</li> </ul>'; } $count2++; } } else { echo '<ul class="catmenu"> <li>No games have been added yet!</li>
function writebody() { global $db, $domain, $suserid, $cachelife, $ir, $ir2, $r, $cname, $sponsor, $ads1, $ads2, $ads3, $headerspace, $footerspace, $ID, $sitename, $domain, $template, $gamesfolder, $thumbsfolder, $limitboxgames, $seo_on, $blogentriesshown, $enabledcode_on, $comments_on, $fbcomments_on, $taf_on, $directorypath, $autoapprovecomments, $gamesonpage, $abovegames, $belowgames, $showwebsitelimit, $supportemail, $showblog, $blogentriesshown, $blogcharactersshown, $blogcommentpermissions, $blogcommentsshown, $blogfollowtags, $blogcharactersrss, $usrdata, $userid, $avatar_on, $gender_on, $aimg, $fimg, $mimg, $gamename; if (!$ID) { echo '<div class=\'error\'>No game selected.</div>'; return; } if (!$r['name']) { echo '<div class=\'error\'>Game does not exist.</div>'; return; } $ir = $db->query(sprintf('SELECT * FROM fas_games WHERE ID=\'%u\'', $ID)); $r = $db->fetch_row($ir); $cname = preg_replace('#\\W#', '-', $cname); if (isset($_POST['commentsubmit'])) { $commenter = $usrdata['userid']; $gameid = $ID; $comment = clean($_POST['comment']); $date = time(); if ($autoapprovecomments == 1) { $approved = 1; } else { $approved = 0; } $db->query(sprintf('INSERT INTO fas_comments SET gameid=\'%u\', commenter=\'%u\', comment=\'%s\', date=\'%u\', approved=\'%u\' ', $ID, $commenter, $comment, $date, $approved)); if ($autoapprovecomments == 1) { $msgcom = 'Comment Posted.'; } else { $msgcom = 'Comment Posted, Awaiting admin approval.'; } echo '<div class=\'msg\'>' . $msgcom . '</div><br />'; } echo '<div id="container"> <div id="content-container"> <div id="side">'; include "includes/blocks.php"; echo '</div> <div id="content"> <div class="content_nav">' . $r['name'] . '</div>'; echo '<table width=\'100%\' align=\'center\'>'; if (!$abovegames == "") { echo '<tr> <td class=\'content\' colspan=\'2\' ><div align=\'center\'>' . $abovegames . '<p></div></td> </tr>'; } echo '<tr> <td class=\'content\' align=\'center\' colspan=\'2\'> <div align=\'center\'>'; if ($r['type'] == 1) { /**echo '<object width=\''.$r['width'].'\' height=\''.$r['height'].'\'> <param name=\'movie\' value=\''.$domain.'/'.$gamesfolder.'/'.$r['file'].'\' /> <embed src=\''.$domain.'/'.$gamesfolder.'/'.$r['file'].'\' width=\'695\' height=\''.$r['height'].'\'></embed> </object>';**/ echo '<object type="application/x-shockwave-flash" data="' . $domain . '/' . $gamesfolder . '/' . $r['file'] . '" width="695" height="' . $r['height'] . '"> <param name="movie" value="' . $domain . '/' . $gamesfolder . '/' . $r['file'] . '" /> </object>'; } else { echo $r['enabledcode']; } echo ' </div> </td> </tr> <tr>'; echo '<td class=\'content\' colspan=\'2\'><div align=\'center\'>'; echo '<a href=\'' . $domain . '/' . $gamesfolder . '/' . $r['file'] . '\' target="_blank" /><img src=\'' . $domain . '/templates/' . $template . '/images/fullscreen.png\' border=\'0\' alt=\'Full Screen\' title=\'Full Screen\' /></a> '; if ($seo_on == 1) { echo '<a href=\'' . $domain . '/addtofavorites/' . $ID . '/\'><img src=\'' . $domain . '/templates/' . $template . '/images/favorite.png\' border=\'0\' alt=\'Add to my Favorites\' title=\'Add to My Favorites\' /></a> '; } else { echo '<a href=\'' . $domain . '/index.php?action=addtofavorites&cmd=' . $ID . '\'><img src=\'' . $domain . '/templates/' . $template . '/images/favorite.png\' border=\'0\' alt=\'Add to my favorites\' title=\'Add to My Favorites\' /></a> '; } if ($usrdata['user_level'] == 1) { if ($seo_on == 1) { echo '<a href=\'' . $domain . '/report/' . $ID . '/\'><img src=\'' . $domain . '/templates/' . $template . '/images/report.png\' border=\'0\' alt=\'Report Broken Game\' title=\'Report Broken Game\' /></a> '; } else { echo '<a href=\'' . $domain . '/index.php?action=report&cmd=' . $ID . '\'><img src=\'' . $domain . '/templates/' . $template . '/images/report.png\' border=\'0\' alt=\'Report Broken Game\' title=\'Report Broken Game\' /></a> '; } } if ($usrdata['user_level'] == 2) { echo '<a href=\'' . $domain . '/index.php?action=admin&case=managegames&cmd=edit&ID=' . $r['ID'] . '&type=' . $r['type'] . '\' onclick="return confirm(\'Are you sure you want to edit the game ' . $r['name'] . '?\')"><img src=\'' . $domain . '/templates/' . $template . '/images/edit.png\' title=\'Edit Game\' alt=\'edit game\' border=\'0\' /></a> '; echo '<a href=\'' . $domain . '/index.php?action=admin&case=managegames&cmd=delete&ID=' . $r['ID'] . '\' onclick="return confirm(\'Are you sure you want to delete the game ' . $r['name'] . '?\')"><img src=\'' . $domain . '/templates/' . $template . '/images/delete.png\' title=\'Delete Game\' alt=\'delete game\' border=\'0\' /></a> '; } echo '</div></td>'; echo '</tr> </table> <table width=\'100%\'> <div class="content_nav">' . $r['name'] . ' Details</div> <tr> <td class=\'content\' colspan=\'2\'><div align=\'center\'>' . $belowgames . '</div></td> </tr> <tr> <td class=\'content\' width=\'70%\' valign=\'top\'><b>Description:</b> ' . $r['description'] . ' <br /><br />'; $query = "SELECT category FROM fas_games WHERE ID='{$ID}'"; $result = mysql_query($query); $category1 = mysql_result($result, 0, "category"); $query2 = "SELECT name FROM fas_categories WHERE ID='{$category1}'"; $result2 = mysql_query($query2); $name = mysql_result($result2, 0, "name"); echo '<b>Category:</b> ' . $name . '<br /><br /> <b>Total Views:</b> ' . $r['views'] . '<br /><br />'; if ($seo_on == 1) { $playlink = '' . $domain . '/play/' . $r['ID'] . '-' . $gamename . '.html'; } else { $playlink = '' . $domain . '/index.php?action=play&ID=' . $r['ID'] . ''; } echo '<div class="fb-like" data-href="' . urlencode($playlink) . '" data-layout="standard" data-action="like" data-show-faces="false" data-share="false" data-colorscheme="dark"></div> <br /><br /> <div align="left">'; echo pullRating($ID, true, false, true); echo '</div><br /> </td>'; echo '</tr> </table> <table width="100%"> <div class="content_nav">Bored of this game? check these out!</div> <tr> <td class=\'content\' colspan=\'2\'> <div align=\'center\' style=\'padding:5px;\'>'; $rrb = $db->query('SELECT * FROM fas_games WHERE `active`=\'1\' ORDER BY RAND() LIMIT 0,8'); echo '<table align=\'center\'> <tr>'; while ($ro = $db->fetch_row($rrb)) { $gamename = preg_replace('[^A-Za-z0-9]', '', $ro['name']); if ($seo_on == 1) { $playlink = '' . $domain . '/play/' . $ro['ID'] . '-' . $gamename . '.html'; } else { $playlink = '' . $domain . '/index.php?action=play&ID=' . $ro['ID'] . ''; } if ($ro['type'] == 1) { $imgg = '' . $domain . '/' . $thumbsfolder . '/' . $ro['thumb'] . ''; } else { $imgg = $ro['thumburl']; } echo '<td> <div align=\'center\'><a href=\'' . $playlink . '\'> <img src=\'' . $imgg . '\' border=\'0\' width=\'65\' height=\'65\' alt=\'' . $gamename . '\' title=\'' . $gamename . '\' /><br /> </a> </div> </td> <td width=\'2%\'></td>'; } echo '</tr> </table> </div> </td> </tr> </table>'; if ($enabledcode_on == 1 && $usrdata['user_level'] >= 1) { echo '<table width="100%"> <div class="content_nav">Enabled Code</div> <tr> <td class=\'content\' colspan=\'2\'> <div align=\'center\' style=\'padding:5px;\'> <textarea cols=\'60\' rows=\'5\'>'; if ($r['type'] == 1) { echo ' <object width="' . $r['width'] . '" height="' . $r['height'] . '"> <param name="movie" value="' . $domain . '/' . $gamesfolder . '/' . $r['file'] . '"> <embed src="' . $domain . '/' . $gamesfolder . '/' . $r['file'] . '" width="' . $r['width'] . '" height="' . $r['height'] . '"> </embed> </object> '; } else { echo ' ' . $r['enabledcode'] . ' '; } echo '</textarea> </div> </td> </tr> </table>'; } $gamename = preg_replace('#\\W#', '-', $r['name']); if ($seo_on == 1) { $playlink = '' . $domain . '/play/' . $r['ID'] . '-' . $gamename . '.html'; } else { $playlink = '' . $domain . '/index.php?action=play&ID=' . $r['ID'] . ''; } if ($fbcomments_on == 1) { echo '<table width="100%"> <div class="content_nav">Comments</div> <tr> <td><div class="fb-comments" data-href="' . $playlink . '" data-numposts="5" data-colorscheme="light" data-width="100%"></div></td> </tr> </table>'; } else { } if ($comments_on == 1) { echo '<table width="100%"> <div class="content_nav">Comments</div> <tr> <td width=\'70%\' valign=\'top\' colspan=\'2\' align=\'center\'> <div align=\'center\'> <table width=\'100%\' border=\'0\'>'; $gamename = preg_replace('#\\W#', '', $r['name']); if ($seo_on == 1) { $comlink = '' . $domain . '/play/' . $ID . '-' . $gamename . '.html'; } else { $comlink = '' . $domain . '/index.php?action=play&ID=' . $ID . ''; } if (!isset($suserid)) { $commentvar = 'You must be logged in to post a comment'; } else { $commentvar = ' <form action=\'' . $comlink . '\' method=\'post\'> <textarea cols=\'60\' rows=\'5\' name=\'comment\'></textarea> <br /> <input type=\'submit\' name=\'commentsubmit\' value=\'Add Comment\' /> </form>'; } echo '<tr> <td colspan=\'2\' class=\'content\'> <div align=\'center\'>' . $commentvar . '</div> </td> </tr>'; $rrr2 = "SELECT * FROM fas_comments WHERE gameid='{$ID}' AND approved='1' ORDER BY date DESC LIMIT 3"; $sqltitle = "gamecomments-" . $ID; if ($rrr1 = sqlcache($sqltitle, $cachelife, $rrr2)) { foreach ($rrr1 as $row) { $date = date('M-d-Y', $row['date']); $useridc = $row['commenter']; $rra2 = "SELECT * FROM fas_users WHERE userid='{$useridc}'"; $sqltitle = "userprofile-" . $row['commenter']; $rra1 = sqlcache($sqltitle, $cachelife, $rra2); foreach ($rra1 as $rra) { $useridl = $row['commenter']; $avatarfileurl = get_avatar($useridc); if ($seo_on == 1) { $urlp = '' . $domain . '/showprofile/' . $useridl . '.html'; } else { $urlp = '' . $domain . '/index.php?action=showprofile&profile=' . $useridl; } if ($row['commenter'] == '0') { $commenter = 'Guest'; } else { $commenter = $rra['username']; } echo '<tr> <td width=\'20%\' class=\'content\' style=\'padding:4px;\' valign=\'top\'> <div align="center"> <b>Posted By:</b> <a href="' . $urlp . '">' . $commenter . '</a><br /> <a href="' . $urlp . '"><img src=\'' . $domain . '/avatars/' . $avatarfileurl . '\' height=\'50\' width=\'50\' title=\'' . $commenter . '\'/></a><br /> <small><i><b>Posted On:</b> ' . $date . '</i></small></div> </td> <td valign=\'top\' class=\'content\'>' . $row['comment'] . ''; if ($usrdata['user_level'] == 2) { echo '<div style="float: right; padding-right: 20px;"> <a href=\'' . $domain . '/index.php?action=admin&case=managegamecomments&cmd=edit&ID=' . $row['ID'] . '\' onclick="return confirm(\'Are you sure you want to edit this comment?\')"><img src=\'' . $domain . '/templates/' . $template . '/images/edit.png\' border=\'0\' alt=\'Edit Comment\' title=\'Edit Comment\' /></a> <a href=\'' . $domain . '/index.php?action=admin&case=managegamecomments&cmd=delete&ID=' . $row['ID'] . '\' onclick="return confirm(\'Are you sure you want to delete this comment?\')"><img src=\'' . $domain . '/templates/' . $template . '/images/delete.png\' border=\'0\' alt=\'Delete Comment\' title=\'Delete Comment\' /></a> </div>'; } echo '</td> </tr> <tr> <td width=\'100%\' colspan=\'2\' class=\'content\'> </td> </tr>'; } } } else { echo '<tr><td colspan=\'2\' class=\'content\'>No Comments Yet!</td></tr>'; } if ($seo_on == 1) { $urco = '' . $domain . '/showcomments/' . $cname . '/' . $ID . '/1.html'; } else { $urco = '' . $domain . '/index.php?action=showcomments&name=' . $cname . '&ID=' . $ID . '&page=1'; } echo '<tr> <td width=\'100%\' colspan=\'2\' class=\'content\'><a href=\'' . $urco . '\'><small><i><b>More Comments</b></i></small></a></td> </tr>'; echo '</table>'; } if ($seo_on == 1) { $taf1 = '' . $domain . '/taf/'; } else { $taf1 = '' . $domain . '/index.php?action=taf'; } if ($taf_on == 1) { echo '<table width="100%"> <div class="content_nav">Tell a Friend</div> <tr> <td width=\'70%\' valign=\'top\' colspan=\'2\' class=\'content\' align=\'center\'> <div align=\'center\'> <form action =\'' . $taf1 . '\' method=\'POST\'> <tr> <td class=\'content\'>Your Name: </td> <td class=\'content\'><input type=\'text\' name=\'sender\' size=\'50\'></td> </tr> <tr> <td class=\'content\'>Your friend\'s e-mail: </td> <td class=\'content\'><input type=\'text\' name=\'recipient\' size=\'50\'></td> </tr> <tr> <td class=\'content\' colspan=\'2\'> <input type=\'hidden\' name=\'gamei\' value=\'' . $ID . '\'> <input type=\'hidden\' name=\'gamen\' value=\'' . $gamename . '\'> <input type=\'submit\' value=\'Send\'> </td> </tr> </div> </table>'; } else { } echo '</div> </td> </tr> </table>'; echo '</div></div></div>'; $useridp = $usrdata['userid']; if ($useridp == '0' or $useridp == '') { $useridp = '-1'; } $db->query(sprintf('UPDATE fas_games SET views=views+1 WHERE ID=\'%u\'', $ID)); if ($useridp != '-1') { $db->query('UPDATE fas_users SET plays=plays+1 WHERE userid=\'' . $useridp . '\''); } $db->query('UPDATE fas_gamestats SET total_played = total_played + 1,played_today = played_today + 1'); // adds a play to the total plays and played today stats }