break; case 'split': case 'merge': $module->set_active('main', 'topic_view'); break; default: trigger_error("{$action} not allowed as quickmod", E_USER_ERROR); break; } } else { // Select the active module $module->set_active($id, $mode); } // Hide some of the options if we don't have the relevant information to use them if (!$post_id) { $module->set_display('main', 'post_details', false); $module->set_display('warn', 'warn_post', false); } if ($mode == '' || $mode == 'unapproved_topics' || $mode == 'unapproved_posts') { $module->set_display('queue', 'approve_details', false); } if ($mode == '' || $mode == 'reports' || $mode == 'reports_closed' || $mode == 'pm_reports' || $mode == 'pm_reports_closed' || $mode == 'pm_report_details') { $module->set_display('reports', 'report_details', false); } if ($mode == '' || $mode == 'reports' || $mode == 'reports_closed' || $mode == 'pm_reports' || $mode == 'pm_reports_closed' || $mode == 'report_details') { $module->set_display('pm_reports', 'pm_report_details', false); } if (!$topic_id) { $module->set_display('main', 'topic_view', false); $module->set_display('logs', 'topic_logs', false); }
if ($module->is_active('zebra', 'friends')) { // Output listing of friends online $update_time = $config['load_online_time'] * 60; $sql = $db->sql_build_query('SELECT_DISTINCT', array('SELECT' => 'u.user_id, u.username, u.username_clean, u.user_colour, MAX(s.session_time) as online_time, MIN(s.session_viewonline) AS viewonline', 'FROM' => array(USERS_TABLE => 'u', ZEBRA_TABLE => 'z'), 'LEFT_JOIN' => array(array('FROM' => array(SESSIONS_TABLE => 's'), 'ON' => 's.session_user_id = z.zebra_id')), 'WHERE' => 'z.user_id = ' . $user->data['user_id'] . ' AND z.friend = 1 AND u.user_id = z.zebra_id', 'GROUP_BY' => 'z.zebra_id, u.user_id, u.username_clean, u.user_colour, u.username', 'ORDER_BY' => 'u.username_clean ASC')); $result = $db->sql_query($sql); while ($row = $db->sql_fetchrow($result)) { $which = time() - $update_time < $row['online_time'] && ($row['viewonline'] || $auth->acl_get('u_viewonline')) ? 'online' : 'offline'; $template->assign_block_vars("friends_{$which}", array('USER_ID' => $row['user_id'], 'U_PROFILE' => get_username_string('profile', $row['user_id'], $row['username'], $row['user_colour']), 'USER_COLOUR' => get_username_string('colour', $row['user_id'], $row['username'], $row['user_colour']), 'USERNAME' => get_username_string('username', $row['user_id'], $row['username'], $row['user_colour']), 'USERNAME_FULL' => get_username_string('full', $row['user_id'], $row['username'], $row['user_colour']))); } $db->sql_freeresult($result); } // Do not display subscribed topics/forums if not allowed if (!$config['allow_topic_notify'] && !$config['allow_forum_notify']) { $module->set_display('main', 'subscribed', false); } // Select the active module $module->set_active($id, $mode); // Load and execute the relevant module $module->load_active(); // Assign data to the template engine for the list of modules $module->assign_tpl_vars(append_sid("{$phpbb_root_path}ucp.{$phpEx}")); // Generate the page, do not display/query online list $module->display($module->get_page_title(), false); /** * Function for assigning a template var if the zebra module got included */ function _module_zebra($mode, &$module_row) { global $template;
if ($module->is_active('zebra', 'friends')) { // Output listing of friends online $update_time = $config['load_online_time'] * 60; $sql = $db->sql_build_query('SELECT_DISTINCT', array('SELECT' => 'u.user_id, u.username, u.username_clean, u.user_colour, MAX(s.session_time) as online_time, MIN(s.session_viewonline) AS viewonline', 'FROM' => array(USERS_TABLE => 'u', ZEBRA_TABLE => 'z'), 'LEFT_JOIN' => array(array('FROM' => array(SESSIONS_TABLE => 's'), 'ON' => 's.session_user_id = z.zebra_id')), 'WHERE' => 'z.user_id = ' . $user->data['user_id'] . ' AND z.friend = 1 AND u.user_id = z.zebra_id', 'GROUP_BY' => 'z.zebra_id, u.user_id, u.username_clean, u.user_colour, u.username', 'ORDER_BY' => 'u.username_clean ASC')); $result = $db->sql_query($sql); while ($row = $db->sql_fetchrow($result)) { $which = time() - $update_time < $row['online_time'] && ($row['viewonline'] || $auth->acl_get('u_viewonline')) ? 'online' : 'offline'; $template->assign_block_vars("friends_{$which}", array('USER_ID' => $row['user_id'], 'U_PROFILE' => get_username_string('profile', $row['user_id'], $row['username'], $row['user_colour']), 'USER_COLOUR' => get_username_string('colour', $row['user_id'], $row['username'], $row['user_colour']), 'USERNAME' => get_username_string('username', $row['user_id'], $row['username'], $row['user_colour']), 'USERNAME_FULL' => get_username_string('full', $row['user_id'], $row['username'], $row['user_colour']))); } $db->sql_freeresult($result); } // Do not display subscribed topics/forums if not allowed if (!$config['allow_topic_notify'] && !$config['allow_forum_notify']) { $module->set_display('main', 'subscribed', false); } // Do not display signature panel if not authed to do so if (!$auth->acl_get('u_sig')) { $module->set_display('profile', 'signature', false); } // Select the active module $module->set_active($id, $mode); // Load and execute the relevant module $module->load_active(); // Assign data to the template engine for the list of modules $module->assign_tpl_vars(append_sid("{$phpbb_root_path}ucp.{$phpEx}")); // Generate the page, do not display/query online list $module->display($module->get_page_title(), false); /** * Function for assigning a template var if the zebra module got included