当前位置: 首页>>代码示例>>PHP>>正文


PHP display_user_activity函数代码示例

本文整理汇总了PHP中display_user_activity函数的典型用法代码示例。如果您正苦于以下问题:PHP display_user_activity函数的具体用法?PHP display_user_activity怎么用?PHP display_user_activity使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了display_user_activity函数的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: MAX

        $row = $db->sql_fetchrow($result);
        $foe = $row['foe'] ? true : false;
        $friend = $row['friend'] ? true : false;
        $db->sql_freeresult($result);
        if ($config['load_onlinetrack']) {
            $sql = 'SELECT MAX(session_time) AS session_time, MIN(session_viewonline) AS session_viewonline
				FROM ' . SESSIONS_TABLE . "\n\t\t\t\tWHERE session_user_id = {$user_id}";
            $result = $db->sql_query($sql);
            $row = $db->sql_fetchrow($result);
            $db->sql_freeresult($result);
            $member['session_time'] = isset($row['session_time']) ? $row['session_time'] : 0;
            $member['session_viewonline'] = isset($row['session_viewonline']) ? $row['session_viewonline'] : 0;
            unset($row);
        }
        if ($config['load_user_activity']) {
            display_user_activity($member);
        }
        // Do the relevant calculations
        $memberdays = max(1, round((time() - $member['user_regdate']) / 86400));
        $posts_per_day = $member['user_posts'] / $memberdays;
        $percentage = $config['num_posts'] ? min(100, $member['user_posts'] / $config['num_posts'] * 100) : 0;
        if ($member['user_sig']) {
            $member['user_sig'] = censor_text($member['user_sig']);
            if ($member['user_sig_bbcode_bitfield']) {
                include_once $phpbb_root_path . 'includes/bbcode.' . $phpEx;
                $bbcode = new bbcode();
                $bbcode->bbcode_second_pass($member['user_sig'], $member['user_sig_bbcode_uid'], $member['user_sig_bbcode_bitfield']);
            }
            $member['user_sig'] = bbcode_nl2br($member['user_sig']);
            $member['user_sig'] = smiley_text($member['user_sig']);
        }
开发者ID:html,项目名称:PI,代码行数:31,代码来源:memberlist.php

示例2: get_user_info_func

