3.0.0MPAKÿüÌINFOÌüÿ# # This file contains Installation Informations. # This file does not include Installation Instructions for the normal User. # Please do not edit this file if you are not the Module Author. # # Please read the provided install.txt for Informations on how to install this Module. # # Module Name [name] Most Active Polls [/name] # Module Directory Name [short_name] most_active_polls [/short_name] # your name [author] Wicher Fost [/author] # your email [email] n/a [/email] # your webpage url [url] http://www.detecties.com/phpbb2018 http://www.moonpod.com/ [/url] # module version [version] 4.1.5 [/version] # required minimum Statistics Mod Version [stats_mod_version] 3.0.1beta3s [/stats_mod_version] # default update time // Leave this at 0 for this module. [update_time] 0 [/update_time] [check_update_site] http://www.detecties.com/phpbb2018 [/check_update_site] # extra info for the user [extra_info] This Module displays the most active polls (by votes not posts) at your board. [/extra_info] ÌÌÿINFOÿÌÌÿüÌLANGÌüÿÌÌÿLANGÿÌÌÿüÌMODÌüÿstart_module(true); $core->set_content('statistical'); $core->set_view('rows', $core->return_limit); $core->set_view('columns', 3); $core->define_view('set_columns', array( $core->pre_defined('rank'), 'votes' => $lang['Total_votes'], 'topic' => $lang['Topic']) ); $core->set_header($lang['module_name']); $core->assign_defined_view('align_rows', array( 'left', 'center', 'left') ); $core->assign_defined_view('width_rows', array( '', '20%', '') ); $current_time = time(); if ( $userdata['session_logged_in'] ) { if ($userdata['user_level'] == ADMIN) { $sql = 'SELECT SUM(a.vote_result) AS num_votes, b.topic_id, t.forum_id, t.topic_title FROM ' . VOTE_RESULTS_TABLE . ' a, ' . VOTE_DESC_TABLE . ' b, ' . TOPICS_TABLE . ' t WHERE a.vote_id = b.vote_id AND b.topic_id = t.topic_id GROUP BY a.vote_id ORDER BY num_votes DESC LIMIT ' . $core->return_limit; } else if ($userdata['user_level'] == MOD) { $sql = 'SELECT SUM(a.vote_result) AS num_votes, b.topic_id, t.forum_id, t.topic_title FROM ' . VOTE_RESULTS_TABLE . ' a, ' . VOTE_DESC_TABLE . ' b, ' . TOPICS_TABLE . ' t, ' . FORUMS_TABLE . ' f WHERE (t.forum_id = f.forum_id) AND (t.topic_id = b.topic_id) AND (t.topic_status <> 2) AND (t.topic_time < '.$current_time.') AND (f.auth_view <> 2) AND (f.auth_read <> 2) AND (a.vote_id = b.vote_id) GROUP BY a.vote_id ORDER BY num_votes DESC LIMIT ' . $core->return_limit; } else if (($userdata['user_level'] != ADMIN)or($userdata['user_level'] != MOD)) { $sql = 'SELECT SUM(a.vote_result) AS num_votes, b.topic_id, t.forum_id, t.topic_title FROM ' . VOTE_RESULTS_TABLE . ' a, ' . VOTE_DESC_TABLE . ' b, ' . TOPICS_TABLE . ' t, ' . FORUMS_TABLE . ' f WHERE (t.forum_id = f.forum_id) AND (t.topic_id = b.topic_id) AND (t.topic_status <> 2) AND (t.topic_time < '.$current_time.') AND (f.auth_view < 2) AND (f.auth_read < 2) AND (a.vote_id = b.vote_id) GROUP BY a.vote_id ORDER BY num_votes DESC LIMIT ' . $core->return_limit; } } else { $sql = 'SELECT SUM(a.vote_result) AS num_votes, b.topic_id, t.forum_id, t.topic_title FROM ' . FORUMS_TABLE . ' f, ' . TOPICS_TABLE . ' t, ' . VOTE_RESULTS_TABLE . ' a, ' . VOTE_DESC_TABLE . ' b WHERE (t.forum_id = f.forum_id) AND (t.topic_id = b.topic_id) AND (t.topic_status <> 2) AND (t.topic_time < '.$current_time.') AND (f.auth_view < 1) AND (f.auth_read < 1) AND (a.vote_id = b.vote_id) GROUP BY a.vote_id ORDER BY num_votes DESC LIMIT ' . $core->return_limit; } $result = $core->sql_query($sql, 'Couldn\'t retrieve topic data'); $poll_data = $core->sql_fetchrowset($result); $core->set_data($poll_data); // // Now this one could get a big beast // We will explain the structure, no fear, but not now. :D // $core->define_view('set_rows', array( '$core->pre_defined()', '$core->data(\'num_votes\')', '$core->generate_link(append_sid($phpbb_root_path . \'viewtopic.php?t=\' . $core->data(\'topic_id\')), $core->data(\'topic_title\'), \'target="_blank"\')' )); $core->run_module(); ?>ÌÌÿMODÿÌÌ