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


PHP topic_generate_pagination函数代码示例

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


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

示例1: assign_topiclist

    /**
     * Build and assign topiclist for bookmarks/subscribed topics
     */
    function assign_topiclist($mode = 'subscribed', $forbidden_forum_ary = array())
    {
        global $user, $db, $template, $config, $cache, $auth, $phpbb_root_path, $phpEx;
        $table = $mode == 'subscribed' ? TOPICS_WATCH_TABLE : BOOKMARKS_TABLE;
        $start = request_var('start', 0);
        // Grab icons
        $icons = $cache->obtain_icons();
        $sql_array = array('SELECT' => 'COUNT(t.topic_id) as topics_count', 'FROM' => array($table => 'i', TOPICS_TABLE => 't'), 'WHERE' => 'i.topic_id = t.topic_id
				AND i.user_id = ' . $user->data['user_id'] . '
				AND ' . $db->sql_in_set('t.forum_id', $forbidden_forum_ary, true, true));
        $sql = $db->sql_build_query('SELECT', $sql_array);
        $result = $db->sql_query($sql);
        $topics_count = (int) $db->sql_fetchfield('topics_count');
        $db->sql_freeresult($result);
        if ($topics_count) {
            $template->assign_vars(array('PAGINATION' => generate_pagination($this->u_action, $topics_count, $config['topics_per_page'], $start), 'PAGE_NUMBER' => on_page($topics_count, $config['topics_per_page'], $start), 'TOTAL_TOPICS' => $topics_count == 1 ? $user->lang['VIEW_FORUM_TOPIC'] : sprintf($user->lang['VIEW_FORUM_TOPICS'], $topics_count)));
        }
        if ($mode == 'subscribed') {
            $sql_array = array('SELECT' => 't.*, f.forum_name, f.forum_solve_text, f.forum_solve_color, f.forum_allow_solve', 'FROM' => array(TOPICS_WATCH_TABLE => 'tw', TOPICS_TABLE => 't'), 'WHERE' => 'tw.user_id = ' . $user->data['user_id'] . '
					AND t.topic_id = tw.topic_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();
        } else {
            $sql_array = array('SELECT' => 't.*, f.forum_name, f.forum_solve_text, f.forum_solve_color, f.forum_allow_solve, b.topic_id as b_topic_id', 'FROM' => array(BOOKMARKS_TABLE => 'b'), 'WHERE' => 'b.user_id = ' . $user->data['user_id'] . '
					AND ' . $db->sql_in_set('f.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(TOPICS_TABLE => 't'), 'ON' => 'b.topic_id = t.topic_id');
        }
        $sql_array['LEFT_JOIN'][] = array('FROM' => array(FORUMS_TABLE => 'f'), 'ON' => 't.forum_id = f.forum_id');
        if ($config['load_db_lastread']) {
            $sql_array['LEFT_JOIN'][] = array('FROM' => array(FORUMS_TRACK_TABLE => 'ft'), 'ON' => 'ft.forum_id = t.forum_id AND ft.user_id = ' . $user->data['user_id']);
            $sql_array['LEFT_JOIN'][] = array('FROM' => array(TOPICS_TRACK_TABLE => 'tt'), 'ON' => 'tt.topic_id = t.topic_id AND tt.user_id = ' . $user->data['user_id']);
            $sql_array['SELECT'] .= ', tt.mark_time, ft.mark_time AS forum_mark_time';
        }
        if ($config['load_db_track']) {
            $sql_array['LEFT_JOIN'][] = array('FROM' => array(TOPICS_POSTED_TABLE => 'tp'), 'ON' => 'tp.topic_id = t.topic_id AND tp.user_id = ' . $user->data['user_id']);
            $sql_array['SELECT'] .= ', tp.topic_posted';
        }
        $sql = $db->sql_build_query('SELECT', $sql_array);
        $result = $db->sql_query_limit($sql, $config['topics_per_page'], $start);
        $topic_list = $topic_forum_list = $global_announce_list = $rowset = array();
        while ($row = $db->sql_fetchrow($result)) {
            $topic_id = isset($row['b_topic_id']) ? $row['b_topic_id'] : $row['topic_id'];
            $topic_list[] = $topic_id;
            $rowset[$topic_id] = $row;
            $topic_forum_list[$row['forum_id']]['forum_mark_time'] = $config['load_db_lastread'] ? $row['forum_mark_time'] : 0;
            $topic_forum_list[$row['forum_id']]['topics'][] = $topic_id;
            if ($row['topic_type'] == POST_GLOBAL) {
                $global_announce_list[] = $topic_id;
            }
        }
        $db->sql_freeresult($result);
        $topic_tracking_info = array();
        if ($config['load_db_lastread']) {
            foreach ($topic_forum_list as $f_id => $topic_row) {
                $topic_tracking_info += get_topic_tracking($f_id, $topic_row['topics'], $rowset, array($f_id => $topic_row['forum_mark_time']), $f_id == 0 ? $global_announce_list : false);
            }
        } else {
            foreach ($topic_forum_list as $f_id => $topic_row) {
                $topic_tracking_info += get_complete_topic_tracking($f_id, $topic_row['topics'], $global_announce_list);
            }
        }
        foreach ($topic_list as $topic_id) {
            $row =& $rowset[$topic_id];
            $forum_id = $row['forum_id'];
            $topic_id = isset($row['b_topic_id']) ? $row['b_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;
            // 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);
            $view_topic_url_params = "f={$forum_id}&t={$topic_id}";
            $view_topic_url = append_sid("{$phpbb_root_path}viewtopic.{$phpEx}", $view_topic_url_params);
            // Send vars to template
            $template->assign_block_vars('topicrow', array('FORUM_ID' => $forum_id, 'TOPIC_ID' => $topic_id, 'FIRST_POST_TIME' => $user->format_date($row['topic_time']), 'LAST_POST_SUBJECT' => $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']), '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']), 'S_DELETED_TOPIC' => !$row['topic_id'] ? true : false, 'S_GLOBAL_TOPIC' => !$forum_id ? true : false, 'PAGINATION' => topic_generate_pagination($replies, append_sid("{$phpbb_root_path}viewtopic.{$phpEx}", 'f=' . ($row['forum_id'] ? $row['forum_id'] : $forum_id) . "&t={$topic_id}")), 'REPLIES' => $replies, 'VIEWS' => $row['topic_views'], 'TOPIC_TITLE' => censor_text($row['topic_title']), 'TOPIC_TYPE' => $topic_type, 'FORUM_NAME' => $row['forum_name'], 'TOPIC_FOLDER_IMG' => $user->img($folder_img, $folder_alt), 'TOPIC_FOLDER_IMG_SRC' => $user->img($folder_img, $folder_alt, false, '', 'src'), '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', $forum_id) && $row['topic_attachment'] ? $user->img('icon_topic_attach', $user->lang['TOTAL_ATTACHMENTS']) : '', 'S_TOPIC_TYPE' => $row['topic_type'], 'S_USER_POSTED' => !empty($row['topic_posted']) ? true : false, 'S_UNREAD_TOPIC' => $unread_topic, 'U_NEWEST_POST' => append_sid("{$phpbb_root_path}viewtopic.{$phpEx}", $view_topic_url_params . '&view=unread') . '#unread', 'U_LAST_POST' => append_sid("{$phpbb_root_path}viewtopic.{$phpEx}", $view_topic_url_params . '&p=' . $row['topic_last_post_id']) . '#p' . $row['topic_last_post_id'], 'U_VIEW_TOPIC' => $view_topic_url, 'U_VIEW_FORUM' => append_sid("{$phpbb_root_path}viewforum.{$phpEx}", 'f=' . $forum_id), 'SOLVED_TOPIC' => $row['topic_solved'] && $row['forum_allow_solve'] ? $row['forum_solve_text'] ? $row['forum_solve_text'] : $user->img('icon_topic_solved_list', 'TOPIC_SOLVED') : '', 'U_SOLVED_TOPIC' => $row['topic_solved'] && $row['forum_allow_solve'] ? append_sid("{$phpbb_root_path}viewtopic.{$phpEx}", 'p=' . $row['topic_solved'] . '#p' . $row['topic_solved']) : '', 'SOLVED_STYLE' => $row['forum_solve_color'] ? ' style="color: #' . $row['forum_solve_color'] . '"' : ''));
        }
    }
开发者ID:jverkoey,项目名称:Three20-Scope,代码行数:84,代码来源:ucp_main.php

示例2: preg_replace

				$row['topic_title'] = preg_replace('#(?!<.*)(?<!\w)(' . $hilit . ')(?!\w|[^<>]*(?:</s(?:cript|tyle))?>)#is', '<span class="posthilit">$1</span>', $row['topic_title']);

				$tpl_ary = array(
					'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'			=> $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']),

					'PAGINATION'		=> topic_generate_pagination($replies, $view_topic_url),
					'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'),
					'TOPIC_FOLDER_IMG_ALT'	=> $user->lang[$folder_alt],
					'TOPIC_FOLDER_IMG_WIDTH'=> $user->img($folder_img, '', false, '', 'width'),
					'TOPIC_FOLDER_IMG_HEIGHT'	=> $user->img($folder_img, '', false, '', 'height'),

					'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', $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_GLOBAL'		=> (!$forum_id) ? true : false,
开发者ID:renemilk,项目名称:spring-website,代码行数:30,代码来源:search.php

示例3: isset

        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 = append_sid("{$phpbb_root_path}viewtopic.{$phpEx}", 'f=' . ($row['forum_id'] ? $row['forum_id'] : $forum_id) . '&amp;t=' . $topic_id);
        $topic_unapproved = !$row['topic_approved'] && $auth->acl_get('m_approve', $forum_id) ? true : false;
        $posts_unapproved = $row['topic_approved'] && $row['topic_replies'] < $row['topic_replies_real'] && $auth->acl_get('m_approve', $forum_id) ? true : false;
        $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) : '';
        // Send vars to template
        $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']), 'PAGINATION' => topic_generate_pagination($replies, $view_topic_url), 'REPLIES' => $replies, 'VIEWS' => $row['topic_views'], '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'), 'TOPIC_FOLDER_IMG_ALT' => $user->lang[$folder_alt], 'TOPIC_FOLDER_IMG_WIDTH' => $user->img($folder_img, '', false, '', 'width'), 'TOPIC_FOLDER_IMG_HEIGHT' => $user->img($folder_img, '', false, '', 'height'), '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', $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', $forum_id) ? true : false, 'S_TOPIC_UNAPPROVED' => $topic_unapproved, 'S_POSTS_UNAPPROVED' => $posts_unapproved, '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' => $view_topic_url . '&amp;view=unread#unread', 'U_LAST_POST' => $view_topic_url . '&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_MCP_REPORT' => append_sid("{$phpbb_root_path}mcp.{$phpEx}", 'i=reports&amp;mode=reports&amp;f=' . $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));
        $s_type_switch = $row['topic_type'] == POST_ANNOUNCE || $row['topic_type'] == POST_GLOBAL ? 1 : 0;
        if ($unread_topic) {
            $mark_forum_read = false;
        }
        unset($rowset[$topic_id]);
    }
}
// This is rather a fudge but it's the best I can think of without requiring information
// on all topics (as we do in 2.0.x). It looks for unread or new topics, if it doesn't find
// any it updates the forum last read cookie. This requires that the user visit the forum
// after reading a topic
if ($forum_data['forum_type'] == FORUM_POST && sizeof($topic_list) && $mark_forum_read) {
    update_forum_tracking_info($forum_id, $forum_data['forum_last_post_time'], false, $mark_time_forum);
}
page_footer();
开发者ID:jvinhit,项目名称:php,代码行数:31,代码来源:viewforum.php

