Example #1
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;
}
Example #2
0
                 echo "<span class=\"replycount\"> ({$thread['replies']} {$lang_reply_text})</span></li>";
             }
             echo "</ol>\n</div>\n";
         }
     }
     echo "</div>\n";
     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":
        } else {
            for ($i = 0; $i < count($posts); $i++) {
                $posts[$i]->yomi = mb_convert_kana($posts[$i]->post_title, "KcV", $GLOBALS['blog_charset']);
            }
        }
        usort($posts, "cmp");
    }
    ?>

    <?php 
    if ($posts) {
        foreach ($posts as $post) {
            start_wp();
            ?>
    <?php 
            archive_header('<h3>', '</h3>');
            ?>
    <?php 
            archive_date('Y/m/d H:i:s');
            ?>
: <a href="<?php 
            echo get_permalink($post->ID);
            ?>
" rel="bookmark" title="Permanent Link: <?php 
            the_title();
            ?>
"><?php 
            the_title();
            ?>
</a><br />
    <?php 
Example #4
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();
}
}
if ($GLOBALS['wp_arc_display_keyword']) {
    show_keyword();
}
?>
<input type="submit" name="submit" value="<?php 
echo _LANG_NKA_ACTION_SORT;
?>
" />
</form>
<?php 
post_count_exceeds();
if ($posts) {
    foreach ($posts as $post) {
        start_wp();
        archive_header($post, '<h3>', '</h3>');
        archive_date($post, 'Y/m/d H:i');
        ?>
 : <a href="<?php 
        echo get_permalink($post->ID);
        ?>
" rel="bookmark" title="Permanent Link: <?php 
        the_title();
        ?>
"><?php 
        the_title();
        ?>
</a><br />
<?php 
    }
}