示例#1
0
<div id="featured_games_container">
<?php 
if (!defined('AVARCADE_')) {
    include '../../config.php';
    include '../core.php';
}
$cat_numb = mysql_result(mysql_query("SELECT COUNT(*) as Num FROM ava_games WHERE featured=1 AND published=1"), 0);
if ($cat_numb > 0) {
    $category_games = mysql_query("SELECT * FROM ava_games WHERE featured=1 AND published=1 ORDER BY id desc");
    while ($cat_games = mysql_fetch_array($category_games)) {
        $featured_game = GameData($cat_games, 'featured');
        include '.' . $setting['template_url'] . '/' . $template['featured_game'];
    }
}
?>
</div>
示例#2
0
<?php

$sql = mysql_query("SELECT * FROM ava_games WHERE published=1 ORDER BY id desc LIMIT 6");
while ($row = mysql_fetch_array($sql)) {
    $url = GameUrl($row['id'], $row['seo_url'], $row['category_id']);
    $game = GameData($row, 'new');
    $name = shortenStr($row['name'], $template['module_max_chars']);
    if ($setting['module_thumbs'] == 1) {
        $image_url = GameImageUrl($row['image'], $row['import'], $row['url']);
        $image = '<img src="' . $image_url . '" class="newgamesBOXIMG" alt="" /> ';
    } else {
        $image = '';
    }
    $toolnip = '<div class=\'tooltipBOX_HORIZON\'><div style=\'float:left; width: 200px; padding: 10px 0 0 0px;\'>
	         <img class=\'BOXGAMESTIP_IMG\' src=\'' . $image_url . '\' alt=\'\' /><br />
	         <span class=\'tooltipBOX_title\'>' . $name . '</span><br />
	         <span style=\'display:block; padding: 5px;\'>' . $game['description'] . '</span>
	         <span style=\'display: block; width: 100px; padding: 0px 0 0 50px;\'>
	         ' . $game['rating'] . '
	         </span>
	         <div style=\'float:left; width: 200px; margin: 10px 0 5px 0;\'><span style=\'font-weight:bold; color: #ff7800;\'>' . $game['plays'] . ' People Played</span> </div>
	         </div></div>';
    if (strlen($name) > 25) {
        $name = substr($row['name'], 0, 25) . '...';
    }
    echo '<li>
	<a href="' . $url . '" rel="tooltip" title="' . $toolnip . '">
	' . $image . '<br />' . $name . '  
	</a>
	</li>';
}
示例#3
0
                            $sort = 'rating DESC';
                        } else {
                            if ($_GET['sortby'] == 'plays') {
                                $sort = 'hits DESC';
                            } else {
                                if ($_GET['sortby'] == 'highscores') {
                                    $sort = 'highscores DESC';
                                } else {
                                    $sort = 'id DESC';
                                }
                            }
                        }
                    }
                }
            }
        }
    } else {
        $sort = 'id DESC';
    }
    $sql = mysql_query("SELECT * FROM ava_games WHERE {$where} published=1 ORDER BY {$sort} LIMIT {$from}, {$template['games_per_page']}");
    while ($row = mysql_fetch_array($sql)) {
        $therow = $therow + 1;
        $game = GameData($row, 'category');
        include '.' . $setting['template_url'] . '/' . $template['category_game'];
        if ($therow == $template['category_columns']) {
            $therow = 0;
        }
    }
} else {
    echo '<div id="no_games">' . CATEGORY_NO_GAMES . '</div>';
}
示例#4
0
<?php

defined('AVARCADE_') or die('');
$sqla = mysql_query("SELECT * FROM ava_games WHERE submitter={$id}");
$count = mysql_num_rows($sqla);
if ($count >= 1) {
    while ($row = mysql_fetch_array($sqla)) {
        $game = GameData($row, 'random');
        include '.' . $setting['template_url'] . '/' . $template['submitted_game'];
    }
} else {
    echo NO_SUBMITTED_GAMES;
}
示例#5
0
<?php

defined('AVARCADE_') or die('');
if ($setting['homepage_order'] == 'random') {
    $order = "rand()";
} else {
    if ($setting['homepage_order'] == 'newest') {
        $order = "id DESC";
    } else {
        $order = "rating DESC";
    }
}
$category_games = mysql_query("SELECT * FROM ava_games WHERE (category_id = {$row['id']} OR category_parent = {$row['id']}) AND published=1 ORDER BY {$order} LIMIT " . $template['homepage_game_limit'] . "");
while ($cat_games = mysql_fetch_array($category_games)) {
    $game = GameData($cat_games, 'homepage');
    include '.' . $setting['template_url'] . '/' . $template['home_game'];
}
    }
} else {
    // Game not found
    header("HTTP/1.0 404 Not Found");
    include 'includes/misc/404.php';
    exit;
}
if (isset($_GET['name'])) {
    $sql = mysql_query("SELECT * FROM ava_games WHERE seo_url = '{$seo_url}'");
} else {
    $sql = mysql_query("SELECT * FROM ava_games WHERE id = {$id}");
}
$row2 = mysql_fetch_array($sql);
$id = $row2['id'];
// Define 'game_info' array for usage in the view game template
$game = GameData($row2, 'view_game');
// Detect the right fullscreen mode
$game['full_screen'] = 1;
if ($row2['filetype'] == 'swf' && $setting['fullscreen_mode'] == 1) {
    $game['full_screen_url'] = '#" onclick="ResizeFlash(' . $row2['height'] . ', ' . $row2['width'] . '); return false';
} else {
    if ($row2['filetype'] == 'unity' || $row2['filetype'] == 'unity3d' || $row2['filetype'] == 'code') {
        $game['full_screen_url'] = '#';
        $game['full_screen'] = 0;
    } else {
        $game['full_screen_url'] = $setting['site_url'] . '/full_screen.php?id=' . $id;
    }
}
// Favourite game button
if ($user['login_status'] == 1) {
    $user_fav_yet = mysql_result(mysql_query("SELECT COUNT(*) as Num FROM ava_favourites WHERE user_id='{$user['id']}' AND game_id='{$id}'"), 0);
示例#7
0
<?php

defined('AVARCADE_') or die('');
$q = mysql_query("SELECT favourites from ava_users WHERE id={$id}");
$favs = mysql_fetch_array($q);
if ($favs['favourites'] == '') {
    echo PROFILE_NO_FAVS;
} else {
    $favourites = substr($favs['favourites'], 2);
    $q2 = mysql_query("SELECT * from ava_games WHERE id IN ({$favourites}) AND published = 1");
    while ($games = mysql_fetch_array($q2)) {
        $game = GameData($games, 'favourite');
        // Include the template for favourite games
        include '.' . $setting['template_url'] . '/' . $template['favourite_game'];
    }
}
示例#8
0
<?php

defined('AVARCADE_') or die('');
$cat_numb = mysql_result(mysql_query("SELECT COUNT(*) as Num FROM ava_games WHERE published=1"), 0);
if ($cat_numb > 0) {
    //$from = (($page * $template['games_per_page']) - $template['games_per_page']);
    $sort = 'id DESC';
    $sql = mysql_query("SELECT * FROM ava_games WHERE published=1 ORDER BY {$sort} LIMIT 0, {$template['games_per_page']}");
    //$row = mysql_fetch_array($sql);
    while ($row = mysql_fetch_array($sql)) {
        //echo $row['id'] . '<br/>';
        $game = GameData($row, 'homepage');
        include '.' . $setting['template_url'] . '/' . $template['all_game'];
    }
} else {
    echo '<div id="no_games">' . CATEGORY_NO_GAMES . '</div>';
}