示例4: get_template_center


//.........这里部分代码省略.........
					$template->assign_block_vars('news_row', array(
						'ATTACH_ICON_IMG'		=> ($fetch_news[$i]['attachment'] && $config['allow_attachments']) ? $user->img('icon_topic_attach', $user->lang['TOTAL_ATTACHMENTS']) : '',
						'FORUM_NAME'			=> ($forum_id) ? $fetch_news[$i]['forum_name'] : '',
						'TITLE'					=> $fetch_news[$i]['topic_title'],
						'POSTER'				=> $fetch_news[$i]['username'],
						'POSTER_FULL'			=> $fetch_news[$i]['username_full'],
						'USERNAME_FULL_LAST'	=> $fetch_news[$i]['username_full_last'],	
						'U_USER_PROFILE'		=> (($fetch_news[$i]['user_type'] == USER_NORMAL || $fetch_news[$i]['user_type'] == USER_FOUNDER) && $fetch_news[$i]['user_id'] != ANONYMOUS) ? append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=viewprofile&amp;u=' . $fetch_news[$i]['user_id']) : '',
						'TIME'					=> $fetch_news[$i]['topic_time'],
						'LAST_POST_TIME'		=> $user->format_date($fetch_news[$i]['topic_last_post_time']),
						'TEXT'					=> $fetch_news[$i]['post_text'],
						'REPLIES'				=> $fetch_news[$i]['topic_replies'],
						'TOPIC_VIEWS'			=> $fetch_news[$i]['topic_views'],
						'N_ID'					=> $i,
						'TOPIC_FOLDER_IMG'		=> $user->img($folder_img, $folder_alt),
						'TOPIC_FOLDER_IMG_SRC'  => $user->img($folder_img, $folder_alt, false, '', 'src'),
						'TOPIC_FOLDER_IMG_ALT'  => $user->lang[$folder_alt],
						'TOPIC_ICON_IMG'		=> (!empty($icons[$fetch_news[$i]['icon_id']])) ? $icons[$fetch_news[$i]['icon_id']]['img'] : '',
						'TOPIC_ICON_IMG_WIDTH'	=> (!empty($icons[$fetch_news[$i]['icon_id']])) ? $icons[$fetch_news[$i]['icon_id']]['width'] : '',
						'TOPIC_ICON_IMG_HEIGHT'	=> (!empty($icons[$fetch_news[$i]['icon_id']])) ? $icons[$fetch_news[$i]['icon_id']]['height'] : '',
						'FOLDER_IMG'			=> $user->img('topic_read', 'NO_NEW_POSTS'),
						'U_VIEWFORUM'			=> append_sid("{$phpbb_root_path}viewforum.$phpEx", 'f=' . $fetch_news[$i]['forum_id']),
						'U_LAST_COMMENTS'		=> append_sid("{$phpbb_root_path}viewtopic.$phpEx", 'f=' . $fetch_news[$i]['forum_id'] . '&amp;t=' . $fetch_news[$i]['topic_id'] . '&amp;p=' . $fetch_news[$i]['topic_last_post_id'] . '#p' . $fetch_news[$i]['topic_last_post_id']),
						'U_VIEW_COMMENTS'		=> append_sid("{$phpbb_root_path}viewtopic.$phpEx", 'f=' . $fetch_news[$i]['forum_id'] . '&amp;t=' . $fetch_news[$i]['topic_id']),
						'U_VIEW_UNREAD'			=> append_sid("{$phpbb_root_path}viewtopic.$phpEx", 'f=' . $fetch_news[$i]['forum_id'] . '&amp;t=' . $fetch_news[$i]['topic_id'] . '&amp;view=unread#unread'),
						'U_POST_COMMENT'		=> append_sid("{$phpbb_root_path}posting.$phpEx", 'mode=reply&amp;f=' . $fetch_news[$i]['forum_id'] . '&amp;t=' . $fetch_news[$i]['topic_id']),
						'U_READ_FULL'			=> append_sid("{$phpbb_root_path}portal.$phpEx", $read_full_url),
						'L_READ_FULL'			=> $read_full,
						'OPEN'					=> $open_bracket,
						'CLOSE'					=> $close_bracket,
						'S_NOT_LAST'			=> ($i < sizeof($fetch_news) - 1) ? true : false,
						'S_POLL'				=> $fetch_news[$i]['poll'],
						'S_UNREAD_INFO'			=> $unread_topic,
						'PAGINATION'			=> topic_generate_pagination($fetch_news[$i]['topic_replies'], $view_topic_url),
						'S_HAS_ATTACHMENTS'		=> (!empty($fetch_news[$i]['attachments'])) ? true : false,
					));

					if(!empty($fetch_news[$i]['attachments']))
					{
						foreach ($fetch_news[$i]['attachments'] as $attachment)
						{
							$template->assign_block_vars('news_row.attachment', array(
								'DISPLAY_ATTACHMENT'	=> $attachment)
							);
						}
					}

					if ($config['board3_number_of_news_' . $module_id] <> 0 && $config['board3_news_archive_' . $module_id])
					{
						$template->assign_vars(array(
							'NP_PAGINATION'		=> $pagination,
							'TOTAL_NEWS'		=> ($total_news == 1) ? $user->lang['VIEW_FORUM_TOPIC'] : sprintf($user->lang['VIEW_FORUM_TOPICS'], $total_news),
							'NP_PAGE_NUMBER'	=> on_page($total_news, $config['board3_number_of_news_' . $module_id], $start))
						);
					}
				}
			}
			else
			// Show "read full" page
			{
				$i = $news;
				$forum_id = $fetch_news[$i]['forum_id'];
				$topic_id = $fetch_news[$i]['topic_id'];
				$unread_topic = (isset($topic_tracking_info[$topic_id]) && $fetch_news[$i]['topic_last_post_time'] > $topic_tracking_info[$topic_id]) ? true : false;
				$open_bracket = '[ ';
				$close_bracket = ' ]';
开发者ID:gonzo1247,项目名称:hitman_roa,代码行数:67,代码来源:portal_news.php

示例5: append_sid

 $view_topic_url = append_sid("{$phpbb_root_path}viewtopic.{$phpEx}", $view_topic_url_params);
 $replies = $auth->acl_get('m_approve', $forum_id) ? $row['topic_replies_real'] : $row['topic_replies'];
 if ($show_results == 'topics') {
     if ($config['load_db_track'] && $author_id === $user->data['user_id']) {
         $row['topic_posted'] = 1;
     }
     $folder_img = $folder_alt = $topic_type = '';
     topic_status($row, $replies, isset($topic_tracking_info[$forum_id][$row['topic_id']]) && $row['topic_last_post_time'] > $topic_tracking_info[$forum_id][$row['topic_id']] ? true : false, $folder_img, $folder_alt, $topic_type);
     $unread_topic = isset($topic_tracking_info[$forum_id][$row['topic_id']]) && $row['topic_last_post_time'] > $topic_tracking_info[$forum_id][$row['topic_id']] ? true : false;
     $topic_unapproved = !$row['topic_approved'] && $auth->acl_get('m_approve', $forum_id) ? true : false;
     $posts_unapproved = $row['topic_approved'] && $row['topic_replies'] < $row['topic_replies_real'] && $auth->acl_get('m_approve', $forum_id) ? true : false;
     $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={$result_topic_id}", true, $user->session_id) : '';
     $row['topic_title'] = preg_replace('#(?!<.*)(?<!\\w)(' . $hilit . ')(?!\\w|[^<>]*(?:</s(?:cript|tyle))?>)#is', '<span class="posthilit">$1</span>', $row['topic_title']);
     // tapatalk add
     $row['post_text'] = get_context($row['post_text'], array_filter(explode('|', $hilit), 'strlen'), $return_chars);
     $tpl_ary = array('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' => $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_ID' => $row['topic_last_post_id'], 'TOPIC_AUTHOR_ID' => $row['topic_poster'], 'FIRST_POST_TIMESTAMP' => $row['topic_time'], 'LAST_POST_TIMESTAMP' => $row['topic_last_post_time'], 'LAST_POSTER_ID' => $row['topic_last_poster_id'], 'LAST_POSTER_AVATAR' => get_user_avatar_url($row['user_avatar'], $row['user_avatar_type']), 'LAST_POST_PREV' => $row['post_text'], 'S_POST_STICKY' => $row['topic_type'] == POST_STICKY ? true : false, 'S_TOPIC_LOCKED' => $row['topic_status'] == ITEM_LOCKED ? true : false, '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']), 'PAGINATION' => topic_generate_pagination($replies, $view_topic_url), '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'), 'TOPIC_FOLDER_IMG_ALT' => $user->lang[$folder_alt], 'TOPIC_FOLDER_IMG_WIDTH' => $user->img($folder_img, '', false, '', 'width'), 'TOPIC_FOLDER_IMG_HEIGHT' => $user->img($folder_img, '', false, '', 'height'), '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', $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_GLOBAL' => !$forum_id ? true : false, 'S_TOPIC_TYPE' => $row['topic_type'], 'S_USER_POSTED' => !empty($row['topic_posted']) ? true : false, 'S_UNREAD_TOPIC' => $unread_topic, 'S_TOPIC_REPORTED' => !empty($row['topic_reported']) && $auth->acl_get('m_report', $forum_id) ? true : false, 'S_TOPIC_UNAPPROVED' => $topic_unapproved, 'S_POSTS_UNAPPROVED' => $posts_unapproved, '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_NEWEST_POST' => append_sid("{$phpbb_root_path}viewtopic.{$phpEx}", $view_topic_url_params . '&amp;view=unread') . '#unread', 'U_MCP_REPORT' => append_sid("{$phpbb_root_path}mcp.{$phpEx}", 'i=reports&amp;mode=reports&amp;t=' . $result_topic_id, true, $user->session_id), 'U_MCP_QUEUE' => $u_mcp_queue);
 } else {
     if (isset($zebra['foe']) && in_array($row['poster_id'], $zebra['foe']) && (!$view || $view != 'show' || $post_id != $row['post_id'])) {
         $template->assign_block_vars('searchresults', array('S_IGNORE_POST' => true, 'L_IGNORE_POST' => sprintf($user->lang['POST_BY_FOE'], $row['username'], "<a href=\"{$u_search}&amp;start={$start}&amp;p=" . $row['post_id'] . '&amp;view=show#p' . $row['post_id'] . '">', '</a>')));
         continue;
     }
     // Replace naughty words such as farty pants
     $row['post_subject'] = censor_text($row['post_subject']);
     /*
     				if ($row['display_text_only'])
     				{
     */
     // now find context for the searched words
     $row['post_text'] = get_context($row['post_text'], array_filter(explode('|', $hilit), 'strlen'), $return_chars);
     /*
     					$row['post_text'] = bbcode_nl2br($row['post_text']);
开发者ID:danielgospodinow,项目名称:GamingZone,代码行数:31,代码来源:search.php

示例6: while

				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) {
                    // This was shamelessly 'borrowed' from volker at multiartstudio dot de
开发者ID:BackupTheBerlios,项目名称:viperals-svn,代码行数:31,代码来源:search.php

示例7: display_recent_topics


//.........这里部分代码省略.........
            $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'] && $auth->acl_get('f_icons', $row['forum_id'])) {
                $obtain_icons = true;
            }
        }
    }
    $db->sql_freeresult($result);
    // No topics to display
    if (!sizeof($topic_ids)) {
        return;
    }
    // Grab icons
    if ($obtain_icons) {
        $icons = $cache->obtain_icons();
    } else {
        $icons = array();
    }
    // Borrowed from search.php
    foreach ($forums as $forum_id => $forum) {
        if ($user->data['is_registered'] && $config['load_db_lastread']) {
            $topic_tracking_info[$forum_id] = get_topic_tracking($forum_id, $forum['topic_list'], $forum['rowset'], array($forum_id => $forum['mark_time']), $forum_id ? false : $forum['topic_list']);
        } else {
            if ($config['load_anon_lastread'] || $user->data['is_registered']) {
                $tracking_topics = isset($_COOKIE[$config['cookie_name'] . '_track']) ? STRIP ? stripslashes($_COOKIE[$config['cookie_name'] . '_track']) : $_COOKIE[$config['cookie_name'] . '_track'] : '';
                $tracking_topics = $tracking_topics ? tracking_unserialize($tracking_topics) : array();
                $topic_tracking_info[$forum_id] = get_complete_topic_tracking($forum_id, $forum['topic_list'], $forum_id ? false : $forum['topic_list']);
                if (!$user->data['is_registered']) {
                    $user->data['user_lastmark'] = isset($tracking_topics['l']) ? (int) (base_convert($tracking_topics['l'], 36, 10) + $config['board_startdate']) : 0;
                }
            }
        }
    }
    // Now only pull the data of the requested topics
    $sql_query_array = array('SELECT' => 't.*, tp.topic_posted, f.forum_name', 'FROM' => array(TOPICS_TABLE => 't'), 'LEFT_JOIN' => array(array('FROM' => array(TOPICS_POSTED_TABLE => 'tp'), 'ON' => 't.topic_id = tp.topic_id AND tp.user_id = ' . $user->data['user_id']), array('FROM' => array(FORUMS_TABLE => 'f'), 'ON' => 'f.forum_id = t.forum_id')), 'WHERE' => $db->sql_in_set('t.topic_id', $topic_ids), 'ORDER_BY' => 't.topic_last_post_time DESC');
    if ($display_parent_forums) {
        $sql_query_array['SELECT'] .= ', f.parent_id, f.forum_parents, f.left_id, f.right_id';
    }
    $sql = $db->sql_build_query('SELECT', $sql_query_array);
    $result = $db->sql_query_limit($sql, $topics_per_page);
    $topic_icons = array();
    while ($row = $db->sql_fetchrow($result)) {
        $topic_id = $row['topic_id'];
        $forum_id = $row['forum_id'];
        // Cheat for Global Announcements on the unread-link: copied from search.php
        if (!$forum_id && !$ga_forum_id) {
            $sql2 = 'SELECT forum_id
				FROM ' . FORUMS_TABLE . '
				WHERE forum_type = ' . FORUM_POST . '
					AND ' . $db->sql_in_set('forum_id', $forum_ary, false, true);
            $result2 = $db->sql_query_limit($sql2, 1);
            $ga_forum_id = (int) $db->sql_fetchfield('forum_id');
            $db->sql_freeresult($result2);
            $forum_id = $ga_forum_id;
        } else {
            if (!$forum_id && $ga_forum_id) {
                $forum_id = $ga_forum_id;
            }
        }
        $s_type_switch_test = $row['topic_type'] == POST_ANNOUNCE || $row['topic_type'] == POST_GLOBAL ? 1 : 0;
        $replies = $auth->acl_get('m_approve', $forum_id) ? $row['topic_replies_real'] : $row['topic_replies'];
        topic_status($row, $replies, isset($topic_tracking_info[$forum_id][$row['topic_id']]) && $row['topic_last_post_time'] > $topic_tracking_info[$forum_id][$row['topic_id']] ? true : false, $folder_img, $folder_alt, $topic_type);
        $unread_topic = isset($topic_tracking_info[$forum_id][$row['topic_id']]) && $row['topic_last_post_time'] > $topic_tracking_info[$forum_id][$row['topic_id']] ? true : false;
        $view_topic_url = append_sid("{$phpbb_root_path}viewtopic.{$phpEx}", 'f=' . $forum_id . '&amp;t=' . $topic_id);
        $view_forum_url = append_sid("{$phpbb_root_path}viewforum.{$phpEx}", 'f=' . $forum_id);
        $topic_unapproved = !$row['topic_approved'] && $auth->acl_get('m_approve', $forum_id) ? true : false;
        $posts_unapproved = $row['topic_approved'] && $row['topic_replies'] < $row['topic_replies_real'] && $auth->acl_get('m_approve', $forum_id) ? true : false;
        $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) : '';
        $s_type_switch = $row['topic_type'] == POST_ANNOUNCE || $row['topic_type'] == POST_GLOBAL ? 1 : 0;
        if (!empty($icons[$row['icon_id']])) {
            $topic_icons[] = $topic_id;
        }
        $template->assign_block_vars($tpl_loopname, array('FORUM_ID' => $forum_id, 'TOPIC_ID' => $topic_id, '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']), 'PAGINATION' => topic_generate_pagination($replies, $view_topic_url), 'REPLIES' => $replies, 'VIEWS' => $row['topic_views'], 'TOPIC_TITLE' => censor_text($row['topic_title']), 'FORUM_NAME' => $row['forum_name'], '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'), 'TOPIC_FOLDER_IMG_ALT' => $user->lang[$folder_alt], 'NEWEST_POST_IMG' => $user->img('icon_topic_newest', 'VIEW_NEWEST_POST'), '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', $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') : '', 'REPORTED_IMG' => $row['topic_reported'] && $auth->acl_get('m_report', $forum_id) ? $user->img('icon_topic_reported', 'TOPIC_REPORTED') : '', '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' => $row['topic_reported'] && $auth->acl_get('m_report', $forum_id) ? true : false, 'S_TOPIC_UNAPPROVED' => $topic_unapproved, 'S_POSTS_UNAPPROVED' => $posts_unapproved, '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, 'S_TOPIC_TYPE_SWITCH' => $s_type_switch == $s_type_switch_test ? -1 : $s_type_switch_test, 'U_NEWEST_POST' => $view_topic_url . '&amp;view=unread#unread', 'U_LAST_POST' => $view_topic_url . '&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' => $view_forum_url, 'U_MCP_REPORT' => append_sid("{$phpbb_root_path}mcp.{$phpEx}", 'i=reports&amp;mode=reports&amp;f=' . $forum_id . '&amp;t=' . $topic_id, true, $user->session_id), 'U_MCP_QUEUE' => $u_mcp_queue));
        if ($display_parent_forums) {
            $forum_parents = get_forum_parents($row);
            foreach ($forum_parents as $parent_id => $data) {
                $template->assign_block_vars($tpl_loopname . '.parent_forums', array('FORUM_ID' => $parent_id, 'FORUM_NAME' => $data[0], 'U_VIEW_FORUM' => append_sid("{$phpbb_root_path}viewforum.{$phpEx}", 'f=' . $parent_id)));
            }
        }
    }
    $db->sql_freeresult($result);
    // Get URL-parameters for pagination
    $url_params = explode('&', $user->page['query_string']);
    $append_params = false;
    foreach ($url_params as $param) {
        if (!$param) {
            continue;
        }
        if (strpos($param, '=') === false) {
            // Fix MSSTI Advanced BBCode MOD
            $append_params[$param] = '1';
            continue;
        }
        list($name, $value) = explode('=', $param);
        if ($name != $tpl_loopname . '_start') {
            $append_params[$name] = $value;
        }
    }
    $template->assign_vars(array('S_TOPIC_ICONS' => sizeof($topic_icons) ? true : false, 'NEWEST_POST_IMG' => $user->img('icon_topic_newest', 'VIEW_NEWEST_POST'), 'LAST_POST_IMG' => $user->img('icon_topic_latest', 'VIEW_LATEST_POST'), strtoupper($tpl_loopname) . '_DISPLAY' => true, strtoupper($tpl_loopname) . '_PAGE_NUMBER' => on_page($num_topics, $topics_per_page, $start), strtoupper($tpl_loopname) . '_PAGINATION' => recent_topics_generate_pagination(append_sid($phpbb_root_path . $user->page['page_name'], $append_params), $num_topics, $topics_per_page, $start, false, strtoupper($tpl_loopname), $tpl_loopname . '_start', $tpl_loopname)));
}
开发者ID:gonzo1247,项目名称:hitman_roa,代码行数:101,代码来源:functions_recenttopics.php

示例8: main


//.........这里部分代码省略.........
                    $rowset[$row['topic_id']] = $row;
                    $topic_forum_list[$row['forum_id']]['forum_mark_time'] = $config['load_db_lastread'] ? $row['forum_mark_time'] : 0;
                    $topic_forum_list[$row['forum_id']]['topics'][] = $row['topic_id'];
                    if ($row['topic_type'] == POST_GLOBAL) {
                        $global_announce_list[] = $row['topic_id'];
                    }
                }
                $db->sql_freeresult($result);
                $topic_tracking_info = array();
                if ($config['load_db_lastread']) {
                    foreach ($topic_forum_list as $f_id => $topic_row) {
                        $topic_tracking_info += get_topic_tracking($f_id, $topic_row['topics'], $rowset, array($f_id => $topic_row['forum_mark_time']), $f_id == 0 ? $global_announce_list : false);
                    }
                } else {
                    foreach ($topic_forum_list as $f_id => $topic_row) {
                        $topic_tracking_info += get_complete_topic_tracking($f_id, $topic_row['topics'], $global_announce_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;
                    // Replies
                    $replies = $auth->acl_get('m_approve', $forum_id) ? $row['topic_replies_real'] : $row['topic_replies'];
                    if ($row['topic_status'] == ITEM_MOVED) {
                        $topic_id = $row['topic_moved_id'];
                    }
                    // Get folder img, topic status/type related informations
                    $folder_img = $folder_alt = $topic_type = '';
                    topic_status($row, $replies, $unread_topic, $folder_img, $folder_alt, $topic_type);
                    $view_topic_url = append_sid("{$phpbb_root_path}viewtopic.{$phpEx}", "f={$forum_id}&amp;t={$topic_id}");
                    // Send vars to template
                    $template->assign_block_vars('topicrow', array('FORUM_ID' => $forum_id, 'TOPIC_ID' => $topic_id, 'TOPIC_AUTHOR' => topic_topic_author($row), 'FIRST_POST_TIME' => $user->format_date($row['topic_time']), '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' => $row['topic_last_poster_name'] != '' ? $row['topic_last_poster_name'] : $user->lang['GUEST'], 'PAGINATION' => topic_generate_pagination($replies, append_sid("{$phpbb_root_path}viewtopic.{$phpEx}", 'f=' . ($row['forum_id'] ? $row['forum_id'] : $forum_id) . "&amp;t={$topic_id}")), 'REPLIES' => $replies, 'VIEWS' => $row['topic_views'], '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'), '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_gets('f_download', 'u_download', $forum_id) && $row['topic_attachment'] ? $user->img('icon_attach', $user->lang['TOTAL_ATTACHMENTS']) : '', 'S_TOPIC_TYPE' => $row['topic_type'], 'S_USER_POSTED' => !empty($row['topic_posted']) ? true : false, 'S_UNREAD_TOPIC' => $unread_topic, 'U_NEWEST_POST' => append_sid("{$phpbb_root_path}viewtopic.{$phpEx}", "f={$forum_id}&amp;t={$topic_id}&amp;view=unread") . '#unread', 'U_LAST_POST' => $view_topic_url . '&amp;p=' . $row['topic_last_post_id'] . '#p' . $row['topic_last_post_id'], 'U_LAST_POST_AUTHOR' => $row['topic_last_poster_id'] != ANONYMOUS && $row['topic_last_poster_id'] ? append_sid("{$phpbb_root_path}memberlist.{$phpEx}", 'mode=viewprofile&amp;u=' . $row['topic_last_poster_id']) : '', 'U_VIEW_TOPIC' => $view_topic_url));
                }
                break;
            case 'bookmarks':
                if (!$config['allow_bookmarks']) {
                    $template->assign_vars(array('S_NO_DISPLAY_BOOKMARKS' => true));
                    break;
                }
                include $phpbb_root_path . 'includes/functions_display.' . $phpEx;
                $user->add_lang('viewforum');
                $move_up = request_var('move_up', 0);
                $move_down = request_var('move_down', 0);
                $sql = 'SELECT MAX(order_id) as max_order_id
					FROM ' . BOOKMARKS_TABLE . '
					WHERE user_id = ' . $user->data['user_id'];
                $result = $db->sql_query($sql);
                $max_order_id = (int) $db->sql_fetchfield('max_order_id');
                $db->sql_freeresult($result);
                if ($move_up || $move_down) {
                    if ($move_up && $move_up != 1 || $move_down && $move_down != $max_order_id) {
                        $order = $move_up ? $move_up : $move_down;
                        $order_total = $order * 2 + ($move_up ? -1 : 1);
                        $sql = 'UPDATE ' . BOOKMARKS_TABLE . "\n\t\t\t\t\t\t\tSET order_id = {$order_total} - order_id\n\t\t\t\t\t\t\tWHERE order_id IN ({$order}, " . ($move_up ? $order - 1 : $order + 1) . ')
								AND user_id = ' . $user->data['user_id'];
                        $db->sql_query($sql);
                    }
                }
                if (isset($_POST['unbookmark'])) {
                    $s_hidden_fields = array('unbookmark' => 1);
                    $topics = isset($_POST['t']) ? array_map('intval', array_keys($_POST['t'])) : array();
                    $url = $this->u_action;
                    if (!sizeof($topics)) {
                        trigger_error('NO_BOOKMARKS_SELECTED');
开发者ID:yunsite,项目名称:gloryroad,代码行数:67,代码来源:ucp_main.php

示例9: append_sid

         $g_forum_id = $availible_forums[0];
     }
     $u_forum_id = $g_forum_id;
 } else {
     $u_forum_id = $forum_id;
 }
 $view_topic_url = append_sid("{$phpbb_root_path}viewtopic.{$phpEx}", "f={$u_forum_id}&amp;t={$result_topic_id}&amp;hilit={$u_hilit}");
 $replies = $auth->acl_get('m_approve', $forum_id) ? $row['topic_replies_real'] : $row['topic_replies'];
 if ($show_results == 'topics') {
     $folder_img = $folder_alt = $topic_type = '';
     topic_status($row, $replies, isset($topic_tracking_info[$forum_id][$row['topic_id']]) && $row['topic_last_post_time'] > $topic_tracking_info[$forum_id][$row['topic_id']] ? true : false, $folder_img, $folder_alt, $topic_type);
     $unread_topic = isset($topic_tracking_info[$forum_id][$row['topic_id']]) && $row['topic_last_post_time'] > $topic_tracking_info[$forum_id][$row['topic_id']] ? true : false;
     $topic_unapproved = !$row['topic_approved'] && $auth->acl_gets('m_approve', $forum_id) ? true : false;
     $posts_unapproved = $row['topic_approved'] && $row['topic_replies'] < $row['topic_replies_real'] && $auth->acl_gets('m_approve', $forum_id) ? true : false;
     $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={$result_topic_id}", true, $user->session_id) : '';
     $tpl_ary = array('TOPIC_AUTHOR' => topic_topic_author($row), 'FIRST_POST_TIME' => $user->format_date($row['topic_time']), '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' => $row['topic_last_poster_name'] != '' ? $row['topic_last_poster_name'] : $user->lang['GUEST'], 'PAGINATION' => topic_generate_pagination($replies, $view_topic_url), 'TOPIC_TYPE' => $topic_type, 'LAST_POST_IMG' => $user->img('icon_post_latest', 'VIEW_LATEST_POST'), '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'] : '', 'ATTACH_ICON_IMG' => $auth->acl_gets('f_download', 'u_download', $forum_id) && $row['topic_attachment'] ? $user->img('icon_attach', $user->lang['TOTAL_ATTACHMENTS']) : '', 'UNAPPROVED_IMG' => $topic_unapproved || $posts_unapproved ? $user->img('icon_unapproved', $topic_unapproved ? 'TOPIC_UNAPPROVED' : 'POSTS_UNAPPROVED') : '', 'S_TOPIC_GLOBAL' => !$forum_id ? true : false, 'S_TOPIC_TYPE' => $row['topic_type'], 'S_USER_POSTED' => !empty($row['mark_type']) ? true : false, 'S_UNREAD_TOPIC' => $unread_topic, 'S_TOPIC_REPORTED' => !empty($row['topic_reported']) && $auth->acl_gets('m_report', $forum_id) ? true : false, 'S_TOPIC_UNAPPROVED' => $topic_unapproved, 'S_POSTS_UNAPPROVED' => $posts_unapproved, 'U_LAST_POST' => $view_topic_url . '&amp;p=' . $row['topic_last_post_id'] . '#p' . $row['topic_last_post_id'], 'U_LAST_POST_AUTHOR' => $row['topic_last_poster_id'] != ANONYMOUS && $row['topic_last_poster_id'] ? append_sid("{$phpbb_root_path}memberlist.{$phpEx}", 'mode=viewprofile&amp;u=' . $row['topic_last_poster_id']) : '', 'U_NEWEST_POST' => $view_topic_url . '&amp;view=unread#unread', 'U_MCP_REPORT' => append_sid("{$phpbb_root_path}mcp.{$phpEx}", 'i=reports&amp;mode=reports&amp;t=' . $result_topic_id, true, $user->session_id), 'U_MCP_QUEUE' => $u_mcp_queue);
 } else {
     if (isset($zebra['foe']) && in_array($row['poster_id'], $zebra['foe']) && (!$view || $view != 'show' || $post_id != $row['post_id'])) {
         $template->assign_block_vars('searchresults', array('S_IGNORE_POST' => true, 'L_IGNORE_POST' => sprintf($user->lang['POST_BY_FOE'], $row['username'], "<a href=\"{$u_search}&amp;p=" . $row['post_id'] . '&amp;view=show#p' . $row['post_id'] . '">', '</a>')));
         continue;
     }
     decode_message($row['post_text'], $row['bbcode_uid']);
     if ($return_chars != -1) {
         $row['post_text'] = strlen($row['post_text']) < $return_chars + 3 ? $row['post_text'] : substr($row['post_text'], 0, $return_chars) . '...';
     }
     // Replace naughty words such as farty pants
     $row['post_subject'] = censor_text($row['post_subject']);
     $row['post_text'] = str_replace("\n", '<br />', censor_text($row['post_text']));
     if ($hilit) {
         // Remove bad highlights
         $hilit_array = array_filter(explode('|', $hilit), 'strlen');
开发者ID:yunsite,项目名称:gloryroad,代码行数:31,代码来源:search.php

示例10: get

 /**
  * get related topic list
  * @param	array	$topic_data	shuld at least provide with topic_id and topic_title
  * @param 	mixed 	$forum_id 	The forum id to search in (false / 0 / null to search into all forums)
  * */
 function get($topic_data, $forum_id = false)
 {
     global $db, $auth, $cache, $template, $user, $phpEx, $phpbb_root_path, $topic_tracking_info, $config, $phpbb_seo;
     if (empty($config['seo_related'])) {
         return;
     }
     $related_result = false;
     $enable_icons = 0;
     $this->allforums = !$forum_id ? true : $this->allforums;
     $sql = $this->build_query($topic_data, $forum_id);
     if ($sql && ($result = $db->sql_query_limit($sql, $this->limit))) {
         // Grab icons
         $icons = $cache->obtain_icons();
         $attachement_icon = $user->img('icon_topic_attach', $user->lang['TOTAL_ATTACHMENTS']);
         $s_attachement = $auth->acl_get('u_download');
         while ($row = $db->sql_fetchrow($result)) {
             $related_forum_id = (int) $row['forum_id'];
             $related_topic_id = (int) $row['topic_id'];
             $enable_icons = max($enable_icons, $row['enable_icons']);
             if ($auth->acl_get('f_list', $related_forum_id)) {
                 $row['topic_title'] = censor_text($row['topic_title']);
                 // www.phpBB-SEO.com SEO TOOLKIT BEGIN
                 if (!empty($phpbb_seo->seo_opt['url_rewrite'])) {
                     $phpbb_seo->set_url($row['forum_name'], $related_forum_id, $phpbb_seo->seo_static['forum']);
                     $phpbb_seo->prepare_iurl($row, 'topic', $row['topic_type'] == POST_GLOBAL ? $phpbb_seo->seo_static['global_announce'] : $phpbb_seo->seo_url['forum'][$related_forum_id]);
                 }
                 // www.phpBB-SEO.com SEO TOOLKIT END
                 // Replies
                 $replies = $auth->acl_get('m_approve', $related_forum_id) ? $row['topic_replies_real'] : $row['topic_replies'];
                 $unread_topic = isset($topic_tracking_info[$related_topic_id]) && $row['topic_last_post_time'] > $topic_tracking_info[$related_topic_id] ? true : false;
                 $view_topic_url = append_sid("{$phpbb_root_path}viewtopic.{$phpEx}", "f={$related_forum_id}&amp;t={$related_topic_id}");
                 $topic_unapproved = !$row['topic_approved'] && $auth->acl_get('m_approve', $related_forum_id) ? true : false;
                 $u_mcp_queue = $topic_unapproved ? append_sid("{$phpbb_root_path}mcp.{$phpEx}", "i=queue&amp;mode=approve_details&amp;t={$related_topic_id}", true, $user->session_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);
                 // www.phpBB-SEO.com SEO TOOLKIT BEGIN -> no dupe
                 if (!empty($phpbb_seo->seo_opt['no_dupe']['on'])) {
                     if ($replies + 1 > $phpbb_seo->seo_opt['topic_per_page']) {
                         $phpbb_seo->seo_opt['topic_last_page'][$related_topic_id] = floor($replies / $phpbb_seo->seo_opt['topic_per_page']) * $phpbb_seo->seo_opt['topic_per_page'];
                     }
                 }
                 // www.phpBB-SEO.com SEO TOOLKIT END -> no dupe
                 $template->assign_block_vars('related', array('TOPIC_TITLE' => $row['topic_title'], 'U_TOPIC' => $view_topic_url, 'U_FORUM' => $this->allforums ? append_sid("{$phpbb_root_path}viewforum.{$phpEx}", "f={$related_forum_id}") : '', 'FORUM' => $row['forum_name'], 'PAGINATION' => topic_generate_pagination($replies, $view_topic_url), 'REPLIES' => $replies, 'VIEWS' => $row['topic_views'], 'FIRST_POST_TIME' => $user->format_date($row['topic_time']), 'LAST_POST_TIME' => $user->format_date($row['topic_last_post_time']), 'TOPIC_AUTHOR_FULL' => get_username_string('full', $row['topic_poster'], $row['topic_first_poster_name'], $row['topic_first_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' => !empty($phpbb_seo->seo_opt['no_dupe']['on']) ? append_sid("{$phpbb_root_path}viewtopic.{$phpEx}", "f={$related_forum_id}&amp;t={$related_topic_id}&amp;start=" . @intval($phpbb_seo->seo_opt['topic_last_page'][$related_topic_id])) . '#p' . $row['topic_last_post_id'] : append_sid("{$phpbb_root_path}viewtopic.{$phpEx}", "f={$related_forum_id}&amp;t={$related_topic_id}&amp;p=" . $row['topic_last_post_id']) . '#p' . $row['topic_last_post_id'], 'TOPIC_FOLDER_IMG_SRC' => $user->img($folder_img, $folder_alt, false, '', 'src'), 'TOPIC_FOLDER_IMG' => $user->img($folder_img, $folder_alt, false), 'TOPIC_ICON_IMG' => !empty($icons[$row['icon_id']]) ? $icons[$row['icon_id']]['img'] : '', 'ATTACH_ICON_IMG' => $row['topic_attachment'] && $s_attachement ? $attachement_icon : '', 'S_TOPIC_REPORTED' => !empty($row['topic_reported']) && $auth->acl_get('m_report', $related_forum_id) ? true : false, 'S_UNREAD_TOPIC' => $unread_topic, '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_UNAPPROVED' => $topic_unapproved, 'U_MCP_REPORT' => append_sid("{$phpbb_root_path}mcp.{$phpEx}", 'i=reports&amp;mode=reports&amp;f=' . $related_forum_id . '&amp;t=' . $related_topic_id, true, $user->session_id), 'U_MCP_QUEUE' => $u_mcp_queue));
                 $related_result = true;
             }
         }
         $db->sql_freeresult($result);
     }
     if ($related_result) {
         $template->assign_vars(array('S_RELATED_RESULTS' => $related_result, 'LAST_POST_IMG' => $user->img('icon_topic_latest', 'VIEW_LATEST_POST'), 'NEWEST_POST_IMG' => $user->img('icon_topic_newest', 'VIEW_NEWEST_POST'), 'UNAPPROVED_IMG' => $user->img('icon_topic_unapproved', 'TOPIC_UNAPPROVED'), 'REPORTED_IMG' => $user->img('icon_topic_reported', 'TOPIC_REPORTED'), 'GOTO_PAGE_IMG' => $user->img('icon_post_target', 'GOTO_PAGE'), 'S_TOPIC_ICONS' => $enable_icons));
     }
 }
开发者ID:Ibrahim-Abdelkader,项目名称:phpbb3,代码行数:58,代码来源:phpbb_seo_related.php

示例11: assign_details

 /**
  * Assign details
  *
  * A little different from those in other classes, this one only returns the info ready for output
  */
 public function assign_details()
 {
     // Tracking check
     $last_read_mark = titania_tracking::get_track(TITANIA_TOPIC, $this->topic_id, true);
     $last_read_mark = max($last_read_mark, titania_tracking::find_last_read_mark($this->additional_unread_fields, $this->topic_type, $this->parent_id));
     $this->unread = $this->topic_last_post_time > $last_read_mark ? true : false;
     $folder_img = $folder_alt = '';
     $this->topic_folder_img($folder_img, $folder_alt);
     phpbb::_include('functions_display', 'topic_generate_pagination');
     // To find out if we have any posts that need approval
     $approved = titania_count::from_db($this->topic_posts, titania_count::get_flags(TITANIA_ACCESS_PUBLIC, false, false));
     $total = titania_count::from_db($this->topic_posts, titania_count::get_flags(TITANIA_ACCESS_PUBLIC, false, true));
     $details = array('TOPIC_ID' => $this->topic_id, 'TOPIC_TYPE' => $this->topic_type, 'TOPIC_ACCESS' => $this->topic_access, 'TOPIC_STATUS' => $this->topic_status, 'TOPIC_STICKY' => $this->topic_sticky, 'TOPIC_LOCKED' => $this->topic_locked, 'POSTS_APPROVED' => phpbb::$auth->acl_get('u_titania_mod_post_mod') && $total > $approved ? false : true, 'TOPIC_APPROVED' => phpbb::$auth->acl_get('u_titania_mod_post_mod') ? $this->topic_approved : true, 'TOPIC_REPORTED' => phpbb::$auth->acl_get('u_titania_mod_post_mod') ? $this->topic_reported : false, 'TOPIC_ASSIGNED' => $this->topic_assigned, 'TOPIC_REPLIES' => $this->get_postcount() - 1, 'TOPIC_VIEWS' => $this->topic_views, 'TOPIC_SUBJECT' => censor_text($this->topic_subject), 'TOPIC_FIRST_POST_ID' => $this->topic_first_post_id, 'TOPIC_FIRST_POST_USER_ID' => $this->topic_first_post_user_id, 'TOPIC_FIRST_POST_USER_COLOUR' => $this->topic_first_post_user_colour, 'TOPIC_FIRST_POST_USER_FULL' => get_username_string('full', $this->topic_first_post_user_id, $this->topic_first_post_username, $this->topic_first_post_user_colour, false, phpbb::append_sid('memberlist', 'mode=viewprofile')), 'TOPIC_FIRST_POST_TIME' => phpbb::$user->format_date($this->topic_first_post_time), 'TOPIC_LAST_POST_ID' => $this->topic_last_post_id, 'TOPIC_LAST_POST_USER_ID' => $this->topic_last_post_user_id, 'TOPIC_LAST_POST_USER_COLOUR' => $this->topic_last_post_user_colour, 'TOPIC_LAST_POST_USER_FULL' => get_username_string('full', $this->topic_last_post_user_id, $this->topic_last_post_username, $this->topic_last_post_user_colour, false, phpbb::append_sid('memberlist', 'mode=viewprofile')), 'TOPIC_LAST_POST_TIME' => phpbb::$user->format_date($this->topic_last_post_time), 'TOPIC_LAST_POST_SUBJECT' => censor_text($this->topic_last_post_subject), 'PAGINATION' => topic_generate_pagination($this->get_postcount() - 1, titania_url::append_url($this->get_url())), 'U_NEWEST_POST' => $this->unread ? titania_url::append_url($this->get_url(), array('view' => 'unread', '#' => 'unread')) : '', 'U_VIEW_TOPIC' => $this->get_url(), 'U_VIEW_LAST_POST' => titania_url::append_url($this->get_url(), array('p' => $this->topic_last_post_id, '#p' => $this->topic_last_post_id)), 'S_UNREAD_TOPIC' => $this->unread ? true : false, 'S_ACCESS_TEAMS' => $this->topic_access == TITANIA_ACCESS_TEAMS ? true : false, 'S_ACCESS_AUTHORS' => $this->topic_access == TITANIA_ACCESS_AUTHORS ? true : false, 'FOLDER_IMG' => phpbb::$user->img($folder_img, $folder_alt), 'FOLDER_IMG_SRC' => phpbb::$user->img($folder_img, $folder_alt, false, '', 'src'), 'FOLDER_IMG_ALT' => phpbb::$user->lang[$folder_alt], 'FOLDER_IMG_WIDTH' => phpbb::$user->img($folder_img, '', false, '', 'width'), 'FOLDER_IMG_HEIGHT' => phpbb::$user->img($folder_img, '', false, '', 'height'));
     // Hooks
     titania::$hook->call_hook_ref(array(__CLASS__, __FUNCTION__), $details, $this);
     return $details;
 }
开发者ID:Noxwizard,项目名称:customisation-db,代码行数:22,代码来源:topic.php

示例12: ucp_main


//.........这里部分代码省略.........
                // Subscribed Topics
                $start = request_var('start', 0);
                if ($topics_count) {
                    $_CLASS['core_template']->assign_array(array('PAGINATION' => generate_pagination("Control_Panel&amp;i={$id}&amp;mode={$mode}", $topics_count, $config['topics_per_page'], $start), 'PAGE_NUMBER' => on_page($topics_count, $config['topics_per_page'], $start), 'TOTAL_TOPICS' => $topics_count == 1 ? $_CLASS['core_user']->lang['VIEW_FORUM_TOPIC'] : sprintf($_CLASS['core_user']->lang['VIEW_FORUM_TOPICS'], $topics_count)));
                }
                // Fix this up
                $sql_from = $config['load_db_lastread'] ? FORUMS_TOPICS_TABLE . ' t LEFT JOIN ' . FORUMS_TRACK_TABLE . ' tt ON (tt.topic_id = t.topic_id AND tt.user_id = ' . $_CLASS['core_user']->data['user_id'] . ')' : TOPICS_TABLE . ' t';
                $sql_t_select = $config['load_db_lastread'] ? ', tt.mark_time' : '';
                //
                $sql = "SELECT t.* {$sql_t_select} \n\t\t\t\t\tFROM " . FORUMS_WATCH_TABLE . " tw, {$sql_from} \n\t\t\t\t\tWHERE tw.user_id = " . $_CLASS['core_user']->data['user_id'] . '
						AND t.topic_id = tw.topic_id 
					ORDER BY t.topic_last_post_time DESC';
                $result = $_CLASS['core_db']->query_limit($sql, $config['topics_per_page'], $start);
                while ($row = $_CLASS['core_db']->fetch_row_assoc($result)) {
                    $topic_id = $row['topic_id'];
                    $forum_id = $row['forum_id'];
                    if ($config['load_db_lastread']) {
                        $topic_id36 = base_convert($topic_id, 10, 36);
                        $forum_id36 = $row['topic_type'] == POST_GLOBAL ? 0 : $forum_id;
                        $mark_time_topic = isset($tracking_topics[$forum_id36][$topic_id36]) ? base_convert($tracking_topics[$forum_id36][$topic_id36], 36, 10) + $config['board_startdate'] : 0;
                        $mark_time_forum = isset($tracking_topics[$forum_id][0]) ? base_convert($tracking_topics[$forum_id][0], 36, 10) + $config['board_startdate'] : 0;
                        $row['mark_time'] = max($mark_time_topic, $mark_time_forum);
                    }
                    // Replies
                    $replies = $_CLASS['auth']->acl_get('m_approve', $forum_id) ? $row['topic_replies_real'] : $row['topic_replies'];
                    if ($row['topic_status'] == ITEM_MOVED) {
                        $topic_id = $row['topic_moved_id'];
                    }
                    // Get folder img, topic status/type related informations
                    $folder_img = $folder_alt = $topic_type = '';
                    $unread_topic = topic_status($row, $replies, $row['mark_time'], $folder_img, $folder_alt, $topic_type);
                    $newest_post_img = $unread_topic ? '<a href="' . generate_link("Forums&amp;file=viewtopic&amp;f={$forum_id}&amp;t={$topic_id}&amp;view=unread#unread") . '">' . $_CLASS['core_user']->img('icon_post_newest', 'VIEW_NEWEST_POST') . '</a> ' : '';
                    $view_topic_url = "Forums&amp;file=viewtopic&amp;f={$forum_id}&amp;t={$topic_id}";
                    $_CLASS['core_template']->assign_vars_array('topicrow', array('FORUM_ID' => $forum_id, 'TOPIC_ID' => $topic_id, '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, 'Forums&amp;file=viewtopic&amp;f=' . ($row['forum_id'] ? $row['forum_id'] : $forum_id) . "&amp;t={$topic_id}"), 'REPLIES' => $replies, 'VIEWS' => $row['topic_views'], 'TOPIC_TITLE' => censor_text($row['topic_title']), 'TOPIC_TYPE' => $topic_type, 'LAST_POST_IMG' => $_CLASS['core_user']->img('icon_post_latest', 'VIEW_LATEST_POST'), 'NEWEST_POST_IMG' => $newest_post_img, 'TOPIC_FOLDER_IMG' => $_CLASS['core_user']->img($folder_img, $folder_alt), 'TOPIC_ICON_IMG' => !empty($icons[$row['icon_id']]) ? '<img src="' . $config['icons_path'] . '/' . $icons[$row['icon_id']]['img'] . '" width="' . $icons[$row['icon_id']]['width'] . '" height="' . $icons[$row['icon_id']]['height'] . '" alt="" title="" />' : '', 'ATTACH_ICON_IMG' => $_CLASS['auth']->acl_gets('f_download', 'u_download', $forum_id) && $row['topic_attachment'] ? $_CLASS['core_user']->img('icon_attach', sprintf($_CLASS['core_user']->lang['TOTAL_ATTACHMENTS'], $row['topic_attachment'])) : '', 'S_TOPIC_TYPE' => $row['topic_type'], 'S_UNREAD_TOPIC' => $unread_topic, 'U_LAST_POST' => generate_link($view_topic_url . '&amp;p=' . $row['topic_last_post_id'] . '#' . $row['topic_last_post_id']), '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_VIEW_TOPIC' => generate_link($view_topic_url)));
                }
                $_CLASS['core_db']->free_result($result);
                break;
            case 'bookmarks':
                if (!$config['allow_bookmarks']) {
                    $_CLASS['core_template']->assign('S_BOOKMARKS_DISABLED', true);
                    break;
                }
                require $site_file_root . 'includes/forums/functions_display.php';
                $move_up = request_var('move_up', 0);
                $move_down = request_var('move_down', 0);
                $sql = 'SELECT MAX(order_id) as max_order_id FROM ' . FORUMS_BOOKMARKS_TABLE . '
					WHERE user_id = ' . $_CLASS['core_user']->data['user_id'];
                $result = $_CLASS['core_db']->query($sql);
                list($max_order_id) = $_CLASS['core_db']->fetch_row_num($result);
                $_CLASS['core_db']->free_result($result);
                if ($move_up || $move_down) {
                    if ($move_up && $move_up != 1 || $move_down && $move_down != $max_order_id) {
                        $order = $move_up ? $move_up : $move_down;
                        $order_total = $order * 2 + ($move_up ? -1 : 1);
                        $sql = 'UPDATE ' . FORUMS_BOOKMARKS_TABLE . "\n\t\t\t\t\t\t\tSET order_id = {$order_total} - order_id\n\t\t\t\t\t\t\tWHERE order_id IN ({$order}, " . ($move_up ? $order - 1 : $order + 1) . ')
								AND user_id = ' . $_CLASS['core_user']->data['user_id'];
                        $_CLASS['core_db']->query($sql);
                    }
                }
                if (isset($_POST['unbookmark'])) {
                    $s_hidden_fields = '<input type="hidden" name="unbookmark" value="1" />';
                    $topics = isset($_POST['t']) ? array_map('intval', array_keys($_POST['t'])) : array();
                    $url = generate_link('Control_Panel&amp;i=main&amp;mode=bookmarks');
                    if (empty($topics)) {
                        trigger_error('NO_BOOKMARKS_SELECTED');
                    }
开发者ID:BackupTheBerlios,项目名称:viperals-svn,代码行数:67,代码来源:ucp_main.php


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