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. # # Module Name [name] Top album posters this week [/name] # Module Directory Name [short_name] Top_album_posters_this_week [/short_name] # your name [author] Wicher [/author] # your email [email] --- [/email] # your webpage url [url] http://www.detecties.com/phpbb2018 [/url] # module version [version] 1.0.3 [/version] # required minimum Statistics Mod Version [stats_mod_version] 4.1.6 [/stats_mod_version] # default update time [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 top album posters this week. Anonymous Poster are not counted. [/extra_info]ÌÌÿINFOÿÌÌÿüÌLANGÌüÿÌÌÿLANGÿÌÌÿüÌMODÌüÿstart_module(true); $core->set_content('bars'); $core->set_view('rows', $core->return_limit); $core->set_view('columns', 5); $core->define_view('set_columns', array( $core->pre_defined('rank'), 'username' => $lang['Username'], 'posts' => $lang['Posts'], $core->pre_defined('percent'), $core->pre_defined('graph')) ); $content->percentage_sign = TRUE; $current_time = 0; $minutes = array(); $hour_now = 0; $dato = 0; $time_today = 0; $time_thisweek = 0; $current_time = time(); $minutes = date('is', $current_time); $hour_now = $current_time - (60*(intval($minutes[0]).intval($minutes[1]))) - (intval($minutes[2]).intval($minutes[3])); $dato = date('H', $current_time); $time_today = $hour_now - (3600 * intval($dato)); $time_thisweek = $time_today - ((date('w', $time_today)-1) * 86400); //$l_this_day = create_date('D', $time_today, $board_config['board_timezone']); //$l_this_week = create_date('D', $time_thisweek, $board_config['board_timezone']); $l_this_day = date('D', $time_today); $l_this_week = date('D', $time_thisweek); $core->set_header($lang['module_name'] . ' [' . $l_this_week . ' - ' . $l_this_day . ']'); $core->assign_defined_view('align_rows', array( 'left', 'left', 'center', 'center', 'left') ); // check if mod installed $sql = "SELECT pic_user_id, pic_username, pic_time, pic_user_id, pic_cat_id FROM " . ALBUM_TABLE; if (!$result = $db->sql_query($sql)) { $there=0; } else { $there=1; } if ($there == 0) { message_die(GENERAL_MESSAGE, 'This module requires Smartor Photo Album (http://smartor.is-root.com/viewforum.php?f=7) or Full Album Pack 1.4.0 (http://www.mightygorgon.com/viewtopic.php?t=3661) to be installed.'); } // total pics this month $sql = "SELECT COUNT(p.pic_id) AS count FROM " . ALBUM_CAT_TABLE . " AS c LEFT JOIN " . ALBUM_TABLE . " AS p ON c.cat_id = p.pic_cat_id WHERE (p.pic_time > '" . intval($time_thisweek) . "') AND (p.pic_user_id <> " . ANONYMOUS . ")"; if (!$result = $db->sql_query($sql)) { message_die(GENERAL_ERROR, "Couldn't get total number of pictures for all categories and sub categories", "", __LINE__, __FILE__, $sql); } $row = $db->sql_fetchrow($result); $db->sql_freeresult($result); $totalpics = intval($row['count']); // top posters $sql = "SELECT DISTINCT count(p.pic_user_id) AS post_count, p.pic_user_id, p.pic_username FROM " . ALBUM_CAT_TABLE . " AS c LEFT JOIN " . ALBUM_TABLE . " AS p ON c.cat_id = p.pic_cat_id WHERE (p.pic_time > '" . intval($time_thisweek) . "') AND (p.pic_user_id <> " . ANONYMOUS . ") GROUP BY p.pic_user_id ORDER BY post_count DESC LIMIT " . $core->return_limit; if (!$result = $db->sql_query($sql)) { message_die(GENERAL_ERROR, "Couldn't get total number of pictures for all categories and sub categories", "", __LINE__, __FILE__, $sql); } $topposters = $core->sql_fetchrowset($result); $db->sql_freeresult($result); $content->init_math('post_count', $topposters[0]['post_count'], $totalpics); $core->set_data($topposters); $core->define_view('set_rows', array( '$core->pre_defined()', '$core->generate_link(append_sid($phpbb_root_path . \'profile.php?mode=viewprofile&u=\' . $core->data(\'pic_user_id\')), $core->data(\'pic_username\'), \'target="_blank"\')', '$core->data(\'post_count\')', '$core->pre_defined()', '$core->pre_defined()') ); $core->run_module(); ?>ÌÌÿMODÿÌÌ