Zeile 3 | Zeile 3 |
---|
* MyBB 1.2 * Copyright © 2006 MyBB Group, All Rights Reserved *
|
* MyBB 1.2 * Copyright © 2006 MyBB Group, All Rights Reserved *
|
* Website: http://www.mybboard.com * License: http://www.mybboard.com/eula.html
| * Website: http://www.mybboard.net * License: http://www.mybboard.net/eula.html
|
*
|
*
|
* $Id: index.php 2164 2006-08-30 06:17:49Z chris $
| * $Id: index.php 3717 2008-03-16 22:09:01Z Tikitiki $
|
*/
define("IN_MYBB", 1);
| */
define("IN_MYBB", 1);
|
Zeile 15 | Zeile 15 |
---|
require_once MYBB_ROOT."inc/functions_post.php"; // Load global language phrases $lang->load("index");
|
require_once MYBB_ROOT."inc/functions_post.php"; // Load global language phrases $lang->load("index");
|
| $plugins->run_hooks("archive_start");
|
switch($action) {
| switch($action) {
|
Zeile 25 | Zeile 27 |
---|
{ $forum = get_forum($announcement['fid']); if(!$forum['fid'] || $forum['password'] != '')
|
{ $forum = get_forum($announcement['fid']); if(!$forum['fid'] || $forum['password'] != '')
|
{
| {
|
archive_error($lang->error_invalidforum);
|
archive_error($lang->error_invalidforum);
|
}
| }
|
// Check if we have permission to view this thread $forumpermissions = forum_permissions($forum['fid']);
| // Check if we have permission to view this thread $forumpermissions = forum_permissions($forum['fid']);
|
Zeile 35 | Zeile 37 |
---|
{ archive_error_no_permission(); }
|
{ archive_error_no_permission(); }
|
| check_forum_password_archive($forum['fid']);
|
} $announcement['subject'] = htmlspecialchars_uni($parser->parse_badwords($announcement['subject']));
| } $announcement['subject'] = htmlspecialchars_uni($parser->parse_badwords($announcement['subject']));
|
Zeile 57 | Zeile 61 |
---|
// Format announcement contents. $announcement['startdate'] = my_date($mybb->settings['dateformat'].", ".$mybb->settings['timeformat'], $announcement['startdate']);
|
// Format announcement contents. $announcement['startdate'] = my_date($mybb->settings['dateformat'].", ".$mybb->settings['timeformat'], $announcement['startdate']);
|
| $plugins->run_hooks("archive_announcement_start");
|
echo "<div class=\"post\">\n<div class=\"header\">\n<h2>{$announcement['subject']} - {$profile_link}</h2>"; echo "<div class=\"dateline\">{$announcement['startdate']}</div>\n</div>\n<div class=\"message\">{$announcement['message']}</div>\n</div>\n";
|
echo "<div class=\"post\">\n<div class=\"header\">\n<h2>{$announcement['subject']} - {$profile_link}</h2>"; echo "<div class=\"dateline\">{$announcement['startdate']}</div>\n</div>\n<div class=\"message\">{$announcement['message']}</div>\n</div>\n";
|
| $plugins->run_hooks("archive_announcement_end");
|
archive_footer(); break;
| archive_footer(); break;
|
Zeile 67 | Zeile 75 |
---|
// Display a thread. case "thread": $thread['subject'] = htmlspecialchars_uni($parser->parse_badwords($thread['subject']));
|
// Display a thread. case "thread": $thread['subject'] = htmlspecialchars_uni($parser->parse_badwords($thread['subject']));
|
|
|
// Fetch the forum this thread is in $forum = get_forum($thread['fid']); if(!$forum['fid'] || $forum['password'] != '')
| // Fetch the forum this thread is in $forum = get_forum($thread['fid']); if(!$forum['fid'] || $forum['password'] != '')
|
Zeile 81 | Zeile 89 |
---|
{ archive_error_no_permission(); }
|
{ archive_error_no_permission(); }
|
| check_forum_password_archive($forum['fid']);
|
// Build the navigation build_forum_breadcrumb($forum['fid'], 1); add_breadcrumb($thread['subject']);
archive_header($thread['subject'], $thread['subject'], $mybb->settings['bburl']."/showthread.php?tid=$id");
|
// Build the navigation build_forum_breadcrumb($forum['fid'], 1); add_breadcrumb($thread['subject']);
archive_header($thread['subject'], $thread['subject'], $mybb->settings['bburl']."/showthread.php?tid=$id");
|
| $plugins->run_hooks("archive_thread_start");
|
// Paginate this thread $perpage = $mybb->settings['postsperpage'];
| // Paginate this thread $perpage = $mybb->settings['postsperpage'];
|
Zeile 97 | Zeile 110 |
---|
$page = 1; } if($page)
|
$page = 1; } if($page)
|
{
| {
|
$start = ($page-1) * $perpage; } else
| $start = ($page-1) * $perpage; } else
|
Zeile 108 | Zeile 121 |
---|
$pids = array(); // Fetch list of post IDs to be shown
|
$pids = array(); // Fetch list of post IDs to be shown
|
$query = $db->simple_select(TABLE_PREFIX."posts", "pid", "tid='{$id}' AND visible='1'", array('limit_start' => $start, 'limit' => $perpage));
| $query = $db->simple_select(TABLE_PREFIX."posts", "pid", "tid='{$id}' AND visible='1'", array('order_by' => 'dateline', 'limit_start' => $start, 'limit' => $perpage));
|
while($post = $db->fetch_array($query)) { $pids[$post['pid']] = $post['pid'];
| while($post = $db->fetch_array($query)) { $pids[$post['pid']] = $post['pid'];
|
Zeile 141 | Zeile 154 |
---|
// Parse the message $parser_options = array(
|
// Parse the message $parser_options = array(
|
"allow_html" => $forum['allow_html'], "allow_mycode" => $forum['allow_mycode'],
| "allow_html" => $forum['allowhtml'], "allow_mycode" => $forum['allowmycode'],
|
"allow_smilies" => $forum['allowsmilies'], "allow_imgcode" => $forum['allowimgcode'], "me_username" => $post['username']
| "allow_smilies" => $forum['allowsmilies'], "allow_imgcode" => $forum['allowimgcode'], "me_username" => $post['username']
|
Zeile 159 | Zeile 172 |
---|
{ foreach($acache[$post['pid']] as $aid => $attachment) {
|
{ foreach($acache[$post['pid']] as $aid => $attachment) {
|
$post['message'] = str_replace("[attachment=$attachment[aid]]", "[<a href=\"".$mybb->settings['bburl']."/attachment.php?aid=$attachment[aid]\">attachment=$attachment[aid]</a>]", $post['message']);
| $post['message'] = str_replace("[attachment={$attachment['aid']}]", "[<a href=\"".$mybb->settings['bburl']."/attachment.php?aid={$attachment['aid']}\">attachment={$attachment['aid']}</a>]", $post['message']);
|
} }
| } }
|
Zeile 168 | Zeile 181 |
---|
{ $post['username'] = "<a href=\"".$mybb->settings['bburl']."/member.php?action=profile&uid=".$post['uid']."\">".$post['userusername']."</a>"; }
|
{ $post['username'] = "<a href=\"".$mybb->settings['bburl']."/member.php?action=profile&uid=".$post['uid']."\">".$post['userusername']."</a>"; }
|
| $plugins->run_hooks("archive_thread_post");
|
// Finally show the post echo "<div class=\"post\">\n<div class=\"header\">\n<div class=\"author\"><h2>{$post['username']}</h2></div>"; echo "<div class=\"dateline\">{$post['date']}</div>\n</div>\n<div class=\"message\">{$post['message']}</div>\n</div>\n"; } archive_multipage($postcount, $perpage, $page, "{$base_url}thread-$id");
|
// Finally show the post echo "<div class=\"post\">\n<div class=\"header\">\n<div class=\"author\"><h2>{$post['username']}</h2></div>"; echo "<div class=\"dateline\">{$post['date']}</div>\n</div>\n<div class=\"message\">{$post['message']}</div>\n</div>\n"; } archive_multipage($postcount, $perpage, $page, "{$base_url}thread-$id");
|
| $plugins->run_hooks("archive_thread_end");
|
archive_footer(); break;
| archive_footer(); break;
|
Zeile 186 | Zeile 203 |
---|
{ archive_error_no_permission(); }
|
{ archive_error_no_permission(); }
|
| check_forum_password_archive($forum['fid']);
|
// Paginate this forum $query = $db->simple_select(TABLE_PREFIX."threads", "COUNT(tid) AS threads", "fid='{$id}' AND visible='1'");
| // Paginate this forum $query = $db->simple_select(TABLE_PREFIX."threads", "COUNT(tid) AS threads", "fid='{$id}' AND visible='1'");
|
Zeile 193 | Zeile 212 |
---|
// Build the navigation build_forum_breadcrumb($forum['fid'], 1);
|
// Build the navigation build_forum_breadcrumb($forum['fid'], 1);
|
|
|
// No threads and not a category? Error! if($threadcount < 1 && $forum['type'] != 'c') {
| // No threads and not a category? Error! if($threadcount < 1 && $forum['type'] != 'c') {
|
Zeile 203 | Zeile 222 |
---|
// Build the archive header. archive_header($forum['name'], $forum['name'], $mybb->settings['bburl']."/forumdisplay.php?fid={$id}");
|
// Build the archive header. archive_header($forum['name'], $forum['name'], $mybb->settings['bburl']."/forumdisplay.php?fid={$id}");
|
| $plugins->run_hooks("archive_forum_start");
|
$perpage = $mybb->settings['threadsperpage']; $pages = ceil($threadcount/$perpage); if($page > $pages)
|
$perpage = $mybb->settings['threadsperpage']; $pages = ceil($threadcount/$perpage); if($page > $pages)
|
{ $page = 1; } if($page) {
| { $page = 1; } if($page > 0) {
|
$start = ($page-1) * $perpage; } else
| $start = ($page-1) * $perpage; } else
|
Zeile 221 | Zeile 242 |
---|
}
// Decide what type of listing to show.
|
}
// Decide what type of listing to show.
|
if($forum['type'] == 'f') { echo "<div class=\"listing\">\n<div class=\"header\"><h2>{$forum['name']}</h2></div>\n";
| if($forum['type'] == 'f') { echo "<div class=\"listing\">\n<div class=\"header\"><h2>{$forum['name']}</h2></div>\n";
|
} elseif($forum['type'] == 'c') { echo "<div class=\"listing\">\n<div class=\"header\"><h2>{$forum['name']}</h2></div>\n";
|
} elseif($forum['type'] == 'c') { echo "<div class=\"listing\">\n<div class=\"header\"><h2>{$forum['name']}</h2></div>\n";
|
}
| }
|
// Show subforums. $query = $db->simple_select(TABLE_PREFIX."forums", "COUNT(fid) AS subforums", "pid='{$id}' AND status='1'"); $subforumcount = $db->fetch_field($query, "subforums"); if($subforumcount > 0)
|
// Show subforums. $query = $db->simple_select(TABLE_PREFIX."forums", "COUNT(fid) AS subforums", "pid='{$id}' AND status='1'"); $subforumcount = $db->fetch_field($query, "subforums"); if($subforumcount > 0)
|
{
| {
|
echo "<div class=\"forumlist\">\n"; echo "<h3>{$lang->subforums}</h3>\n"; echo "<ol>\n";
| echo "<div class=\"forumlist\">\n"; echo "<h3>{$lang->subforums}</h3>\n"; echo "<ol>\n";
|
Zeile 246 | Zeile 267 |
---|
// Get the announcements if the forum is not a category. if($forum['type'] == 'f') {
|
// Get the announcements if the forum is not a category. if($forum['type'] == 'f') {
|
$sql = build_parent_list($forum['fid'], "fid", "OR", $form['parentlist']);
| $sql = build_parent_list($forum['fid'], "fid", "OR", $forum['parentlist']);
|
$time = time(); $query = $db->simple_select(TABLE_PREFIX."announcements", "*", "startdate < '{$time}' AND (enddate > '{$time}' OR enddate=0) AND ({$sql} OR fid='-1')"); if($db->num_rows($query) > 0)
| $time = time(); $query = $db->simple_select(TABLE_PREFIX."announcements", "*", "startdate < '{$time}' AND (enddate > '{$time}' OR enddate=0) AND ({$sql} OR fid='-1')"); if($db->num_rows($query) > 0)
|
Zeile 260 | Zeile 281 |
---|
} echo "</ol>\n</div>\n"; }
|
} echo "</ol>\n</div>\n"; }
|
|
|
}
// Get the stickies if the forum is not a category.
|
}
// Get the stickies if the forum is not a category.
|
if($forum['type'] == 'f') {
| if($forum['type'] == 'f') {
|
$options = array( 'order_by' => 'sticky, lastpost', 'order_dir' => 'desc',
| $options = array( 'order_by' => 'sticky, lastpost', 'order_dir' => 'desc',
|
Zeile 281 | Zeile 302 |
---|
while($sticky = $db->fetch_array($query)) { if($sticky['replies'] != 1)
|
while($sticky = $db->fetch_array($query)) { if($sticky['replies'] != 1)
|
{
| {
|
$lang_reply_text = $lang->archive_replies; } else { $lang_reply_text = $lang->archive_reply;
|
$lang_reply_text = $lang->archive_replies; } else { $lang_reply_text = $lang->archive_reply;
|
}
| }
$plugins->run_hooks("archive_forum_thread");
|
echo "<li><a href=\"{$base_url}thread-{$sticky['tid']}.html\">{$sticky['subject']}</a>"; echo "<span class=\"replycount\"> ({$sticky['replies']} {$lang_reply_text})</span></li>"; }
| echo "<li><a href=\"{$base_url}thread-{$sticky['tid']}.html\">{$sticky['subject']}</a>"; echo "<span class=\"replycount\"> ({$sticky['replies']} {$lang_reply_text})</span></li>"; }
|
Zeile 321 | Zeile 345 |
---|
{ $lang_reply_text = $lang->archive_reply; }
|
{ $lang_reply_text = $lang->archive_reply; }
|
| $plugins->run_hooks("archive_forum_thread");
|
echo "<li><a href=\"{$base_url}thread-{$thread['tid']}.html\">{$thread['subject']}</a>"; echo "<span class=\"replycount\"> ({$thread['replies']} {$lang_reply_text})</span></li>"; } echo "</ol>\n</div>\n"; } }
|
echo "<li><a href=\"{$base_url}thread-{$thread['tid']}.html\">{$thread['subject']}</a>"; 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");
|
echo "</div>\n";
archive_multipage($threadcount, $perpage, $page, "{$base_url}forum-$id");
|
archive_footer();
| $plugins->run_hooks("archive_forum_end");
archive_footer();
|
break;
// Display the board home.
| break;
// Display the board home.
|
Zeile 339 | Zeile 369 |
---|
// Build our forum listing $forums = build_archive_forumbits(0); archive_header("", $mybb->settings['bbname'], $mybb->settings['bburl']."/index.php");
|
// Build our forum listing $forums = build_archive_forumbits(0); archive_header("", $mybb->settings['bbname'], $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>";
|
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"); echo $lang->archive_not_found;
|
archive_footer(); break; default: header("HTTP/1.0 404 Not Found"); echo $lang->archive_not_found;
|
exit;
| |
}
|
}
|
| $plugins->run_hooks("archive_end");
|
/** * Gets a list of forums and possibly subforums.
| /** * Gets a list of forums and possibly subforums.
|