Файл: system/modules/batl.php
Строк: 23
<?php
if(!defined('MOZG'))
die('Hacking attempt!');
$metatags['title'] = 'Фото битвы';
$act = $_GET['act'];
if($_GET['page'] > 0) $page = intval($_GET['page']); else $page = 1;
$gcount = 20;
$limit_page = ($page-1)*$gcount;
switch($act){
case "add":
break;
default:
$user_id = $user_info['user_id'];
$id = intval($_GET['id']);
$tpl->load_template('batl/batl.tpl');
$sql_ = $db->super_query("SELECT * FROM " . PREFIX . "_voting WHERE `id` ORDER by `date` DESC LIMIT {$limit_page}, {$gcount}", 1);
if($sql_) {
foreach ($sql_ as $row){
$sql_bat = $db->super_query("SELECT tb1.two, tb2.user_search_pref, user_last_visit, user_photo FROM `".PREFIX."_voting` tb1, `".PREFIX."_users` tb2 WHERE tb1.one AND tb1.one = tb2.user_id ");
$tpl->set('{title}', $row['title']);
$tpl->set('{one}',$row['one']);
$tpl->set('{two}',$row['two']);
$tpl->set ('{img_one}',$row['img_one']);
$tpl->set ('{img_two}',$row['img_two']);
$tpl->set ('{link}',$row['alt_title']);
$tpl->set ('{id}',$row['id']);
$tpl->compile ('content');
}
}else{
$tpl->load_template('batl/batl_no.tpl');
$tpl->compile ('content');
}
}
$tpl->clear();
?>