• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP topic_status函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: get_subscribed_topic_func

function get_subscribed_topic_func()
{
    global $config, $db, $user, $auth, $mobiquo_config;
    // Only registered users can go beyond this point
    if (!$user->data['is_registered']) {
        return get_error(9);
    }
    $topic_list = array();
    if ($config['allow_topic_notify']) {
        $forbidden_forums = $auth->acl_getf('!f_read', true);
        $forbidden_forums = array_unique(array_keys($forbidden_forums));
        if (isset($mobiquo_config['hide_forum_id'])) {
            $forbidden_forums = array_unique(array_merge($forbidden_forums, $mobiquo_config['hide_forum_id']));
        }
        $sql_array = array('SELECT' => 't.*, 
                            f.forum_name,
                            u.user_avatar,
                            u.user_avatar_type', 'FROM' => array(TOPICS_WATCH_TABLE => 'tw', TOPICS_TABLE => 't', USERS_TABLE => 'u'), 'WHERE' => 'tw.user_id = ' . $user->data['user_id'] . '
                AND t.topic_id = tw.topic_id
                AND u.user_id = t.topic_last_poster_id
                AND ' . $db->sql_in_set('t.forum_id', $forbidden_forum_ary, true, true), 'ORDER_BY' => 't.topic_last_post_time DESC');
        $sql_array['LEFT_JOIN'] = array();
        $sql_array['LEFT_JOIN'][] = array('FROM' => array(FORUMS_TABLE => 'f'), 'ON' => 't.forum_id = f.forum_id');
        if ($config['allow_bookmarks']) {
            $sql_array['SELECT'] .= ', bm.topic_id as bookmarked';
            $sql_array['LEFT_JOIN'][] = array('FROM' => array(BOOKMARKS_TABLE => 'bm'), 'ON' => 'bm.user_id = ' . $user->data['user_id'] . ' AND t.topic_id = bm.topic_id');
        }
        $sql = $db->sql_build_query('SELECT', $sql_array);
        $result = $db->sql_query_limit($sql, 20);
        $topic_list = array();
        while ($row = $db->sql_fetchrow($result)) {
            $forum_id = $row['forum_id'];
            $topic_id = isset($row['b_topic_id']) ? $row['b_topic_id'] : $row['topic_id'];
            // Replies
            $replies = $auth->acl_get('m_approve', $forum_id) ? $row['topic_replies_real'] : $row['topic_replies'];
            if ($row['topic_status'] == ITEM_MOVED && !empty($row['topic_moved_id'])) {
                $topic_id = $row['topic_moved_id'];
            }
            // Get folder img, topic status/type related information
            $folder_img = $folder_alt = $topic_type = '';
            topic_status($row, $replies, $unread_topic, $folder_img, $folder_alt, $topic_type);
            $short_content = get_short_content($row['topic_last_post_id']);
            if ($forum_id) {
                $topic_tracking = get_complete_topic_tracking($forum_id, $topic_id);
                $new_post = $topic_tracking[$topic_id] < $row['topic_last_post_time'] ? true : false;
            } else {
                $new_post = false;
            }
            $user_avatar_url = get_user_avatar_url($row['user_avatar'], $row['user_avatar_type']);
            $allow_change_type = $auth->acl_get('m_', $forum_id) || $user->data['is_registered'] && $user->data['user_id'] == $row['topic_poster'] ? true : false;
            $xmlrpc_topic = new xmlrpcval(array('forum_id' => new xmlrpcval($forum_id), 'forum_name' => new xmlrpcval(html_entity_decode($row['forum_name']), 'base64'), 'topic_id' => new xmlrpcval($topic_id), 'topic_title' => new xmlrpcval(html_entity_decode(strip_tags(censor_text($row['topic_title']))), 'base64'), 'reply_number' => new xmlrpcval(intval($replies), 'int'), 'view_number' => new xmlrpcval(intval($row['topic_views']), 'int'), 'short_content' => new xmlrpcval($short_content, 'base64'), 'post_author_id' => new xmlrpcval($row['topic_last_poster_id']), 'post_author_name' => new xmlrpcval(html_entity_decode($row['topic_last_poster_name']), 'base64'), 'new_post' => new xmlrpcval($new_post, 'boolean'), 'post_time' => new xmlrpcval(mobiquo_iso8601_encode($row['topic_last_post_time']), 'dateTime.iso8601'), 'icon_url' => new xmlrpcval($user_avatar_url), 'can_delete' => new xmlrpcval($auth->acl_get('m_delete', $forum_id), 'boolean'), 'can_bookmark' => new xmlrpcval($user->data['is_registered'] && $config['allow_bookmarks'], 'boolean'), 'isbookmarked' => new xmlrpcval($row['bookmarked'] ? true : false, 'boolean'), 'can_close' => new xmlrpcval($auth->acl_get('m_lock', $forum_id) || $auth->acl_get('f_user_lock', $forum_id) && $user->data['is_registered'] && $user->data['user_id'] == $row['topic_poster'], 'boolean'), 'is_closed' => new xmlrpcval($row['topic_status'] == ITEM_LOCKED, 'boolean'), 'can_stick' => new xmlrpcval($allow_change_type && $auth->acl_get('f_sticky', $forum_id) && $row['topic_type'] != POST_STICKY, 'boolean')), 'struct');
            $topic_list[] = $xmlrpc_topic;
        }
        $db->sql_freeresult($result);
    }
    $topic_num = count($topic_list);
    $response = new xmlrpcval(array('total_topic_num' => new xmlrpcval($topic_num, 'int'), 'topics' => new xmlrpcval($topic_list, 'array')), 'struct');
    return new xmlrpcresp($response);
}
开发者ID:patrickrolanddg,项目名称:dragonfly-tapatalk,代码行数:59,代码来源:get_subscribed_topic.php


示例2: __construct

 /**
  *
  * @param array $topic_row a db topic row
  */
 public function __construct(array $topic_row, $user, $auth, $phpbb_content_visibility, $phpbb_root_path, $php_ext)
 {
     $this->user = $user;
     $this->auth = $auth;
     $this->phpbb_root_path = $phpbb_root_path;
     $this->php_ext = $php_ext;
     $this->topic_row = $topic_row;
     if ($topic_row['topic_status'] == ITEM_MOVED) {
         $this->topic_id = $topic_row['topic_moved_id'];
     } else {
         $this->topic_id = $topic_row['topic_id'];
     }
     $this->forum_id = (int) $this->topic_row['forum_id'];
     $this->view_topic_url_params = 'f=' . $this->forum_id . '&amp;t=' . $this->topic_id;
     $this->view_topic_url = append_sid("{$this->phpbb_root_path}viewtopic.{$this->php_ext}", $this->view_topic_url_params);
     $this->newest_post_url = append_sid("{$this->phpbb_root_path}viewtopic.{$this->php_ext}", $this->view_topic_url_params . '&amp;view=unread') . '#unread';
     $this->last_post_url = append_sid("{$this->phpbb_root_path}viewtopic.{$this->php_ext}", $this->view_topic_url_params . '&amp;p=' . $topic_row['topic_last_post_id']) . '#p' . $topic_row['topic_last_post_id'];
     $this->replies = $phpbb_content_visibility->get_count('topic_posts', $topic_row, $this->forum_id) - 1;
     // Get folder img, topic status/type related information
     topic_status($topic_row, $this->replies, $this->unread_topic(), $this->folder_img, $this->folder_alt, $this->topic_type);
     $this->topic_unapproved = ($topic_row['topic_visibility'] == ITEM_UNAPPROVED || $topic_row['topic_visibility'] == ITEM_REAPPROVE) && $auth->acl_get('m_approve', $this->forum_id);
     $this->posts_unapproved = $topic_row['topic_visibility'] == ITEM_APPROVED && $topic_row['topic_posts_unapproved'] && $auth->acl_get('m_approve', $this->forum_id);
     $this->topic_deleted = $topic_row['topic_visibility'] == ITEM_DELETED;
 }
开发者ID:nerestaren,项目名称:phpbb-ext-topictags,代码行数:28,代码来源:topic.php


示例3: display_similar_topics

    /**
     * Get similar topics by matching topic titles
     *
     * NOTE: Currently requires MySQL due to the use of FULLTEXT indexes
     * and MATCH and AGAINST and UNIX_TIMESTAMP. MySQL FULLTEXT has built-in
     * English ignore words. We use phpBB's ignore words for non-English
     * languages. We also remove any admin-defined special ignore words.
     *
     * @param	array	$topic_data	Array with topic data
     * @return 	null
     * @access	public
     */
    public function display_similar_topics($topic_data)
    {
        $topic_title = $this->clean_topic_title($topic_data['topic_title']);
        // If the cleaned up topic_title is empty, no need to continue
        if (empty($topic_title)) {
            return;
        }
        // Similar Topics query
        $sql_array = array('SELECT' => "f.forum_id, f.forum_name, t.*,\n\t\t\t\tMATCH (t.topic_title) AGAINST ('" . $this->db->sql_escape($topic_title) . "') AS score", 'FROM' => array(TOPICS_TABLE => 't'), 'LEFT_JOIN' => array(array('FROM' => array(FORUMS_TABLE => 'f'), 'ON' => 'f.forum_id = t.forum_id')), 'WHERE' => "MATCH (t.topic_title) AGAINST ('" . $this->db->sql_escape($topic_title) . "') >= 0.5\n\t\t\t\tAND t.topic_status <> " . ITEM_MOVED . '
				AND t.topic_visibility = ' . ITEM_APPROVED . '
				AND t.topic_time > (UNIX_TIMESTAMP() - ' . $this->config['similar_topics_time'] . ')
				AND t.topic_id <> ' . (int) $topic_data['topic_id']);
        // Add topic tracking data to the query (only if query caching is off)
        if ($this->user->data['is_registered'] && $this->config['load_db_lastread'] && !$this->config['similar_topics_cache']) {
            $sql_array['LEFT_JOIN'][] = array('FROM' => array(TOPICS_TRACK_TABLE => 'tt'), 'ON' => 'tt.topic_id = t.topic_id AND tt.user_id = ' . $this->user->data['user_id']);
            $sql_array['LEFT_JOIN'][] = array('FROM' => array(FORUMS_TRACK_TABLE => 'ft'), 'ON' => 'ft.forum_id = f.forum_id AND ft.user_id = ' . $this->user->data['user_id']);
            $sql_array['SELECT'] .= ', tt.mark_time, ft.mark_time as f_mark_time';
        } else {
            if ($this->config['load_anon_lastread'] || $this->user->data['is_registered']) {
                // Cookie based tracking copied from search.php
                $tracking_topics = $this->request->variable($this->config['cookie_name'] . '_track', '', true, \phpbb\request\request_interface::COOKIE);
                $tracking_topics = $tracking_topics ? tracking_unserialize($tracking_topics) : array();
            }
        }
        // We need to exclude passworded forums so we do not leak the topic title
        $passworded_forums = $this->user->get_passworded_forums();
        // See if the admin set this forum to only search a specific group of other forums, and include them
        if (!empty($topic_data['similar_topic_forums'])) {
            // Remove any passworded forums from this group of forums we will be searching
            $included_forums = array_diff(explode(',', $topic_data['similar_topic_forums']), $passworded_forums);
            // if there's nothing left to display (user has no access to the forums we want to search)
            if (empty($included_forums)) {
                return;
            }
            $sql_array['WHERE'] .= ' AND ' . $this->db->sql_in_set('f.forum_id', $included_forums);
        } else {
            if (!empty($this->config['similar_topics_ignore'])) {
                // Add passworded forums to the exlude array
                $excluded_forums = array_unique(array_merge(explode(',', $this->config['similar_topics_ignore']), $passworded_forums));
                $sql_array['WHERE'] .= ' AND ' . $this->db->sql_in_set('f.forum_id', $excluded_forums, true);
            } else {
                if (!empty($passworded_forums)) {
                    $sql_array['WHERE'] .= ' AND ' . $this->db->sql_in_set('f.forum_id', $passworded_forums, true);
                }
            }
        }
        /**
         * Event to modify the sql_array for similar topics
         *
         * @event vse.similartopics.get_topic_data
         * @var	array	sql_array	SQL array to get similar topics data
         * @since 1.3.0
         */
        $vars = array('sql_array');
        extract($this->dispatcher->trigger_event('vse.similartopics.get_topic_data', compact($vars)));
        $sql = $this->db->sql_build_query('SELECT', $sql_array);
        $result = $this->db->sql_query_limit($sql, $this->config['similar_topics_limit'], 0, $this->config['similar_topics_cache']);
        // Grab icons
        $icons = $this->cache->obtain_icons();
        $rowset = array();
        while ($row = $this->db->sql_fetchrow($result)) {
            $similar_forum_id = (int) $row['forum_id'];
            $similar_topic_id = (int) $row['topic_id'];
            $rowset[$similar_topic_id] = $row;
            if ($this->auth->acl_get('f_read', $similar_forum_id)) {
                // Get topic tracking info
                if ($this->user->data['is_registered'] && $this->config['load_db_lastread'] && !$this->config['similar_topics_cache']) {
                    $topic_tracking_info = get_topic_tracking($similar_forum_id, $similar_topic_id, $rowset, array($similar_forum_id => $row['f_mark_time']));
                } else {
                    if ($this->config['load_anon_lastread'] || $this->user->data['is_registered']) {
                        $topic_tracking_info = get_complete_topic_tracking($similar_forum_id, $similar_topic_id);
                        if (!$this->user->data['is_registered']) {
                            $this->user->data['user_lastmark'] = isset($tracking_topics['l']) ? (int) (base_convert($tracking_topics['l'], 36, 10) + $this->config['board_startdate']) : 0;
                        }
                    }
                }
                // Replies
                $replies = $this->content_visibility->get_count('topic_posts', $row, $similar_forum_id) - 1;
                // Get folder img, topic status/type related information
                $folder_img = $folder_alt = $topic_type = '';
                $unread_topic = isset($topic_tracking_info[$similar_topic_id]) && $row['topic_last_post_time'] > $topic_tracking_info[$similar_topic_id] ? true : false;
                topic_status($row, $replies, $unread_topic, $folder_img, $folder_alt, $topic_type);
                $topic_unapproved = $row['topic_visibility'] == ITEM_UNAPPROVED && $this->auth->acl_get('m_approve', $similar_forum_id) ? true : false;
                $posts_unapproved = $row['topic_visibility'] == ITEM_APPROVED && $row['topic_posts_unapproved'] && $this->auth->acl_get('m_approve', $similar_forum_id) ? true : false;
                //$topic_deleted = $row['topic_visibility'] == ITEM_DELETED;
                $u_mcp_queue = $topic_unapproved || $posts_unapproved ? append_sid("{$this->root_path}mcp.{$this->php_ext}", 'i=queue&amp;mode=' . ($topic_unapproved ? 'approve_details' : 'unapproved_posts') . "&amp;t={$similar_topic_id}", true, $this->user->session_id) : '';
                //$u_mcp_queue = (!$u_mcp_queue && $topic_deleted) ? append_sid("{$this->root_path}mcp.{$this->php_ext}", "i=queue&amp;mode=deleted_topics&amp;t=$similar_topic_id", true, $this->user->session_id) : $u_mcp_queue;
                $base_url = append_sid("{$this->root_path}viewtopic.{$this->php_ext}", 'f=' . $similar_forum_id . '&amp;t=' . $similar_topic_id);
//.........这里部分代码省略.........
开发者ID:sasha2567,项目名称:rabota,代码行数:101,代码来源:similar_topics.php


示例4: display_recent_topics


//.........这里部分代码省略.........
				WHERE ' . $this->db->sql_in_set('forum_id', $forum_ids) . '
					AND forum_recent_topics = 1';
            $result = $this->db->sql_query($sql);
            $forum_ids = array();
            while ($row = $this->db->sql_fetchrow($result)) {
                $forum_ids[] = $row['forum_id'];
            }
            $this->db->sql_freeresult($result);
        }
        // No forums with f_read or recent topics enabled
        if (!sizeof($forum_ids)) {
            return;
        }
        // Remove duplicated ids
        $forum_ids = array_unique($forum_ids);
        $forums = $topic_list = array();
        $topics_count = 0;
        $obtain_icons = false;
        // Either use the phpBB core function to get unread topics, or the custom function for default behavior
        if ($unread_only && $this->user->data['user_id'] != ANONYMOUS) {
            // Get unread topics
            $sql_extra = ' AND ' . $this->db->sql_in_set('t.topic_id', $excluded_topic_ids, true);
            $sql_extra .= ' AND ' . $this->content_visibility->get_forums_visibility_sql('topic', $forum_ids, $table_alias = 't.');
            $unread_topics = get_unread_topics(false, $sql_extra, '', $total_limit);
            foreach ($unread_topics as $topic_id => $mark_time) {
                $topics_count++;
                if ($topics_count > $start && $topics_count <= $start + $topics_per_page) {
                    $topic_list[] = $topic_id;
                }
            }
        } else {
            // Get the allowed topics
            $sql_array = array('SELECT' => 't.forum_id, t.topic_id, t.topic_type, t.icon_id, tt.mark_time, ft.mark_time as f_mark_time', 'FROM' => array(TOPICS_TABLE => 't'), 'LEFT_JOIN' => array(array('FROM' => array(TOPICS_TRACK_TABLE => 'tt'), 'ON' => 'tt.topic_id = t.topic_id AND tt.user_id = ' . $this->user->data['user_id']), array('FROM' => array(FORUMS_TRACK_TABLE => 'ft'), 'ON' => 'ft.forum_id = t.forum_id AND ft.user_id = ' . $this->user->data['user_id'])), 'WHERE' => $this->db->sql_in_set('t.topic_id', $excluded_topic_ids, true) . '
					AND t.topic_status <> ' . ITEM_MOVED . '
					AND ' . $this->content_visibility->get_forums_visibility_sql('topic', $forum_ids, $table_alias = 't.'), 'ORDER_BY' => 't.' . $sort_topics . ' DESC');
            // Check if we want all topics, or only stickies/announcements/globals
            if ($min_topic_level > 0) {
                $sql_array['WHERE'] .= ' AND t.topic_type >= ' . $min_topic_level;
            }
            /**
             * Event to modify the SQL query before the allowed topics list data is retrieved
             *
             * @event paybas.recenttopics.sql_pull_topics_list
             * @var    array    sql_array        The SQL array
             * @since 2.0.4
             */
            $vars = array('sql_array');
            extract($this->dispatcher->trigger_event('paybas.recenttopics.sql_pull_topics_list', compact($vars)));
            $sql = $this->db->sql_build_query('SELECT', $sql_array);
            $result = $this->db->sql_query_limit($sql, $total_limit);
            while ($row = $this->db->sql_fetchrow($result)) {
                $topics_count++;
                if ($topics_count > $start && $topics_count <= $start + $topics_per_page) {
                    $topic_list[] = $row['topic_id'];
                    $rowset[$row['topic_id']] = $row;
                    if (!isset($forums[$row['forum_id']]) && $this->user->data['is_registered'] && $this->config['load_db_lastread']) {
                        $forums[$row['forum_id']]['mark_time'] = $row['f_mark_time'];
                    }
                    $forums[$row['forum_id']]['topic_list'][] = $row['topic_id'];
                    $forums[$row['forum_id']]['rowset'][$row['topic_id']] =& $rowset[$row['topic_id']];
                    if ($row['icon_id'] && $this->auth->acl_get('f_icons', $row['forum_id'])) {
                        $obtain_icons = true;
                    }
                }
            }
            $this->db->sql_freeresult($result);
开发者ID:NuLeaf,项目名称:nuleaf-forum,代码行数:67,代码来源:recenttopics.php


示例5: global_announcements

function global_announcements()
{
    global $db, $auth, $user, $template;
    global $phpbb_root_path, $phpEx, $config;
    global $cache, $topic_id;
    //need to know what page we are on....
    $page = str_replace('.' . $phpEx, '', $user->page['page_name']);
    if ($page == 'index' && $config['load_global_announcements_home'] || $page == 'viewtopic' && $config['load_global_announcements_topic']) {
        //this template varible is only used to see if we should include forumlist_body on viewtopic_body (.html)
        $template->assign_var('S_HAS_GLOBAL', true);
        //so we are on the index or viewtopic page and we are enabled lets get the global announcements
        $sql = 'SELECT *
			FROM ' . TOPICS_TABLE . '
			WHERE forum_id = ' . FORUM_CAT . ' AND topic_type = ' . POST_GLOBAL;
        if ($user->page['page_name'] == 'viewtopic.' . $phpEx) {
            //exclude the current topic, say if we are viewing it...
            $sql .= ' AND topic_id != ' . $topic_id;
        }
        $sql .= ' ORDER BY topic_time DESC';
        //order by original creation user topic_last_post_time for last commente
        $result = $db->sql_query($sql);
        $first_time_flag = 0;
        $topic_list = $global_announce_list = array();
        //generate items for tracking
        while ($row = $db->sql_fetchrow($result)) {
            $topic_list[] = $row['topic_id'];
            $global_announce_list[$row['topic_id']] = '1';
        }
        $db->sql_freeresult($result);
        //tracking setup
        //sql hack to bypass the no f=0 topics...
        if (sizeof($topic_list)) {
            $topic_tracking_info = get_complete_topic_tracking(0, $topic_list, $global_announce_list);
        }
        //regen
        $result = $db->sql_query($sql);
        $s_category = TRUE;
        while ($row = $db->sql_fetchrow($result)) {
            //is this the first time thru? if so we need a category...
            //genny a catergory :-)
            //highway of live mod no work, always gennys cats (under prosilver anyway)
            if ($s_category) {
                $template->assign_block_vars('forumrow', array('S_IS_CAT' => $s_category, 'FORUM_ID' => '0', 'FORUM_NAME' => $user->lang['GLOBAL_ANNOUNCEMENT'], 'U_VIEWFORUM' => ''));
            }
            $s_category = FALSE;
            // Grab topic icons stolen form cache.php
            $icons = $cache->obtain_icons();
            // Get folder img, topic status/type related information and tracking/read/unread
            $unread_topic = isset($topic_tracking_info[$row['topic_id']]) && $row['topic_last_post_time'] > $topic_tracking_info[$row['topic_id']] ? true : false;
            $folder_img = $folder_alt = '';
            //topic_posted hack...for showing _mine images
            if ($row['topic_first_poster_name'] == $user->data['username']) {
                $row['topic_posted'] = true;
            }
            topic_status($row, $row['topic_replies'], $unread_topic, $folder_img, $folder_alt, $row['topic_type']);
            //doing first time here... so near to last time...
            $first_post_time = $user->format_date($row['topic_time']);
            // Create last post link information, if appropriate
            if ($row['topic_last_post_id']) {
                $last_post_subject = $row['topic_last_post_subject'];
                $last_post_time = $user->format_date($row['topic_last_post_time']);
                $last_post_url = append_sid("{$phpbb_root_path}viewtopic.{$phpEx}", 'f=' . $row['forum_id'] . '&amp;p=' . $row['topic_last_post_id']) . '#p' . $row['topic_last_post_id'];
            } else {
                $last_post_subject = $last_post_time = $last_post_url = '';
            }
            //most of the block varibles used forum var names but topic equiv to save mods to forumlist_body.html
            $template->assign_block_vars('forumrow', array('S_IS_CAT' => false, 'S_NO_CAT' => false, 'S_IS_LINK' => false, 'S_UNREAD_FORUM' => true, 'S_LOCKED_FORUM' => false, 'S_SUBFORUMS' => false, 'FORUM_ID' => $row['forum_id'], 'FORUM_NAME' => $row['topic_title'], 'FORUM_DESC' => $user->lang['POST_BY_AUTHOR'] . ' ' . get_username_string('full', $row['topic_poster'], $row['topic_first_poster_name'], $row['topic_first_poster_colour']) . ' ' . $user->lang['POSTED_ON_DATE'] . ' ' . $first_post_time, 'TOPICS' => $row['topic_replies'], 'POSTS' => $row['topic_views'], 'FORUM_FOLDER_IMG' => $user->img($folder_img, $folder_alt), 'FORUM_FOLDER_IMG_SRC' => $user->img($folder_img, $folder_alt, false, '', 'src'), 'LAST_POST_SUBJECT' => censor_text($last_post_subject), 'LAST_POST_TIME' => $last_post_time, 'LAST_POSTER' => get_username_string('username', $row['topic_last_poster_id'], $row['topic_last_poster_name'], $row['topic_last_poster_colour']), 'LAST_POSTER_COLOUR' => get_username_string('colour', $row['topic_last_poster_id'], $row['topic_last_poster_name'], $row['topic_last_poster_colour']), 'LAST_POSTER_FULL' => get_username_string('full', $row['topic_last_poster_id'], $row['topic_last_poster_name'], $row['topic_last_poster_colour']), 'U_VIEWFORUM' => append_sid("{$phpbb_root_path}viewtopic.{$phpEx}", 'f=' . $row['forum_id'] . '&amp;t=' . $row['topic_id']), 'U_LAST_POSTER' => get_username_string('profile', $row['topic_last_poster_id'], $row['topic_last_poster_name'], $row['topic_last_poster_colour']), 'U_LAST_POST' => $last_post_url, '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']), 'TOPIC_FOLDER_IMG_ALT' => $user->lang[$folder_alt], 'TOPIC_ICON_IMG' => !empty($icons[$row['icon_id']]) ? $icons[$row['icon_id']]['img'] : '', 'TOPIC_ICON_IMG_WIDTH' => !empty($icons[$row['icon_id']]) ? $icons[$row['icon_id']]['width'] : '', 'TOPIC_ICON_IMG_HEIGHT' => !empty($icons[$row['icon_id']]) ? $icons[$row['icon_id']]['height'] : '', 'ATTACH_ICON_IMG' => $auth->acl_get('u_download') && $auth->acl_get('f_download', $row['forum_id']) && $row['topic_attachment'] ? $user->img('icon_topic_attach', $user->lang['TOTAL_ATTACHMENTS']) : ''));
        }
        $db->sql_freeresult($result);
    }
    return;
}
开发者ID:puring0815,项目名称:OpenKore,代码行数:72,代码来源:functions_display.php


示例6: mcp_forum_view


//.........这里部分代码省略.........
    // Resync Topics
    switch ($action) {
        case 'resync':
            $topic_ids = request_var('topic_id_list', array(0));
            mcp_resync_topics($topic_ids);
            break;
        case 'merge_topics':
            $source_topic_ids = $topic_id_list;
        case 'merge_topic':
            if ($to_topic_id) {
                merge_topics($forum_id, $source_topic_ids, $to_topic_id);
            }
            break;
    }
    $selected_ids = '';
    if (sizeof($post_id_list) && $action != 'merge_topics') {
        foreach ($post_id_list as $num => $post_id) {
            $selected_ids .= '&amp;post_id_list[' . $num . ']=' . $post_id;
        }
    } else {
        if (sizeof($topic_id_list) && $action == 'merge_topics') {
            foreach ($topic_id_list as $num => $topic_id) {
                $selected_ids .= '&amp;topic_id_list[' . $num . ']=' . $topic_id;
            }
        }
    }
    make_jumpbox($url . "&amp;i={$id}&amp;action={$action}&amp;mode={$mode}" . ($merge_select ? $selected_ids : ''), $forum_id, false, 'm_', true);
    $topics_per_page = $forum_info['forum_topics_per_page'] ? $forum_info['forum_topics_per_page'] : $config['topics_per_page'];
    $sort_days = $total = 0;
    $sort_key = $sort_dir = '';
    $sort_by_sql = $sort_order_sql = array();
    mcp_sorting('viewforum', $sort_days, $sort_key, $sort_dir, $sort_by_sql, $sort_order_sql, $total, $forum_id);
    $forum_topics = $total == -1 ? $forum_info['forum_topics'] : $total;
    $limit_time_sql = $sort_days ? 'AND t.topic_last_post_time >= ' . (time() - $sort_days * 86400) : '';
    $template->assign_vars(array('ACTION' => $action, 'FORUM_NAME' => $forum_info['forum_name'], 'FORUM_DESCRIPTION' => generate_text_for_display($forum_info['forum_desc'], $forum_info['forum_desc_uid'], $forum_info['forum_desc_bitfield'], $forum_info['forum_desc_options']), 'REPORTED_IMG' => $user->img('icon_topic_reported', 'TOPIC_REPORTED'), 'UNAPPROVED_IMG' => $user->img('icon_topic_unapproved', 'TOPIC_UNAPPROVED'), 'LAST_POST_IMG' => $user->img('icon_topic_latest', 'VIEW_LATEST_POST'), 'NEWEST_POST_IMG' => $user->img('icon_topic_newest', 'VIEW_NEWEST_POST'), 'S_CAN_REPORT' => $auth->acl_get('m_report', $forum_id), 'S_CAN_DELETE' => $auth->acl_get('m_delete', $forum_id), 'S_CAN_MERGE' => $auth->acl_get('m_merge', $forum_id), 'S_CAN_MOVE' => $auth->acl_get('m_move', $forum_id), 'S_CAN_FORK' => $auth->acl_get('m_', $forum_id), 'S_CAN_LOCK' => $auth->acl_get('m_lock', $forum_id), 'S_CAN_SYNC' => $auth->acl_get('m_', $forum_id), 'S_CAN_APPROVE' => $auth->acl_get('m_approve', $forum_id), 'S_MERGE_SELECT' => $merge_select ? true : false, 'S_CAN_MAKE_NORMAL' => $auth->acl_gets('f_sticky', 'f_announce', $forum_id), 'S_CAN_MAKE_STICKY' => $auth->acl_get('f_sticky', $forum_id), 'S_CAN_MAKE_ANNOUNCE' => $auth->acl_get('f_announce', $forum_id), 'U_VIEW_FORUM' => append_sid("{$phpbb_root_path}viewforum.{$phpEx}", 'f=' . $forum_id), 'U_VIEW_FORUM_LOGS' => $auth->acl_gets('a_', 'm_', $forum_id) && $module->loaded('logs') ? append_sid("{$phpbb_root_path}mcp.{$phpEx}", 'i=logs&amp;mode=forum_logs&amp;f=' . $forum_id) : '', 'S_MCP_ACTION' => $url . "&amp;i={$id}&amp;forum_action={$action}&amp;mode={$mode}&amp;start={$start}" . ($merge_select ? $selected_ids : ''), 'PAGINATION' => generate_pagination($url . "&amp;i={$id}&amp;action={$action}&amp;mode={$mode}&amp;sd={$sort_dir}&amp;sk={$sort_key}&amp;st={$sort_days}" . ($merge_select ? $selected_ids : ''), $forum_topics, $topics_per_page, $start), 'PAGE_NUMBER' => on_page($forum_topics, $topics_per_page, $start), 'TOTAL_TOPICS' => $forum_topics == 1 ? $user->lang['VIEW_FORUM_TOPIC'] : sprintf($user->lang['VIEW_FORUM_TOPICS'], $forum_topics)));
    // Grab icons
    $icons = $cache->obtain_icons();
    $topic_rows = array();
    if ($config['load_db_lastread']) {
        $read_tracking_join = ' LEFT JOIN ' . TOPICS_TRACK_TABLE . ' tt ON (tt.topic_id = t.topic_id AND tt.user_id = ' . $user->data['user_id'] . ')';
        $read_tracking_select = ', tt.mark_time';
    } else {
        $read_tracking_join = $read_tracking_select = '';
    }
    $sql = "SELECT t.topic_id\n\t\tFROM " . TOPICS_TABLE . " t\n\t\tWHERE t.forum_id IN({$forum_id}, 0)\n\t\t\t" . ($auth->acl_get('m_approve', $forum_id) ? '' : 'AND t.topic_approved = 1') . "\n\t\t\t{$limit_time_sql}\n\t\tORDER BY t.topic_type DESC, {$sort_order_sql}";
    $result = $db->sql_query_limit($sql, $topics_per_page, $start);
    $topic_list = $topic_tracking_info = array();
    while ($row = $db->sql_fetchrow($result)) {
        $topic_list[] = $row['topic_id'];
    }
    $db->sql_freeresult($result);
    $sql = "SELECT t.*{$read_tracking_select}\n\t\tFROM " . TOPICS_TABLE . " t {$read_tracking_join}\n\t\tWHERE " . $db->sql_in_set('t.topic_id', $topic_list, false, true);
    $result = $db->sql_query($sql);
    while ($row = $db->sql_fetchrow($result)) {
        $topic_rows[$row['topic_id']] = $row;
    }
    $db->sql_freeresult($result);
    // If there is more than one page, but we have no topic list, then the start parameter is... erm... out of sync
    if (!sizeof($topic_list) && $forum_topics && $start > 0) {
        redirect($url . "&amp;i={$id}&amp;action={$action}&amp;mode={$mode}");
    }
    // Get topic tracking info
    if (sizeof($topic_list)) {
        if ($config['load_db_lastread']) {
            $topic_tracking_info = get_topic_tracking($forum_id, $topic_list, $topic_rows, array($forum_id => $forum_info['mark_time']), array());
        } else {
            $topic_tracking_info = get_complete_topic_tracking($forum_id, $topic_list, array());
        }
    }
    foreach ($topic_list as $topic_id) {
        $topic_title = '';
        $row =& $topic_rows[$topic_id];
        $replies = $auth->acl_get('m_approve', $forum_id) ? $row['topic_replies_real'] : $row['topic_replies'];
        if ($row['topic_status'] == ITEM_MOVED) {
            $unread_topic = false;
        } else {
            $unread_topic = isset($topic_tracking_info[$topic_id]) && $row['topic_last_post_time'] > $topic_tracking_info[$topic_id] ? true : false;
        }
        // Get folder img, topic status/type related information
        $folder_img = $folder_alt = $topic_type = '';
        topic_status($row, $replies, $unread_topic, $folder_img, $folder_alt, $topic_type);
        $topic_title = censor_text($row['topic_title']);
        $topic_unapproved = !$row['topic_approved'] && $auth->acl_get('m_approve', $row['forum_id']) ? true : false;
        $posts_unapproved = $row['topic_approved'] && $row['topic_replies'] < $row['topic_replies_real'] && $auth->acl_get('m_approve', $row['forum_id']) ? true : false;
        $u_mcp_queue = $topic_unapproved || $posts_unapproved ? $url . '&amp;i=queue&amp;mode=' . ($topic_unapproved ? 'approve_details' : 'unapproved_posts') . '&amp;t=' . $row['topic_id'] : '';
        $topic_row = array('SOLVED_TOPIC' => $row['topic_solved'] && $row['topic_type'] != POST_GLOBAL ? $forum_info['forum_solve_text'] ? $forum_info['forum_solve_text'] : $user->img('icon_topic_solved_list', 'TOPIC_SOLVED') : '', 'U_SOLVED_TOPIC' => $row['topic_solved'] ? append_sid("{$phpbb_root_path}viewtopic.{$phpEx}", 'p=' . $row['topic_solved'] . '#p' . $row['topic_solved']) : '', 'SOLVED_STYLE' => $forum_info['forum_solve_color'] ? ' style="color: #' . $forum_info['forum_solve_color'] . '"' : '', 'ATTACH_ICON_IMG' => $auth->acl_get('u_download') && $auth->acl_get('f_download', $row['forum_id']) && $row['topic_attachment'] ? $user->img('icon_topic_attach', $user->lang['TOTAL_ATTACHMENTS']) : '', 'TOPIC_FOLDER_IMG' => $user->img($folder_img, $folder_alt), 'TOPIC_FOLDER_IMG_SRC' => $user->img($folder_img, $folder_alt, false, '', 'src'), 'TOPIC_ICON_IMG' => !empty($icons[$row['icon_id']]) ? $icons[$row['icon_id']]['img'] : '', 'TOPIC_ICON_IMG_WIDTH' => !empty($icons[$row['icon_id']]) ? $icons[$row['icon_id']]['width'] : '', 'TOPIC_ICON_IMG_HEIGHT' => !empty($icons[$row['icon_id']]) ? $icons[$row['icon_id']]['height'] : '', 'UNAPPROVED_IMG' => $topic_unapproved || $posts_unapproved ? $user->img('icon_topic_unapproved', $topic_unapproved ? 'TOPIC_UNAPPROVED' : 'POSTS_UNAPPROVED') : '', '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']), 'U_TOPIC_AUTHOR' => get_username_string('profile', $row['topic_poster'], $row['topic_first_poster_name'], $row['topic_first_poster_colour']), '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']), 'U_LAST_POST_AUTHOR' => get_username_string('profile', $row['topic_last_poster_id'], $row['topic_last_poster_name'], $row['topic_last_poster_colour']), 'TOPIC_TYPE' => $topic_type, 'TOPIC_TITLE' => $topic_title, 'REPLIES' => $auth->acl_get('m_approve', $row['forum_id']) ? $row['topic_replies_real'] : $row['topic_replies'], 'LAST_POST_TIME' => $user->format_date($row['topic_last_post_time']), 'FIRST_POST_TIME' => $user->format_date($row['topic_time']), 'LAST_POST_SUBJECT' => $row['topic_last_post_subject'], 'LAST_VIEW_TIME' => $user->format_date($row['topic_last_view_time']), 'S_TOPIC_REPORTED' => !empty($row['topic_reported']) && empty($row['topic_moved_id']) && $auth->acl_get('m_report', $row['forum_id']) ? true : false, 'S_TOPIC_UNAPPROVED' => $topic_unapproved, 'S_POSTS_UNAPPROVED' => $posts_unapproved, 'S_UNREAD_TOPIC' => $unread_topic);
        if ($row['topic_status'] == ITEM_MOVED) {
            $topic_row = array_merge($topic_row, array('U_VIEW_TOPIC' => append_sid("{$phpbb_root_path}viewtopic.{$phpEx}", "t={$row['topic_moved_id']}"), 'U_DELETE_TOPIC' => $auth->acl_get('m_delete', $forum_id) ? append_sid("{$phpbb_root_path}mcp.{$phpEx}", "i={$id}&amp;f={$forum_id}&amp;topic_id_list[]={$row['topic_id']}&amp;mode=forum_view&amp;action=delete_topic") : '', 'S_MOVED_TOPIC' => true, 'TOPIC_ID' => $row['topic_moved_id']));
        } else {
            if ($action == 'merge_topic' || $action == 'merge_topics') {
                $u_select_topic = $url . "&amp;i={$id}&amp;mode=forum_view&amp;action={$action}&amp;to_topic_id=" . $row['topic_id'] . $selected_ids;
            } else {
                $u_select_topic = $url . "&amp;i={$id}&amp;mode=topic_view&amp;action=merge&amp;to_topic_id=" . $row['topic_id'] . $selected_ids;
            }
            $topic_row = array_merge($topic_row, array('U_VIEW_TOPIC' => append_sid("{$phpbb_root_path}mcp.{$phpEx}", "i={$id}&amp;f={$forum_id}&amp;t={$row['topic_id']}&amp;mode=topic_view"), 'S_SELECT_TOPIC' => $merge_select && !in_array($row['topic_id'], $source_topic_ids) ? true : false, 'U_SELECT_TOPIC' => $u_select_topic, 'U_MCP_QUEUE' => $u_mcp_queue, 'U_MCP_REPORT' => $auth->acl_get('m_report', $forum_id) ? append_sid("{$phpbb_root_path}mcp.{$phpEx}", 'i=main&amp;mode=topic_view&amp;t=' . $row['topic_id'] . '&amp;action=reports') : '', 'TOPIC_ID' => $row['topic_id'], 'S_TOPIC_CHECKED' => $topic_id_list && in_array($row['topic_id'], $topic_id_list) ? true : false));
        }
        $template->assign_block_vars('topicrow', $topic_row);
    }
    unset($topic_rows);
}
开发者ID:jverkoey,项目名称:Three20-Scope,代码行数:101,代码来源:mcp_forum.php


