<?php
Class Controller_topvotes Extends Controller_Base {
function index() {
$sort = 'votes DESC';
$order = !empty($_SESSION['topv_order'])?$_SESSION['topv_order']:'votes DESC';
$params_arr = Array('country', 'votes');
if(isset($this->args[0]) AND in_array($this->args[0], $params_arr)){
$sort = $this->args[0];
if($sort == $order){
$order = $sort.' DESC';
}else{
$order = $sort;
}
}
$_SESSION['topv_order'] = $order;
try{
$chars = Chars::me()->get_topvotes($order);
$this->des->set('chars',$chars);
}catch(Exception $e){
$this->error($e->getMessage());
}
$this->des->set('title', 'Top Votes');
$this->des->display('topvotes');
}
}
?>