Пример #1
0
<?php

$cache = RayCache::getInstance('newest', null, array('prefix' => $setting['theme'] . '_', 'path' => 'cache/', 'expire' => $setting['cachelife']));
$data = $cache->read('newest');
if ($data) {
    echo $data;
} else {
    $cache->start_caching();
    ?>

<div class="nav_box"><div class="nav">Newest Games</div>
<div class="nav_box2">
<div class="links1">
<?php 
    $query = yasDB_select("SELECT id, title FROM games ORDER BY id DESC LIMIT 5");
    while ($games = $query->fetch_array(MYSQLI_ASSOC)) {
        $gameurl = prepgame($games['title']);
        if ($setting['seo'] == 'yes') {
            $gurl = $setting['siteurl'] . 'game/' . $games['id'] . '/' . $gameurl . '.html';
        } else {
            $gurl = $setting['siteurl'] . 'index.php?act=game&id=' . $games['id'];
        }
        ?>

			<a href="<?php 
        echo $gurl;
        ?>
"><?php 
        echo $games['title'];
        ?>
</a>
Пример #2
0
<?php

$cache = RayCache::getInstance('home', null, array('prefix' => 'tribox_', 'path' => 'cache/', 'expire' => $setting['cachelife']));
$data = $cache->read('home');
if ($data) {
    echo $data;
} else {
    $cache->start_caching();
    $pic_settings = array('w' => 80, 'h' => 80);
    ?>
<!-- begin center -->
<div id="center">
<div id="home_main_header"><a href="<?php 
    echo $setting['siteurl'];
    ?>
"><?php 
    echo $setting['sitename'];
    ?>
    Play free online games to the max!</a></div>   
<div id="home_main_box">
<?php 
    $select_cats = yasDB_select("SELECT * FROM categories WHERE active='yes'AND home='yes' ORDER BY `order` DESC", false);
    $gamesort = $setting['gamesort'];
    $numbgames = 3;
    while ($cats = $select_cats->fetch_array(MYSQLI_ASSOC)) {
        $catid = $cats['id'];
        if ($gamesort == 'popular') {
            $query = yasDB_select("SELECT * FROM games WHERE category=" . $catid . " ORDER BY plays DESC LIMIT " . $numbgames . "", false);
        } elseif ($gamesort == 'newest') {
            $query = yasDB_select("SELECT * FROM games WHERE category=" . $catid . " ORDER BY id DESC LIMIT " . $numbgames . "", false);
        } elseif ($gamesort == 'random') {
Пример #3
0
<?php

$cache = RayCache::getInstance('top', null, array('prefix' => 'tribox_', 'path' => 'cache/', 'expire' => 60));
$data = $cache->read('top');
if ($data) {
    echo $data;
} else {
    $cache->start_caching();
    ?>
<div class="navh3">Top Games</div>
<div style="float:left;width:174px;height:auto;margin:0 0; padding:0 0;">
<?php 
    $query = yasDB_select("SELECT id, title, thumbnail, plays FROM games ORDER BY plays DESC LIMIT 8");
    if ($query->num_rows == 0) {
        echo '<center><h4>We have no top games yet!</h4></center>';
    } else {
        $pic_settings = array('w' => 35, 'h' => 35);
        while ($games = $query->fetch_array(MYSQLI_ASSOC)) {
            $gameurl = prepgame($games['title']);
            $games['description'] = stripslashes($games['description']);
            $description = str_replace(array("\r\n", "\r", "\n", "'", '"'), ' ', $games['description']);
            if (strlen($games['title']) > 25) {
                $title = substr($games['title'], 0, 22) . '...';
            } else {
                $title = $games['title'];
            }
            if (file_exists($games['thumbnail'])) {
                $thumbnail = urldecode($games['thumbnail']);
            } else {
                $thumbnail = $setting['siteurl'] . 'templates/' . $setting['theme'] . '/skins/' . $setting['skin'] . '/images/nopic.jpg';
            }
Пример #4
0
<?php

include_once $setting['sitepath'] . '/includes/pagination.class.php';
$page = isset($_GET['page']) ? $_GET['page'] : 1;
$cache = RayCache::getInstance('toprated' . $page, null, array('prefix' => $setting['theme'] . '-' . $setting['skin'] . '_', 'path' => 'cache/', 'expire' => $setting['cachelife']));
$data = $cache->read('toprated');
if ($data) {
    echo $data;
} else {
    $cache->start_caching();
    $pic_settings = array('w' => 130, 'h' => 100);
    ?>
	<!-- begin center -->
	<div id="center">
	<!-- start of toprated -->
	<div class="container_box1"><div id="headergames2">Top Rated</div>
	<?php 
    $query = yasDB_select("SELECT * FROM games");
    if ($query->num_rows == 0) {
        echo '<center><h3>We have no Top Rated games yet!</h3></center>';
    } else {
        $result = yasDB_select("SELECT count(id) FROM `games` ");
        $query_data = $result->fetch_array(MYSQLI_NUM);
        $numrows = $query_data[0];
        $result->close();
        $pageurl = new pagination($numrows, $setting['seo'], 'toprated', 25, 3);
        $query = yasDB_select("SELECT `games`.`id`, `title`, `thumbnail`, `description`, `plays` FROM `games` INNER JOIN `ratingsbar` ON `games`.`id` = `ratingsbar`.`id` WHERE `ratingsbar`.`total_votes` > 0 ORDER BY `ratingsbar`.`total_value`/`ratingsbar`.`total_votes` DESC, `ratingsbar`.`total_votes` DESC LIMIT " . $pageurl->start . ", " . $pageurl->limit);
        $pic_settings = array('w' => 130, 'h' => 100);
        while ($games = $query->fetch_array(MYSQLI_ASSOC)) {
            $gameurl = prepgame($games['title']);
            $games['description'] = stripslashes($games['description']);