示例7: while

            $sql = 'SELECT p.*, f.forum_id, f.forum_name, t.*, u.username, u.user_sig, u.user_sig_bbcode_uid
				FROM ' . FORUMS_TABLE . ' f, ' . TOPICS_TABLE . ' t, ' . USERS_TABLE . ' u, ' . POSTS_TABLE . " p \n\t\t\t\tWHERE {$sql_where} \n\t\t\t\t\tAND f.forum_id = p.forum_id\n\t\t\t\t\tAND p.topic_id = t.topic_id\n\t\t\t\t\tAND p.poster_id = u.user_id";
        } else {
            $sql = 'SELECT t.*, f.forum_id, f.forum_name
				FROM ' . TOPICS_TABLE . ' t, ' . FORUMS_TABLE . " f \n\t\t\t\tWHERE {$sql_where} \n\t\t\t\t\tAND f.forum_id = t.forum_id";
        }
        $sql .= ' ORDER BY ' . $sort_by_sql[$sort_key] . ' ' . ($sort_dir == 'd' ? 'DESC' : 'ASC') . " LIMIT {$start}, {$per_page}";
        $result = $_CLASS['core_db']->query($sql);
        while ($row = $_CLASS['core_db']->fetch_row_assoc($result)) {
            $forum_id = $row['forum_id'];
            $topic_id = $row['topic_id'];
            $view_topic_url = "Forums&amp;file=viewtopic&amp;f={$forum_id}&amp;t={$topic_id}&amp;hilit={$u_hilit}";
            if ($show_results == 'topics') {
                $replies = $_CLASS['auth']->acl_get('m_approve', $forum_id) ? $row['topic_replies_real'] : $row['topic_replies'];
                $folder_img = $folder_alt = $topic_type = '';
                topic_status($row, $replies, time(), time(), $folder_img, $folder_alt, $topic_type);
                $tpl_ary = array('TOPIC_AUTHOR' => topic_topic_author($row), 'FIRST_POST_TIME' => $_CLASS['core_user']->format_date($row['topic_time']), 'LAST_POST_TIME' => $_CLASS['core_user']->format_date($row['topic_last_post_time']), 'LAST_VIEW_TIME' => $_CLASS['core_user']->format_date($row['topic_last_view_time']), 'LAST_POST_AUTHOR' => $row['topic_last_poster_name'] != '' ? $row['topic_last_poster_name'] : $_CLASS['core_user']->lang['GUEST'], 'PAGINATION' => topic_generate_pagination($replies, $view_topic_url), 'REPLIES' => $replies, 'VIEWS' => $row['topic_views'], 'TOPIC_TYPE' => $topic_type, 'LAST_POST_IMG' => $_CLASS['core_user']->img('icon_post_latest', 'VIEW_LATEST_POST'), 'TOPIC_FOLDER_IMG' => $_CLASS['core_user']->img($folder_img, $folder_alt), 'TOPIC_ICON_IMG' => !empty($icons[$row['icon_id']]) ? $icons[$row['icon_id']]['img'] : '', 'TOPIC_ICON_IMG_WIDTH' => !empty($icons[$row['icon_id']]) ? $icons[$row['icon_id']]['width'] : '', 'TOPIC_ICON_IMG_HEIGHT' => !empty($icons[$row['icon_id']]) ? $icons[$row['icon_id']]['height'] : '', 'ATTACH_ICON_IMG' => $_CLASS['auth']->acl_gets('f_download', 'u_download', $forum_id) && $row['topic_attachment'] ? $_CLASS['core_user']->img('icon_attach', $_CLASS['core_user']->lang['TOTAL_ATTACHMENTS']) : '', 'S_TOPIC_TYPE' => $row['topic_type'], 'S_USER_POSTED' => !empty($row['mark_type']) ? true : false, 'S_TOPIC_REPORTED' => !empty($row['topic_reported']) && $_CLASS['auth']->acl_gets('m_', $forum_id) ? true : false, 'S_TOPIC_UNAPPROVED' => !$row['topic_approved'] && $_CLASS['auth']->acl_gets('m_approve', $forum_id) ? true : false, 'S_IGNORE_POST' => false, 'U_LAST_POST' => generate_link($view_topic_url . '&amp;p=' . $row['topic_last_post_id'] . '#' . $row['topic_last_post_id'], false), 'U_LAST_POST_AUTHOR' => $row['topic_last_poster_id'] != ANONYMOUS && $row['topic_last_poster_id'] ? generate_link('Members_List&amp;mode=viewprofile&amp;u=' . $row['topic_last_poster_id']) : '', 'U_MCP_REPORT' => generate_link('Forums&amp;file=mcp&amp;mode=reports&amp;t=' . $topic_id), 'U_MCP_QUEUE' => generate_link('Forums&amp;file=mcp&amp;i=queue&amp;mode=approve_details&amp;t=' . $topic_id));
            } else {
                if (isset($zebra['foe']) && in_array($row['poster_id'], $zebra['foe']) && (!$view || $view != 'show' || $post_id != $row['post_id'])) {
                    $_CLASS['core_template']->assign_vars_array('searchresults', array('S_IGNORE_POST' => true, 'L_IGNORE_POST' => sprintf($_CLASS['core_user']->lang['POST_BY_FOE'], $row['username'], '<a href="' . generate_link("Forums&amp;file=search&amp;search_session_id={$search_session_id}&amp;{$u_sort_param}&amp;p=" . $row['post_id'] . '&amp;view=show#' . $row['post_id']) . '">', '</a>')));
                    continue;
                }
                if ($row['enable_html']) {
                    $row['post_text'] = preg_replace('#(<!\\-\\- h \\-\\-><)([\\/]?.*?)(><!\\-\\- h \\-\\->)#is', "&lt;\\2&gt;", $row['post_text']);
                }
                $row['post_text'] = censor_text($row['post_text']);
                decode_message($row['post_text'], $row['bbcode_uid']);
                if ($return_chars) {
                    $row['post_text'] = strlen($row['post_text']) < $return_chars + 3 ? $row['post_text'] : substr($row['post_text'], 0, $return_chars) . '...';
                }
                if ($hilit) {
开发者ID:BackupTheBerlios,项目名称:viperals-svn,代码行数:31,代码来源:search.php


示例8: isset

 $row =& $rowset[$topic_id];
 $topic_forum_id = $row['forum_id'] ? (int) $row['forum_id'] : $forum_id;
 // This will allow the style designer to output a different header
 // or even separate the list of announcements from sticky and normal topics
 $s_type_switch_test = $row['topic_type'] == POST_ANNOUNCE || $row['topic_type'] == POST_GLOBAL ? 1 : 0;
 // Replies
 $replies = $phpbb_content_visibility->get_count('topic_posts', $row, $topic_forum_id) - 1;
 if ($row['topic_status'] == ITEM_MOVED) {
     $topic_id = $row['topic_moved_id'];
     $unread_topic = false;
 } else {
     $unread_topic = isset($topic_tracking_info[$topic_id]) && $row['topic_last_post_time'] > $topic_tracking_info[$topic_id] ? true : false;
 }
 // Get folder img, topic status/type related information
 $folder_img = $folder_alt = $topic_type = '';
 topic_status($row, $replies, $unread_topic, $folder_img, $folder_alt, $topic_type);
 // Generate all the URIs ...
 $view_topic_url_params = 'f=' . $row['forum_id'] . '&amp;t=' . $topic_id;
 $view_topic_url = append_sid("{$phpbb_root_path}viewtopic.{$phpEx}", $view_topic_url_params);
 $topic_unapproved = ($row['topic_visibility'] == ITEM_UNAPPROVED || $row['topic_visibility'] == ITEM_REAPPROVE) && $auth->acl_get('m_approve', $row['forum_id']);
 $posts_unapproved = $row['topic_visibility'] == ITEM_APPROVED && $row['topic_posts_unapproved'] && $auth->acl_get('m_approve', $row['forum_id']);
 $topic_deleted = $row['topic_visibility'] == ITEM_DELETED;
 $u_mcp_queue = $topic_unapproved || $posts_unapproved ? append_sid("{$phpbb_root_path}mcp.{$phpEx}", 'i=queue&amp;mode=' . ($topic_unapproved ? 'approve_details' : 'unapproved_posts') . "&amp;t={$topic_id}", true, $user->session_id) : '';
 $u_mcp_queue = !$u_mcp_queue && $topic_deleted ? append_sid("{$phpbb_root_path}mcp.{$phpEx}", 'i=queue&amp;mode=deleted_topics&amp;t=' . $topic_id, true, $user->session_id) : $u_mcp_queue;
 // Send vars to template
 $topic_row = array('FORUM_ID' => $row['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']), 'REPLIES' => $replies, 'VIEWS' => $row['topic_views'], 'TOPIC_TITLE' => censor_text($row['topic_title']), 'TOPIC_TYPE' => $topic_type, 'FORUM_NAME' => isset($row['forum_name']) ? $row['forum_name'] : $forum_data['forum_name'], 'TOPIC_IMG_STYLE' => $folder_img, 'TOPIC_FOLDER_IMG' => $user->img($folder_img, $folder_alt), 'TOPIC_FOLDER_IMG_ALT' => $user->lang[$folder_alt], 'TOPIC_ICON_IMG' => !empty($icons[$row['icon_id']]) ? $icons[$row['icon_id']]['img'] : '', 'TOPIC_ICON_IMG_WIDTH' => !empty($icons[$row['icon_id']]) ? $icons[$row['icon_id']]['width'] : '', 'TOPIC_ICON_IMG_HEIGHT' => !empty($icons[$row['icon_id']]) ? $icons[$row['icon_id']]['height'] : '', 'ATTACH_ICON_IMG' => $auth->acl_get('u_download') && $auth->acl_get('f_download', $row['forum_id']) && $row['topic_attachment'] ? $user->img('icon_topic_attach', $user->lang['TOTAL_ATTACHMENTS']) : '', 'UNAPPROVED_IMG' => $topic_unapproved || $posts_unapproved ? $user->img('icon_topic_unapproved', $topic_unapproved ? 'TOPIC_UNAPPROVED' : 'POSTS_UNAPPROVED') : '', 'S_TOPIC_TYPE' => $row['topic_type'], 'S_USER_POSTED' => isset($row['topic_posted']) && $row['topic_posted'] ? true : false, 'S_UNREAD_TOPIC' => $unread_topic, 'S_TOPIC_REPORTED' => !empty($row['topic_reported']) && $auth->acl_get('m_report', $row['forum_id']) ? true : false, 'S_TOPIC_UNAPPROVED' => $topic_unapproved, 'S_POSTS_UNAPPROVED' => $posts_unapproved, 'S_TOPIC_DELETED' => $topic_deleted, 'S_HAS_POLL' => $row['poll_start'] ? true : false, 'S_POST_ANNOUNCE' => $row['topic_type'] == POST_ANNOUNCE ? true : false, 'S_POST_GLOBAL' => $row['topic_type'] == POST_GLOBAL ? true : false, 'S_POST_STICKY' => $row['topic_type'] == POST_STICKY ? true : false, 'S_TOPIC_LOCKED' => $row['topic_status'] == ITEM_LOCKED ? true : false, 'S_TOPIC_MOVED' => $row['topic_status'] == ITEM_MOVED ? true : false, 'U_NEWEST_POST' => append_sid("{$phpbb_root_path}viewtopic.{$phpEx}", $view_topic_url_params . '&amp;view=unread') . '#unread', 'U_LAST_POST' => append_sid("{$phpbb_root_path}viewtopic.{$phpEx}", $view_topic_url_params . '&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_TOPIC_AUTHOR' => get_username_string('profile', $row['topic_poster'], $row['topic_first_poster_name'], $row['topic_first_poster_colour']), 'U_VIEW_TOPIC' => $view_topic_url, 'U_VIEW_FORUM' => append_sid("{$phpbb_root_path}viewforum.{$phpEx}", 'f=' . $row['forum_id']), 'U_MCP_REPORT' => append_sid("{$phpbb_root_path}mcp.{$phpEx}", 'i=reports&amp;mode=reports&amp;f=' . $row['forum_id'] . '&amp;t=' . $topic_id, true, $user->session_id), 'U_MCP_QUEUE' => $u_mcp_queue, 'S_TOPIC_TYPE_SWITCH' => $s_type_switch == $s_type_switch_test ? -1 : $s_type_switch_test);
 /**
  * Modify the topic data before it is assigned to the template
  *
  * @event core.viewforum_modify_topicrow
  * @var	array	row			Array with topic data
开发者ID:ZerGabriel,项目名称:phpbb,代码行数:31,代码来源:viewforum.php


示例9: 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 

鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP topic_time函数代码示例发布时间:2022-05-23
下一篇:
PHP topic_review函数代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap