Файл: system/modules/fotoreit.php
Строк: 44
<?php
/*
Appointment: Баланс
File: balance.php
*/
if(!defined('MOZG'))
die('Hacking attempt!');
if($ajax == 'yes')
NoAjaxQuery();
$user_id = $user_info['user_id'];
if($logged){
$metatags['title'] = 'Оценки фотографий';
$limit_rate =1000;
$page_cnt = intval($_POST['page_cnt'])*$limit_rate;
$bc = intval($_POST['bc']);
$sql_rate = $db->super_query("SELECT tb1.author_eval_user_id, tb1.id, tb1.eval, tb1.date, tb2.user_name, tb2.user_lastname, tb2.user_photo FROM `".PREFIX."_photos_eval` tb1, `".PREFIX."_users` tb2 WHERE tb1.author_eval_user_id = tb2.user_id ORDER BY date DESC LIMIT {$page_cnt},{$limit_rate}",1);
$tpl->load_template('photo_view_rating2.tpl');
$tpl->set('{id}', $bc);
if($sql_rate){
$c = 0;
foreach($sql_rate as $sql_list){
if($sql_list['user_photo']){
$ava = '/uploads/users/'.$sql_list['author_eval_user_id'].'/50_'.$sql_list['user_photo'];
}else{
$ava = 'templates/Default/images/no_ava_50.png';
}
if($sql_list['eval']==1) $back = '3';
elseif($sql_list['eval']==6) $back = '5';
else $back = '33';
if($sql_list['eval'] == 6) $eval = '5+';
else $eval = $sql_list['eval'];
$temp_list.='
<div class="rate_block" id="rate_block'.$sql_list['id'].'">
<a href="/profile/'.$sql_list['author_eval_user_id'].'" onClick="Page.Go(this.href); return false"><img src="'.$ava.'" width="50" height="50" /></a>
<a href="/profile/'.$sql_list['author_eval_user_id'].'" onClick="Page.Go(this.href); return false"><b>'.$sql_list['user_name'].' '.$sql_list['user_lastname'].'</b></a>
<div class="profile_ratingview" style="margin: 5px 10px 0px 0px"><div class="rating '.$back.'" style="margin: 0px 0px 0px 0px">'.$eval.'</div></div>
<div class="rate_date">'.megaDateNoTpl($sql_list['date']).'</div>
</div>'."n";
$c++;
}
if($c > 5 and !$_POST['page_cnt']){
$tpl->set('{users}', $temp_list);
$tpl->set('[prev]', '');
$tpl->set('[/prev]', '');
$tpl->compile('content');
} else if($c < 5 and !$_POST['page_cnt']){
$tpl->set('{users}', $temp_list);
$tpl->set_block("'\[prev\](.*?)\[/prev\]'si","");
$tpl->compile('content');
}
} else {
$user_speedbar = 'Информация';
msgbox('', 'У вас еще нет оценок', 'info');
}
if(isset($_POST['page_cnt'])) {
echo $temp_list;
}
} else {
$user_speedbar = $lang['no_infooo'];
msgbox('', $lang['not_logged'], 'info');
}
?>