function get_user_info_func($xmlrpc_params)
{
    global $db, $user, $auth, $template, $config, $phpbb_root_path, $phpEx, $table_prefix;
    $user->setup(array('memberlist', 'groups'));
    if (!$auth->acl_gets('u_viewprofile', 'a_user', 'a_useradd', 'a_userdel')) {
        if ($user->data['user_id'] != ANONYMOUS) {
            trigger_error('NO_VIEW_USERS');
        }
        trigger_error('LOGIN_EXPLAIN_VIEWPROFILE');
    }
    $params = php_xmlrpc_decode($xmlrpc_params);
    $username = $params[0];
    if (isset($params[1]) && !empty($params[1])) {
        $user_id = $params[1];
    } elseif (isset($params[0]) && !empty($params[0])) {
        $username = $params[0];
        $user_id = get_user_id_by_name($username);
    } else {
        $user_id = $user->data['user_id'];
    }
    $user_id = intval($user_id);
    // Display a profile
    if (!$user_id) {
        trigger_error('NO_USER');
    }
    // Get user...
    $sql = 'SELECT *
        FROM ' . USERS_TABLE . "\r\r\n        WHERE user_id = '{$user_id}'";
    $result = $db->sql_query($sql);
    $member = $db->sql_fetchrow($result);
    $db->sql_freeresult($result);
    if (!$member) {
        trigger_error('NO_USER');
    }
    // a_user admins and founder are able to view inactive users and bots to be able to manage them more easily
    // Normal users are able to see at least users having only changed their profile settings but not yet reactivated.
    if (!$auth->acl_get('a_user') && $user->data['user_type'] != USER_FOUNDER) {
        if ($member['user_type'] == USER_IGNORE) {
            trigger_error('NO_USER');
        } else {
            if ($member['user_type'] == USER_INACTIVE && $member['user_inactive_reason'] != INACTIVE_PROFILE) {
                trigger_error('NO_USER');
            }
        }
    }
    $user_id = (int) $member['user_id'];
    // Do the SQL thang
    $sql = 'SELECT g.group_id, g.group_name, g.group_type
        FROM ' . GROUPS_TABLE . ' g, ' . USER_GROUP_TABLE . " ug\r\r\n        WHERE ug.user_id = {$user_id}\r\r\n            AND g.group_id = ug.group_id" . (!$auth->acl_gets('a_group', 'a_groupadd', 'a_groupdel') ? ' AND g.group_type <> ' . GROUP_HIDDEN : '') . '
            AND ug.user_pending = 0
        ORDER BY g.group_type, g.group_name';
    $result = $db->sql_query($sql);
    $group_options = '';
    while ($row = $db->sql_fetchrow($result)) {
        if ($row['group_type'] == GROUP_SPECIAL) {
            // Lookup group name in language dictionary
            if (isset($user->lang['G_' . $row['group_name']])) {
                $row['group_name'] = $user->lang['G_' . $row['group_name']];
            }
        } else {
            if (!$auth_hidden_groups && $row['group_type'] == GROUP_HIDDEN && !isset($user_groups[$row['group_id']])) {
                // Skip over hidden groups the user cannot see
                continue;
            }
        }
        $group_options .= $row['group_id'] == $member['group_id'] ? $row['group_name'] . " *\n" : $row['group_name'] . "\n";
    }
    $group_options = trim($group_options);
    $db->sql_freeresult($result);
    // What colour is the zebra
    $sql = 'SELECT friend, foe
        FROM ' . ZEBRA_TABLE . "\r\r\n        WHERE zebra_id = {$user_id}\r\r\n            AND user_id = {$user->data['user_id']}";
    $result = $db->sql_query($sql);
    $row = $db->sql_fetchrow($result);
    $foe = $row['foe'] ? true : false;
    $friend = $row['friend'] ? true : false;
    $db->sql_freeresult($result);
    if ($config['load_onlinetrack']) {
        if ($config['version'] < '3.0.3') {
            $sql = 'SELECT MAX(session_time) AS session_time, MIN(session_viewonline) AS session_viewonline, session_page
            FROM ' . SESSIONS_TABLE . "\r\r\n            WHERE session_user_id = {$user_id}\r\r\n            GROUP BY session_page\r\r\n            ORDER BY session_time DESC";
        } else {
            $sql = 'SELECT MAX(session_time) AS session_time, MIN(session_viewonline) AS session_viewonline, session_page, session_forum_id
            FROM ' . SESSIONS_TABLE . "\r\r\n            WHERE session_user_id = {$user_id}\r\r\n            GROUP BY session_page, session_forum_id\r\r\n            ORDER BY session_time DESC";
        }
        $result = $db->sql_query_limit($sql, 1);
        $row = $db->sql_fetchrow($result);
        $db->sql_freeresult($result);
        $member['session_time'] = isset($row['session_time']) ? $row['session_time'] : 0;
        $member['session_viewonline'] = isset($row['session_viewonline']) ? $row['session_viewonline'] : 0;
        $member['session_page'] = isset($row['session_page']) ? $row['session_page'] : 0;
        $member['session_forum_id'] = isset($row['session_forum_id']) ? $row['session_forum_id'] : 0;
        unset($row);
    }
    if ($config['load_user_activity']) {
        display_user_activity($member);
    }
    // Do the relevant calculations
    $memberdays = max(1, round((time() - $member['user_regdate']) / 86400));
    $posts_per_day = $member['user_posts'] / $memberdays;
//.........这里部分代码省略.........
开发者ID:danielgospodinow,项目名称:GamingZone,代码行数:101,代码来源:get_user_info.php

示例3: main

    function main($id, $mode)
    {
        global $config, $db, $user, $auth, $template, $phpbb_root_path, $phpEx;
        switch ($mode) {
            case 'front':
                $user->add_lang('memberlist');
                $sql_from = TOPICS_TABLE . ' t ';
                $sql_select = '';
                if ($config['load_db_track']) {
                    $sql_from .= ' LEFT JOIN ' . TOPICS_POSTED_TABLE . ' tp ON (tp.topic_id = t.topic_id
						AND tp.user_id = ' . $user->data['user_id'] . ')';
                    $sql_select .= ', tp.topic_posted';
                }
                if ($config['load_db_lastread']) {
                    $sql_from .= ' LEFT JOIN ' . TOPICS_TRACK_TABLE . ' tt ON (tt.topic_id = t.topic_id
						AND tt.user_id = ' . $user->data['user_id'] . ')';
                    $sql_select .= ', tt.mark_time';
                }
                $topic_type = $user->lang['VIEW_TOPIC_GLOBAL'];
                $folder = 'global_read';
                $folder_new = 'global_unread';
                // Get cleaned up list... return only those forums not having the f_read permission
                $forum_ary = $auth->acl_getf('!f_read', true);
                $forum_ary = array_unique(array_keys($forum_ary));
                // Determine first forum the user is able to read into - for global announcement link
                $sql = 'SELECT forum_id
					FROM ' . FORUMS_TABLE . '
					WHERE forum_type = ' . FORUM_POST;
                if (sizeof($forum_ary)) {
                    $sql .= ' AND ' . $db->sql_in_set('forum_id', $forum_ary, true);
                }
                $result = $db->sql_query_limit($sql, 1);
                $g_forum_id = (int) $db->sql_fetchfield('forum_id');
                $db->sql_freeresult($result);
                $sql = "SELECT t.* {$sql_select}\n\t\t\t\t\tFROM {$sql_from}\n\t\t\t\t\tWHERE t.forum_id = 0\n\t\t\t\t\t\tAND t.topic_type = " . POST_GLOBAL . '
					ORDER BY t.topic_last_post_time DESC';
                $topic_list = $rowset = array();
                // If the user can't see any forums, he can't read any posts because fid of 0 is invalid
                if ($g_forum_id) {
                    $result = $db->sql_query($sql);
                    while ($row = $db->sql_fetchrow($result)) {
                        $topic_list[] = $row['topic_id'];
                        $rowset[$row['topic_id']] = $row;
                    }
                    $db->sql_freeresult($result);
                }
                $topic_tracking_info = array();
                if ($config['load_db_lastread']) {
                    $topic_tracking_info = get_topic_tracking(0, $topic_list, $rowset, false, $topic_list);
                } else {
                    $topic_tracking_info = get_complete_topic_tracking(0, $topic_list, $topic_list);
                }
                foreach ($topic_list as $topic_id) {
                    $row =& $rowset[$topic_id];
                    $forum_id = $row['forum_id'];
                    $topic_id = $row['topic_id'];
                    $unread_topic = isset($topic_tracking_info[$topic_id]) && $row['topic_last_post_time'] > $topic_tracking_info[$topic_id] ? true : false;
                    $folder_img = $unread_topic ? $folder_new : $folder;
                    $folder_alt = $unread_topic ? 'NEW_POSTS' : ($row['topic_status'] == ITEM_LOCKED ? 'TOPIC_LOCKED' : 'NO_NEW_POSTS');
                    if ($row['topic_status'] == ITEM_LOCKED) {
                        $folder_img .= '_locked';
                    }
                    // Posted image?
                    if (!empty($row['topic_posted']) && $row['topic_posted']) {
                        $folder_img .= '_mine';
                    }
                    $template->assign_block_vars('topicrow', array('FORUM_ID' => $forum_id, 'TOPIC_ID' => $topic_id, 'TOPIC_AUTHOR' => get_username_string('username', $row['topic_poster'], $row['topic_first_poster_name'], $row['topic_first_poster_colour']), 'TOPIC_AUTHOR_COLOUR' => get_username_string('colour', $row['topic_poster'], $row['topic_first_poster_name'], $row['topic_first_poster_colour']), 'TOPIC_AUTHOR_FULL' => get_username_string('full', $row['topic_poster'], $row['topic_first_poster_name'], $row['topic_first_poster_colour']), 'FIRST_POST_TIME' => $user->format_date($row['topic_time']), 'LAST_POST_SUBJECT' => censor_text($row['topic_last_post_subject']), 'LAST_POST_TIME' => $user->format_date($row['topic_last_post_time']), 'LAST_VIEW_TIME' => $user->format_date($row['topic_last_view_time']), 'LAST_POST_AUTHOR' => get_username_string('username', $row['topic_last_poster_id'], $row['topic_last_poster_name'], $row['topic_last_poster_colour']), 'LAST_POST_AUTHOR_COLOUR' => get_username_string('colour', $row['topic_last_poster_id'], $row['topic_last_poster_name'], $row['topic_last_poster_colour']), 'LAST_POST_AUTHOR_FULL' => get_username_string('full', $row['topic_last_poster_id'], $row['topic_last_poster_name'], $row['topic_last_poster_colour']), 'TOPIC_TITLE' => censor_text($row['topic_title']), 'TOPIC_TYPE' => $topic_type, 'TOPIC_FOLDER_IMG' => $user->img($folder_img, $folder_alt), 'TOPIC_FOLDER_IMG_SRC' => $user->img($folder_img, $folder_alt, false, '', 'src'), 'ATTACH_ICON_IMG' => $auth->acl_get('u_download') && $auth->acl_get('f_download', $forum_id) && $row['topic_attachment'] ? $user->img('icon_topic_attach', '') : '', 'S_USER_POSTED' => !empty($row['topic_posted']) && $row['topic_posted'] ? true : false, 'S_UNREAD' => $unread_topic, 'U_TOPIC_AUTHOR' => get_username_string('profile', $row['topic_poster'], $row['topic_first_poster_name'], $row['topic_first_poster_colour']), 'U_LAST_POST' => append_sid("{$phpbb_root_path}viewtopic.{$phpEx}", "f={$g_forum_id}&amp;t={$topic_id}&amp;p=" . $row['topic_last_post_id']) . '#p' . $row['topic_last_post_id'], 'U_LAST_POST_AUTHOR' => get_username_string('profile', $row['topic_last_poster_id'], $row['topic_last_poster_name'], $row['topic_last_poster_colour']), 'U_NEWEST_POST' => append_sid("{$phpbb_root_path}viewtopic.{$phpEx}", "f={$g_forum_id}&amp;t={$topic_id}&amp;view=unread") . '#unread', 'U_VIEW_TOPIC' => append_sid("{$phpbb_root_path}viewtopic.{$phpEx}", "f={$g_forum_id}&amp;t={$topic_id}")));
                }
                if ($config['load_user_activity']) {
                    if (!function_exists('display_user_activity')) {
                        include_once $phpbb_root_path . 'includes/functions_display.' . $phpEx;
                    }
                    display_user_activity($user->data);
                }
                // Do the relevant calculations
                $memberdays = max(1, round((time() - $user->data['user_regdate']) / 86400));
                $posts_per_day = $user->data['user_posts'] / $memberdays;
                $percentage = $config['num_posts'] ? min(100, $user->data['user_posts'] / $config['num_posts'] * 100) : 0;
                $template->assign_vars(array('USER_COLOR' => !empty($user->data['user_colour']) ? $user->data['user_colour'] : '', 'JOINED' => $user->format_date($user->data['user_regdate']), 'VISITED' => empty($last_visit) ? ' - ' : $user->format_date($last_visit), 'WARNINGS' => $user->data['user_warnings'] ? $user->data['user_warnings'] : 0, 'POSTS' => $user->data['user_posts'] ? $user->data['user_posts'] : 0, 'POSTS_DAY' => sprintf($user->lang['POST_DAY'], $posts_per_day), 'POSTS_PCT' => sprintf($user->lang['POST_PCT'], $percentage), 'OCCUPATION' => !empty($row['user_occ']) ? $row['user_occ'] : '', 'INTERESTS' => !empty($row['user_interests']) ? $row['user_interests'] : '', 'U_SEARCH_USER' => $auth->acl_get('u_search') ? append_sid("{$phpbb_root_path}search.{$phpEx}", 'author_id=' . $user->data['user_id'] . '&amp;sr=posts') : ''));
                break;
            case 'subscribed':
                include $phpbb_root_path . 'includes/functions_display.' . $phpEx;
                $user->add_lang('viewforum');
                add_form_key('ucp_front_subscribed');
                $unwatch = isset($_POST['unwatch']) ? true : false;
                if ($unwatch) {
                    if (check_form_key('ucp_front_subscribed')) {
                        $forums = array_keys(request_var('f', array(0 => 0)));
                        $topics = array_keys(request_var('t', array(0 => 0)));
                        $msg = '';
                        if (sizeof($forums) || sizeof($topics)) {
                            $l_unwatch = '';
                            if (sizeof($forums)) {
                                $sql = 'DELETE FROM ' . FORUMS_WATCH_TABLE . '
									WHERE ' . $db->sql_in_set('forum_id', $forums) . '
										AND user_id = ' . $user->data['user_id'];
                                $db->sql_query($sql);
                                $l_unwatch .= '_FORUMS';
                            }
                            if (sizeof($topics)) {
//.........这里部分代码省略.........
开发者ID:jverkoey,项目名称:Three20-Scope,代码行数:101,代码来源:ucp_main.php

示例4: main

    function main($id, $mode)
    {
        global $config, $db, $user, $auth, $template, $phpbb_root_path, $phpEx;
        switch ($mode) {
            case 'front':
                $user->add_lang('memberlist');
                $sql_from = TOPICS_TABLE . ' t ';
                $sql_select = '';
                if ($config['load_db_track']) {
                    $sql_from .= ' LEFT JOIN ' . TOPICS_POSTED_TABLE . ' tp ON (tp.topic_id = t.topic_id 
						AND tp.user_id = ' . $user->data['user_id'] . ')';
                    $sql_select .= ', tp.topic_posted';
                }
                if ($config['load_db_lastread']) {
                    $sql_from .= ' LEFT JOIN ' . TOPICS_TRACK_TABLE . ' tt ON (tt.topic_id = t.topic_id
						AND tt.user_id = ' . $user->data['user_id'] . ')';
                    $sql_select .= ', tt.mark_time';
                }
                $topic_type = $user->lang['VIEW_TOPIC_ANNOUNCEMENT'];
                $folder = 'folder_announce';
                $folder_new = $folder . '_new';
                // Get cleaned up list... return only those forums not having the f_read permission
                $forum_ary = $auth->acl_getf('!f_read', true);
                $forum_ary = array_unique(array_keys($forum_ary));
                // Determine first forum the user is able to read into - for global announcement link
                $sql = 'SELECT forum_id 
					FROM ' . FORUMS_TABLE . '
					WHERE forum_type = ' . FORUM_POST;
                if (sizeof($forum_ary)) {
                    $sql .= ' AND forum_id NOT IN ( ' . implode(', ', $forum_ary) . ')';
                }
                $result = $db->sql_query_limit($sql, 1);
                $g_forum_id = (int) $db->sql_fetchfield('forum_id');
                $db->sql_freeresult($result);
                $sql = "SELECT t.* {$sql_select} \n\t\t\t\t\tFROM {$sql_from}\n\t\t\t\t\tWHERE t.forum_id = 0\n\t\t\t\t\t\tAND t.topic_type = " . POST_GLOBAL . '
					ORDER BY t.topic_last_post_time DESC';
                $result = $db->sql_query($sql);
                $topic_list = $rowset = array();
                while ($row = $db->sql_fetchrow($result)) {
                    $topic_list[] = $row['topic_id'];
                    $rowset[$row['topic_id']] = $row;
                }
                $db->sql_freeresult($result);
                $topic_tracking_info = array();
                if ($config['load_db_lastread']) {
                    $topic_tracking_info = get_topic_tracking(0, $topic_list, $rowset, false, $topic_list);
                } else {
                    $topic_tracking_info = get_complete_topic_tracking(0, $topic_list, $topic_list);
                }
                foreach ($topic_list as $topic_id) {
                    $row =& $rowset[$topic_id];
                    $forum_id = $row['forum_id'];
                    $topic_id = $row['topic_id'];
                    $unread_topic = isset($topic_tracking_info[$topic_id]) && $row['topic_last_post_time'] > $topic_tracking_info[$topic_id] ? true : false;
                    if ($row['topic_status'] == ITEM_LOCKED) {
                        $topic_type = $user->lang['VIEW_TOPIC_LOCKED'];
                        $folder = 'folder_locked';
                        $folder_new = 'folder_locked_new';
                    }
                    $folder_img = $unread_topic ? $folder_new : $folder;
                    $folder_alt = $unread_topic ? 'NEW_POSTS' : ($row['topic_status'] == ITEM_LOCKED ? 'TOPIC_LOCKED' : 'NO_NEW_POSTS');
                    // Posted image?
                    if (!empty($row['topic_posted']) && $row['topic_posted']) {
                        $folder_img .= '_posted';
                    }
                    $template->assign_block_vars('topicrow', array('FORUM_ID' => $forum_id, 'TOPIC_ID' => $topic_id, 'LAST_POST_TIME' => $user->format_date($row['topic_last_post_time']), 'LAST_POST_AUTHOR' => $row['topic_last_poster_id'] == ANONYMOUS ? $row['topic_last_poster_name'] != '' ? $row['topic_last_poster_name'] . ' ' : $user->lang['GUEST'] . ' ' : $row['topic_last_poster_name'], 'TOPIC_TITLE' => censor_text($row['topic_title']), 'TOPIC_TYPE' => $topic_type, 'LAST_POST_IMG' => $user->img('icon_post_latest', 'VIEW_LATEST_POST'), 'NEWEST_POST_IMG' => $user->img('icon_post_newest', 'VIEW_NEWEST_POST'), 'TOPIC_FOLDER_IMG' => $user->img($folder_img, $folder_alt), 'TOPIC_FOLDER_IMG_SRC' => $user->img($folder_img, $folder_alt, false, '', 'src'), 'ATTACH_ICON_IMG' => $auth->acl_gets('f_download', 'u_download', $forum_id) && $row['topic_attachment'] ? $user->img('icon_attach', '') : '', 'S_USER_POSTED' => !empty($row['topic_posted']) && $row['topic_posted'] ? true : false, 'S_UNREAD' => $unread_topic, 'U_LAST_POST' => append_sid("{$phpbb_root_path}viewtopic.{$phpEx}", "f={$g_forum_id}&amp;t={$topic_id}&amp;p=" . $row['topic_last_post_id']) . '#p' . $row['topic_last_post_id'], 'U_LAST_POST_AUTHOR' => $row['topic_last_poster_id'] != ANONYMOUS ? append_sid("{$phpbb_root_path}memberlist.{$phpEx}", 'mode=viewprofile&amp;u=' . $row['topic_last_poster_id']) : '', 'U_NEWEST_POST' => append_sid("{$phpbb_root_path}viewtopic.{$phpEx}", "f={$g_forum_id}&amp;t={$topic_id}&amp;view=unread") . '#unread', 'U_VIEW_TOPIC' => append_sid("{$phpbb_root_path}viewtopic.{$phpEx}", "f={$g_forum_id}&amp;t={$topic_id}")));
                }
                if ($config['load_user_activity']) {
                    if (!function_exists('display_user_activity')) {
                        include_once $phpbb_root_path . 'includes/functions_display.' . $phpEx;
                    }
                    display_user_activity($user->data);
                }
                // Do the relevant calculations
                $memberdays = max(1, round((time() - $user->data['user_regdate']) / 86400));
                $posts_per_day = $user->data['user_posts'] / $memberdays;
                $percentage = $config['num_posts'] ? min(100, $user->data['user_posts'] / $config['num_posts'] * 100) : 0;
                $template->assign_vars(array('USER_COLOR' => !empty($user->data['user_colour']) ? $user->data['user_colour'] : '', 'JOINED' => $user->format_date($user->data['user_regdate']), 'VISITED' => empty($last_visit) ? ' - ' : $user->format_date($last_visit), 'WARNINGS' => $user->data['user_warnings'] ? $user->data['user_warnings'] : 0, 'POSTS' => $user->data['user_posts'] ? $user->data['user_posts'] : 0, 'POSTS_DAY' => sprintf($user->lang['POST_DAY'], $posts_per_day), 'POSTS_PCT' => sprintf($user->lang['POST_PCT'], $percentage), 'OCCUPATION' => !empty($row['user_occ']) ? $row['user_occ'] : '', 'INTERESTS' => !empty($row['user_interests']) ? $row['user_interests'] : '', 'S_SHOW_ACTIVITY' => $config['load_user_activity'] ? true : false, 'U_SEARCH_USER' => $auth->acl_get('u_search') ? append_sid("{$phpbb_root_path}search.{$phpEx}", 'author_id=' . $user->data['user_id'] . '&amp;sr=posts') : ''));
                break;
            case 'subscribed':
                include $phpbb_root_path . 'includes/functions_display.' . $phpEx;
                $user->add_lang('viewforum');
                $unwatch = isset($_POST['unwatch']) ? true : false;
                if ($unwatch) {
                    $forums = isset($_POST['f']) ? implode(', ', array_map('intval', array_keys($_POST['f']))) : false;
                    $topics = isset($_POST['t']) ? implode(', ', array_map('intval', array_keys($_POST['t']))) : false;
                    if ($forums || $topics) {
                        $l_unwatch = '';
                        if ($forums) {
                            $sql = 'DELETE FROM ' . FORUMS_WATCH_TABLE . "\n\t\t\t\t\t\t\t\tWHERE forum_id IN ({$forums}) \n\t\t\t\t\t\t\t\t\tAND user_id = " . $user->data['user_id'];
                            $db->sql_query($sql);
                            $l_unwatch .= '_FORUMS';
                        }
                        if ($topics) {
                            $sql = 'DELETE FROM ' . TOPICS_WATCH_TABLE . "\n\t\t\t\t\t\t\t\tWHERE topic_id IN ({$topics}) \n\t\t\t\t\t\t\t\t\tAND user_id = " . $user->data['user_id'];
                            $db->sql_query($sql);
                            $l_unwatch .= '_TOPICS';
                        }
                        $message = $user->lang['UNWATCHED' . $l_unwatch] . '<br /><br />' . sprintf($user->lang['RETURN_UCP'], '<a href="' . append_sid("{$phpbb_root_path}ucp.{$phpEx}", "i={$id}&amp;mode=subscribed") . '">', '</a>');
                        meta_refresh(3, append_sid("{$phpbb_root_path}ucp.{$phpEx}", "i={$id}&amp;mode=subscribed"));
//.........这里部分代码省略.........
开发者ID:yunsite,项目名称:gloryroad,代码行数:101,代码来源:ucp_main.php


注:本文中的display_user_activity函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。