HTML; echo ""; echo <<
Главное меню
HTML; opentable(); tableheader($lang_repa['repa_cntrl']); echo << HTML; $query_count = "SELECT COUNT(*) as count from " . USERPREFIX . "_reputation"; $result_count = $db->super_query($query_count); if ($result_count['count'] == 0) echo "

{$lang_repa['repa_nothing']}


"; else { $all_count_results = $result_count['count']; $N = 30; if ( isset($_GET['page']) ) { $page = intval($_GET['page']); if ( $page < 1 ) $page = 1; } else { $page = 1; } $cnt_pages = ceil( $result_count['count'] / $N ); if ( $page > $cnt_pages ) $page = $cnt_pages; $start = ( $page - 1 ) * $N; $query = $db->query("SELECT * FROM `" . USERPREFIX . "_reputation` ORDER BY `date` DESC LIMIT $start, $N"); if ( $cnt_pages > 1 ) { echo '
 '.$lang_repa['repa_pages']; if ( $page > 3 ) $startpage = '<< ... '; else $startpage = ''; if ( $page < ($cnt_pages - 2) ) $endpage = ' ... >>'; else $endpage = ''; if ( $page - 2 > 0 ) $page2left = ' '.($page - 2).''; else $page2left = ''; if ( $page - 1 > 0 ) $page1left = ' '.($page - 1).' '; else $page1left = ''; if ( $page + 2 <= $cnt_pages ) $page2right = ' '.($page + 2).' '; else $page2right = ''; if ( $page + 1 <= $cnt_pages ) $page1right = ' '.($page + 1).' '; else $page1right = ''; echo $startpage.$page2left.$page1left.''.$page.''.$page1right.$page2right.$endpage."\n"; echo '
'; echo '
'.$lang_repa['r_total'].' '. $result_count['count'].'
'; } while ($row = $db->get_row()) { $res_id = $row['id']; if ($row['how'] > 0) $how = "\"{$lang_repa['repa_how_pl']}\""; if ($row['how'] < 0) $how = "\"{$lang_repa['repa_how_mn']}\""; if ($row['how'] == "totalminus") $how = "\"{$lang_repa['repa_how_tm']}\""; if ($row['how'] == "totalplus") $how = "\"{$lang_repa['repa_how_tm']}\""; $results .= " ".$row[author]."   ".$row[komu]." $row[date] $how $row[text] "; } $db->free(); echo << {$lang_repa['repa_who']} {$lang_repa['repa_to']} Дата {$lang_repa['repa_supp']} {$lang_repa['repa_commst']} {$lang_repa[vote_action]}
{$results} HTML; } closetable(); echofooter(); closetable(); ?>