コード例 #1
0
            }
            echo '</div>
		</div>';
        } else {
            echo '<div class="home_wrap">
			<div class="home_img">
				<a href="' . $playlink . '">';
            if ($in['type'] == 1) {
                echo '<img src="' . $domain . '/' . $thumbsfolder . '/' . $in['thumb'] . '" alt="' . $gamename . '" class="home_img" />';
            } else {
                echo '<img src="' . $in['thumburl'] . '" alt="' . $gamename . '" class="home_img" />';
            }
            echo '</a>
			</div>
			<div class="home_info">
				<div class="home_title"><a href="' . $playlink . '">' . titlelimit($in['name']) . '</a></div>
				<div class="home_desc">' . desclimit($in['description']) . '</div>';
            if ($usrdata['user_level'] == 2) {
                echo '<div style="float: right; vertical-align: top; padding-right: 20px;">
						<a href=\'' . $domain . '/index.php?action=admin&amp;case=managegames&amp;cmd=edit&amp;ID=' . $in['ID'] . '&amp;type=' . $in['type'] . '\' onclick="return confirm(\'Are you sure you want to edit the game ' . $in['name'] . '?\')"><img src=\'' . $domain . '/templates/' . $template . '/style/images/edit.png\' title=\'edit game\' alt=\'edit game\' border=\'0\' /></a>
						<a href=\'' . $domain . '/index.php?action=admin&amp;case=managegames&amp;cmd=delete&amp;ID=' . $in['ID'] . '\' onclick="return confirm(\'Are you sure you want to delete the game ' . $in['name'] . '?\')"><img src=\'' . $domain . '/templates/' . $template . '/style/images/delete.png\' title=\'delete game\' alt=\'delete game\' border=\'0\' /></a>
					</div>';
            }
            echo '</div>
		</div>';
        }
        $count++;
    }
    echo '</div>
<div class="page-box">
' . $totalres . ' game(s) - Page ' . $show . ' of ' . $totalpages;
コード例 #2
0
     <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&amp;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>
				</ul>';
}
echo '</div>';
コード例 #3
0
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&amp;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>&nbsp; ';
    }
    echo '<br /><br />';
    $pgname = clean($_GET['name']);
}
コード例 #4
0
                    $playlink = '' . $domain . '/play/' . $row['ID'] . '-' . $gamename . '.html';
                } else {
                    $playlink = '' . $domain . '/index.php?action=play&amp;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 . '\' />';
                }
                echo '</a>
				      		</div>
							<div class="home_info">
				      			<div class=\'home_title\'><a href=\'' . $playlink . '\'>' . titlelimit($row['name']) . '</a></div>
				      			<div class=\'home_desc\'>' . desclimit($row['description']) . '</div>
				      		</div>
						</div>';
            }
        } else {
            echo '<div>
							No games have been added to this category yet.
						</div>';
        }
        echo '</div>
		</div>
	</div>';
    }
    $count++;
}
コード例 #5
0
}
$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&amp;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=\'150\' height=\'100\' alt= \'' . $row1['name'] . '\' title= \'' . $row1['name'] . '\' border=\'0\'/></a><br />';
        } else {
            echo '<div align="center"><img src=\'' . $row1['thumburl'] . '\' width=\'150\' height=\'100\' alt= \'' . $row1['name'] . '\' title= \'' . $row1['name'] . '\' border=\'0\'/></a><br />';
        }
        echo '<a href=\'' . $playlink . '\'><h2>' . titlelimit($row1['name']) . '</h2></a></div></div>';
    }
} else {
    echo '<div align="center">
						No games have been added yet!
					</div>';
}
echo '</div>


</div></div>';
$pgname = 'Your resource for fantastic games!';
コード例 #6
0
echo '<div class="content_nav">Most Played Games</div>';
while ($in = $db->fetch_row($r)) {
    $gamename = preg_replace('#\\W#', '-', $in['name']);
    if ($seo_on == 1) {
        $playlink = '' . $domain . '/play/' . $in['ID'] . '-' . $gamename . '.html';
    } else {
        $playlink = '' . $domain . '/index.php?action=play&amp;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="150" height="100" />';
    } else {
        echo '<div align="center"><img src="' . $in['thumburl'] . '" alt="' . $gamename . '" title="' . $gamename . '" width="150" height="100" />';
    }
    echo '</a><br /><a href=\'' . $playlink . '\'><h2>' . titlelimit($in['name']) . '</h2></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 = $urk = '' . $domain . '/mostplayed/page' . $pre . '.html';
    $next = $urk = '' . $domain . '/mostplayed/page' . $ne . '.html';
} else {
    $previous = $urk = '' . $domain . '/index.php?action=mostplayed&page=' . $pre . '';
    $next = $urk = '' . $domain . '/index.php?action=mostplayed&page=' . $ne . '';
コード例 #7
0
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;
    $max = $gamesonpage;
    if (!isset($_GET['page'])) {
        $show = '1';
    } else {
        $show = clean($_GET['page']);
    }
    $limits = ($show - 1) * $max;
    $r = $db->query(sprintf('SELECT * FROM fas_games ORDER BY views DESC LIMIT ' . $limits . ',' . $max . ' '));
    $totalres = mysql_result($db->query('SELECT COUNT(ID) AS total FROM fas_games'), 0);
    $totalpages = ceil($totalres / $max);
    echo '<table width=\'100%\' border=\'0\' align=\'center\'>
	<tr>
		<td colspan=\'2\' class=\'header\'>Most Played Games</td>
	</tr>';
    $count = 0;
    while ($in = $db->fetch_row($r)) {
        $gamename = preg_replace('#\\W#', '-', $in['name']);
        if ($seo_on == 1) {
            $playlink = '' . $domain . '/play/' . $in['ID'] . '-' . $gamename . '.html';
        } else {
            $playlink = '' . $domain . '/index.php?action=play&amp;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\' width=\'55\' border=\'0\'>';
            } else {
                echo '	<img src=\'' . $in['thumburl'] . '\' width=\'55\' width=\'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 '<div class="page-box">
' . $totalres . ' game(s) - Page ' . $show . ' of ' . $totalpages;
    $pre = $show - '1';
    $ne = $show + '1';
    if ($seo_on == 1) {
        $previous = '' . $domain . '/mostplayed/page' . $pre . '.html';
        $next = '' . $domain . '/mostplayed/page' . $ne . '.html';
    } else {
        $previous = '' . $domain . '/index.php?action=mostplayed&page=' . $pre . '';
        $next = '' . $domain . '/index.php?action=mostplayed&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 . '/mostplayed/page' . $i . '.html';
                    } else {
                        $urk = '' . $domain . '/index.php?action=mostplayed&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>';
}