Beispiel #1
0
//
// Dump out the page header and load viewforum template
//
define('SHOW_ONLINE', true);
$page_title = $lang['View_forum'] . ' - ' . $forum_row['forum_name'];
include $phpbb_root_path . 'includes/page_header.' . $phpEx;
$template->set_filenames(array('body' => 'viewforum_body.tpl'));
make_jumpbox('viewforum.' . $phpEx);
// Begin PNphpBB2 Categories Hierarchie Mod
// get nav sentence
$nav_cat_desc = make_cat_nav_tree($cat_id, true);
if ($nav_cat_desc != "") {
    $nav_cat_desc = $nav_separator . $nav_cat_desc;
}
// End PNphpBB2 Categories Hierarchie Mod
$template->assign_vars(array('FORUM_ID' => $forum_id, 'FORUM_NAME' => $forum_row['forum_name'], 'MODERATORS' => $forum_moderators, 'POST_IMG' => $forum_row['forum_status'] == FORUM_LOCKED ? $images['post_locked'] : $images['post_new'], 'FOLDER_IMG' => $images['folder'], 'FOLDER_NEW_IMG' => $images['folder_new'], 'FOLDER_HOT_IMG' => $images['folder_hot'], 'FOLDER_HOT_NEW_IMG' => $images['folder_hot_new'], 'FOLDER_LOCKED_IMG' => $images['folder_locked'], 'FOLDER_LOCKED_NEW_IMG' => $images['folder_locked_new'], 'FOLDER_STICKY_IMG' => $images['folder_sticky'], 'FOLDER_STICKY_NEW_IMG' => $images['folder_sticky_new'], 'FOLDER_ANNOUNCE_IMG' => $images['folder_announce'], 'FOLDER_ANNOUNCE_NEW_IMG' => $images['folder_announce_new'], 'NAV_CAT_DESC' => $nav_cat_desc, 'L_SORT_METHOD' => $sort_list_desc, 'S_SORT_METHOD' => $sort_list, 'L_ORDER' => $order_list_desc, 'S_ORDER' => $order_list, 'L_LEGEND' => $lang['Legend'], 'S_AUTH_LINE' => $s_auth_line, 'SEARCHBOX' => make_searchbox("search.php?mode=results", $forum_id), 'L_TOPICS' => $lang['Topics'], 'L_REPLIES' => $lang['Replies'], 'L_VIEWS' => $lang['Views'], 'L_POSTS' => $lang['Posts'], 'L_LASTPOST' => $lang['Last_Post'], 'L_MODERATOR' => $l_moderators, 'L_MARK_TOPICS_READ' => $lang['Mark_all_topics'], 'L_POST_NEW_TOPIC' => $forum_row['forum_status'] == FORUM_LOCKED ? $lang['Forum_locked'] : $lang['Post_new_topic'], 'L_NO_NEW_POSTS' => $lang['No_new_posts'], 'L_NEW_POSTS' => $lang['New_posts'], 'L_NO_NEW_POSTS_LOCKED' => $lang['No_new_posts_locked'], 'L_NEW_POSTS_LOCKED' => $lang['New_posts_locked'], 'L_NO_NEW_POSTS_HOT' => $lang['No_new_posts_hot'], 'L_NEW_POSTS_HOT' => $lang['New_posts_hot'], 'L_ANNOUNCEMENT' => $lang['Post_Announcement'], 'L_STICKY' => $lang['Post_Sticky'], 'L_POSTED' => $lang['Posted'], 'L_JOINED' => $lang['Joined'], 'L_AUTHOR' => $lang['Author'], 'S_AUTH_LIST' => $s_auth_can, 'U_VIEW_FORUM' => append_sid("viewforum.{$phpEx}?" . POST_FORUM_URL . "={$forum_id}"), 'U_MARK_READ' => append_sid("viewforum.{$phpEx}?" . POST_FORUM_URL . "={$forum_id}&mark=topics")));
//
// End header
//
//
// Okay, lets dump out the page ...
//
if ($total_topics) {
    // Begin PNphpBB2 Module (Split Annouce/Sticky)
    $prec_topic_real_type = -1;
    // End PNphpBB2 Module (Split Annouce/Sticky)
    for ($i = 0; $i < $total_topics; $i++) {
        $topic_id = $topic_rowset[$i]['topic_id'];
        $topic_title = count($orig_word) ? preg_replace($orig_word, $replacement_word, $topic_rowset[$i]['topic_title']) : $topic_rowset[$i]['topic_title'];
        // Begin PNphpBB2 Module (Support Status Mod)
        $topic_title_status = '';
Beispiel #2
0
                    $topic_author .= $searchset[$i]['user_id'] != ANONYMOUS ? '</a>' : '';
                    $first_post_time = create_date($board_config['default_dateformat'], $searchset[$i]['topic_time'], $board_config['board_timezone']);
                    $last_post_time = create_date($board_config['default_dateformat'], $searchset[$i]['post_time'], $board_config['board_timezone']);
                    // Begin PNphpBB2 Module
                    //				$last_post_author = ( $searchset[$i]['id2'] == ANONYMOUS ) ? ( ($searchset[$i]['post_username2'] != '' ) ? $searchset[$i]['post_username2'] . ' ' : $lang['Guest'] . ' ' ) : '<a href="' . append_sid("profile.$phpEx?mode=viewprofile&amp;" . POST_USERS_URL . '='  . $searchset[$i]['id2']) . '">' . $searchset[$i]['user2'] . '</a>';
                    $last_post_author = $searchset[$i]['id2'] == ANONYMOUS ? $searchset[$i]['post_username2'] != '' ? DataUtil::formatForDisplay($searchset[$i]['post_username2']) . ' ' : $lang['Guest'] . ' ' : '<a href="' . append_sid("profile.{$phpEx}?mode=viewprofile&amp;" . POST_USERS_URL . '=' . $searchset[$i]['id2']) . '">' . DataUtil::formatForDisplay($searchset[$i]['user2']) . '</a>';
                    // End PNphpBB2 Module
                    $last_post_url = '<a href="' . append_sid("viewtopic.{$phpEx}?" . POST_POST_URL . '=' . $searchset[$i]['topic_last_post_id']) . '#' . $searchset[$i]['topic_last_post_id'] . '"><img src="' . $images['icon_latest_reply'] . '" alt="' . $lang['View_latest_post'] . '" title="' . $lang['View_latest_post'] . '" border="0" /></a>';
                    $template->assign_block_vars('searchresults', array('FORUM_NAME' => $searchset[$i]['forum_name'], 'FORUM_ID' => $forum_id, 'TOPIC_ID' => $topic_id, 'FOLDER' => $folder_image, 'NEWEST_POST_IMG' => $newest_post_img, 'TOPIC_FOLDER_IMG' => $folder_image, 'GOTO_PAGE' => $goto_page, 'REPLIES' => $replies, 'TOPIC_TITLE' => $topic_title, 'TOPIC_TYPE' => $topic_type, 'VIEWS' => $views, 'TOPIC_AUTHOR' => $topic_author, 'FIRST_POST_TIME' => $first_post_time, 'LAST_POST_TIME' => $last_post_time, 'LAST_POST_AUTHOR' => $last_post_author, 'LAST_POST_IMG' => $last_post_url, 'L_TOPIC_FOLDER_ALT' => $folder_alt, 'U_VIEW_FORUM' => $forum_url, 'U_VIEW_TOPIC' => $topic_url));
                }
            }
            $base_url = "search.{$phpEx}?search_id={$search_id}";
            // Begin PNphpBB2 Module
            generate_pagination($base_url, $total_match_count, $per_page, $start);
            // End PNphpBB2 Module
            $template->assign_vars(array('L_AUTHOR' => $lang['Author'], 'L_MESSAGE' => $lang['Message'], 'L_FORUM' => $lang['Forum'], 'L_TOPICS' => $lang['Topics'], 'L_REPLIES' => $lang['Replies'], 'L_VIEWS' => $lang['Views'], 'L_POSTS' => $lang['Posts'], 'L_LASTPOST' => $lang['Last_Post'], 'L_POSTED' => $lang['Posted'], 'L_SUBJECT' => $lang['Subject'], 'SEARCHBOX' => make_searchbox(0)));
            $template->pparse('body');
            include $phpbb_root_path . 'includes/page_tail.' . $phpEx;
            return;
            // ZphpBB2 - added this return, as in page_tail.php db connection closes!
        } else {
            message_die(GENERAL_MESSAGE, $lang['No_search_match']);
        }
    }
}
// ZphpBB2 - section below is never executed??
//
// Search forum
//
$sql = "SELECT c.cat_title, c.cat_id, f.forum_name, f.forum_id  \n\tFROM " . CATEGORIES_TABLE . " c, " . FORUMS_TABLE . " f\n\tWHERE f.cat_id = c.cat_id \n\tORDER BY c.cat_order, f.forum_order";
$result = $db->sql_query($sql);