本文整理汇总了PHP中p_master::is_active方法的典型用法代码示例。如果您正苦于以下问题:PHP p_master::is_active方法的具体用法?PHP p_master::is_active怎么用?PHP p_master::is_active使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类p_master
的用法示例。
在下文中一共展示了p_master::is_active方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: redirect
}
// We use this approach because it does not impose large code changes
if (!$default) {
return true;
}
// Only registered users can go beyond this point
if (!$user->data['is_registered']) {
if ($user->data['is_bot']) {
redirect(append_sid("{$phpbb_root_path}index.{$phpEx}"));
}
login_box('', $user->lang['LOGIN_EXPLAIN_UCP']);
}
// Instantiate module system and generate list of available modules
$module->list_modules('ucp');
// Check if the zebra module is set
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);
示例2: unset
if ($group_row['group_rank']) {
$user_rank_data = phpbb_get_user_rank($group_row, false);
if ($user_rank_data['img']) {
$user_rank_data['img'] .= '<br />';
}
}
// include modules for manage groups link display or not
// need to ensure the module is active
$can_manage_group = false;
if ($user->data['is_registered'] && $group_row['group_leader']) {
if (!class_exists('p_master')) {
include $phpbb_root_path . 'includes/functions_module.' . $phpEx;
}
$module = new p_master();
$module->list_modules('ucp');
if ($module->is_active('ucp_groups', 'manage')) {
$can_manage_group = true;
}
unset($module);
}
$template->assign_vars(array('GROUP_DESC' => generate_text_for_display($group_row['group_desc'], $group_row['group_desc_uid'], $group_row['group_desc_bitfield'], $group_row['group_desc_options']), 'GROUP_NAME' => $group_row['group_type'] == GROUP_SPECIAL ? $user->lang['G_' . $group_row['group_name']] : $group_row['group_name'], 'GROUP_COLOR' => $group_row['group_colour'], 'GROUP_TYPE' => $user->lang['GROUP_IS_' . $group_row['l_group_type']], 'GROUP_RANK' => $user_rank_data['title'], 'AVATAR_IMG' => $avatar_img, 'RANK_IMG' => $user_rank_data['img'], 'RANK_IMG_SRC' => $user_rank_data['img_src'], 'U_PM' => $auth->acl_get('u_sendpm') && $auth->acl_get('u_masspm_group') && $group_row['group_receive_pm'] && $config['allow_privmsg'] && $config['allow_mass_pm'] ? append_sid("{$phpbb_root_path}ucp.{$phpEx}", 'i=pm&mode=compose&g=' . $group_id) : '', 'U_MANAGE' => $can_manage_group ? append_sid("{$phpbb_root_path}ucp.{$phpEx}", 'i=ucp_groups&mode=manage') : false));
$sql_select = ', ug.group_leader';
$sql_from = ', ' . USER_GROUP_TABLE . ' ug ';
$order_by = 'ug.group_leader DESC, ';
$sql_where .= " AND ug.user_pending = 0 AND u.user_id = ug.user_id AND ug.group_id = {$group_id}";
$sql_where_data = " AND u.user_id = ug.user_id AND ug.group_id = {$group_id}";
}
// Sorting and order
if (!isset($sort_key_sql[$sort_key])) {
$sort_key = $default_key;
}