예제 #1
0
파일: index.php 프로젝트: GeorgeLVP/mybb
        archive_multipage($threadcount, $perpage, $page, "{$base_url}forum-{$id}");
        $plugins->run_hooks("archive_forum_end");
        archive_footer();
        break;
        // Display the board home.
    // Display the board home.
    case "index":
        // Build our forum listing
        $forums = build_archive_forumbits(0);
        archive_header("", $mybb->settings['bbname_orig'], $mybb->settings['bburl'] . "/index.php");
        $plugins->run_hooks("archive_index_start");
        echo "<div class=\"listing forumlist\">\n<div class=\"header\">{$mybb->settings['bbname']}</div>\n<div class=\"forums\">\n<ul>\n";
        echo $forums;
        echo "\n</ul>\n</div>\n</div>";
        $plugins->run_hooks("archive_index_end");
        archive_footer();
        break;
    default:
        header("HTTP/1.0 404 Not Found");
        switch ($action2) {
            case "announcement":
                archive_error($lang->error_invalidannouncement);
            case "thread":
                archive_error($lang->error_invalidthread);
            case "forum":
                archive_error($lang->error_invalidforum);
            default:
                archive_error($lang->archive_not_found);
        }
}
$plugins->run_hooks("archive_end");
예제 #2
0
/**
 * Output an archive error.
 *
 * @param string The error language string identifier.
 */
function archive_error($error)
{
    global $lang, $mybb, $sent_header;
    if (!$sent_header) {
        archive_header("", $mybb->settings['bbname'], $mybb->settings['bburl'] . "/index.php");
    }
    ?>
<div class="error">
<div class="header"><?php 
    echo $lang->error;
    ?>
</div>
<div class="message"><?php 
    echo $error;
    ?>
</div>
</div>
<?php 
    archive_footer();
    exit;
}
예제 #3
0
function archive_main()
{
    global $mbname, $boardurl, $smcFunc, $user_info, $modSettings;
    archive_header($mbname, $boardurl);
    // Show cats
    echo '<div id="main"><ul>';
    $request1 = $smcFunc['db_query']('', "\n\tSELECT\n\t\tc.ID_CAT, c.cat_order, c.name\n\tFROM {db_prefix}categories AS c\n\tORDER BY c.cat_order ASC");
    while ($row1 = $smcFunc['db_fetch_assoc']($request1)) {
        $catid = $row1['ID_CAT'];
        $request2 = $smcFunc['db_query']('', "\n\t\t\tSELECT\n\t\t\t\tb.name, b.num_posts, b.ID_BOARD, b.ID_CAT, b.child_level, b.ID_PARENT, b.board_order\n\t\t\tFROM {db_prefix}boards AS b\n\t\t\t\tLEFT JOIN {db_prefix}log_boards AS lb ON (lb.ID_BOARD = b.ID_BOARD AND lb.ID_MEMBER = " . $user_info['id'] . ")\n\t\t\tWHERE {$user_info['query_see_board']}" . (!empty($modSettings['recycle_enable']) && $modSettings['recycle_board'] > 0 ? "\n\t\t\t\tAND b.ID_BOARD != " . (int) $modSettings['recycle_board'] : '') . " AND {$catid} = b.ID_CAT\n\t\t\t");
        $b_count = $smcFunc['db_affected_rows']();
        if ($b_count != 0) {
            echo '<li><b>' . $row1['name'] . '</b></li>';
            // List the forums and subforums
            echo '<ul>';
            while ($row2 = $smcFunc['db_fetch_assoc']($request2)) {
                echo '<li><a href="' . $boardurl . '/archive2.php?board=' . $row2['ID_BOARD'] . '.0">' . $row2['name'] . '</a> (' . $row2['num_posts'] . ' posts)</li>';
            }
            echo '</ul>';
        }
        $smcFunc['db_free_result']($request2);
    }
    $smcFunc['db_free_result']($request1);
    echo '</ul></div>';
    archive_footer();
}