Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- /**
- * @package phpBB
- * @copyright (c) 2012 Geolim4
- * @license http://opensource.org/licenses/gpl-license.php GNU Public License
- */
- /**
- * @ignore
- */
- if (!defined('IN_PHPBB'))
- {
- exit;
- }
- /**
- * Only register the hook for admins pages, not normal pages.
- * acp_users_reports()
- * Generate List of (unread)report on the main ACP menu
- * @no param
- */
- function acp_users_reports()
- {
- global $template, $db, $user, $config, $phpbb_admin_path, $phpbb_root_path, $phpEx;
- if (!defined('MYSESS_REPORTS_TABLE'))
- {
- include($phpbb_root_path . 'includes/functions_my_sessions.' . $phpEx);
- }
- //$user->add_lang('mods/info_acp_my_sessions');
- $report_count = $report_unread = 0;
- $sql = $db->sql_build_query('SELECT', array(
- 'SELECT' => 'report_id, report_read',
- 'FROM' => array(MYSESS_REPORTS_TABLE => ''),
- 'WHERE' => 'report_id > 0',
- ));
- $result = $db->sql_query($sql);
- while ( $reports_row = $db->sql_fetchrow($result) )
- {
- $report_count++;
- if ($reports_row['report_read'] == 0)
- {
- $report_unread++;
- }
- }
- $db->sql_freeresult($result);
- $template->assign_vars(array(
- 'S_REPORT_ACP' => ( (isset($config['ums_mod_enabled']) && isset($config['ums_report_acp']) ) && $config['ums_mod_enabled'] && $config['ums_report_acp'] ) ? true : false,
- 'U_REPORT_LINK' => append_sid("{$phpbb_admin_path}index.$phpEx", "i=my_sessions&mode=reports"),
- 'U_REPORT_UNREAD' => append_sid("{$phpbb_admin_path}index.$phpEx", "i=my_sessions&mode=reports&sel_sort=su&go_sort=1"),
- 'REPORTS_COUNT' => ($report_count >= 1) ? $user->lang('UMS_REPORT_ACP_COUNT', $report_count) : $user->lang('UMS_REPORT_ACP_COUNTS', $report_count),
- 'REPORTS_UNREAD' => ($report_unread >= 1) ? $user->lang('UMS_REPORT_ACP_UNREAD', $report_unread) : $user->lang('UMS_REPORT_ACP_UNREADS', $report_unread),
- 'S_REPORTS_COUNT' => $report_count,
- 'S_REPORTS_UNREAD' => $report_unread,
- ));
- }
- if ( !defined('ADMIN_START') || !defined('UMIL_AUTO') )
- {
- global $config;
- if ( isset($config['ums_mod_enabled']) && $config['ums_mod_enabled'] && isset($config['ums_report_acp']) && $config['ums_report_acp'] )
- {
- // start hook
- $phpbb_hook->register(array('template', 'display'), 'acp_users_reports');
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement