getData(); $votes = User::getBestVotes($webmasterid, 20, false); include("../chatadmin/xcrud/xcrud.php"); $xcrud = Xcrud::get_instance(); $table = 'chat_contest'; $xcrud->table($table); $xcrud->pass_var('webmasterid', $webmasterid); $xcrud->where('webmasterid =', $webmasterid); $xcrud->columns('date, username1, username2'); $xcrud->fields('date, username1, username2'); $xcrud->order_by ('id', 'desc'); //$xcrud->label(array('quitUrl' => 'Url where quit', 'showSmileys'=>'Show smileys')); //view, edit, remove, duplicate, add, csv, print, save_new, save_edit, save_return, return. $xcrud->hide_button('save_new'); $xcrud->hide_button('return'); $xcrud->unset_add(); //$xcrud->hide_button('save_return'); //$xcrud->unset_list(); //$xcrud->unset_csv(); $xcrud->unset_title(); $xcrud->unset_view(); $xcrud->unset_limitlist(); $xcrud->unset_numbers(); $xcrud->unset_print(); $xcrud->unset_sortable(); //$xcrud->relation('userid','chat_users','id', 'username', "webmasterid=$webmasterid"); //$xcrud->relation('user2id','chat_users','id', 'username', "webmasterid=$webmasterid"); $xcrud->label(array( 'username1'=>'Username who voted', 'username2'=>'Voted for', )); // $xcrud->emails_label(' email'); //$xcrud->show_primary_ai_column(true); ?>
The contest alows to chatters to vote for other chatter. Each chatter can only vote once. This option is useful if you want to organize a contest for instance. To allow an user to vote, go to roles, advanced. Guest users cannot vote.
| Username | points |
|---|---|
| =$vote->username?> | =$vote->total?> |