Zeile 39 | Zeile 39 |
---|
);
require_once MYBB_ROOT."inc/class_xml.php";
|
);
require_once MYBB_ROOT."inc/class_xml.php";
|
$contents = fetch_remote_file("http://www.mybb.com/version_check.php");
| $contents = fetch_remote_file("https://mybb.com/version_check.php");
|
if(!$contents) {
| if(!$contents) {
|
Zeile 53 | Zeile 53 |
---|
$page->output_header($lang->version_check); $page->output_nav_tabs($sub_tabs, 'version_check');
|
$page->output_header($lang->version_check); $page->output_nav_tabs($sub_tabs, 'version_check');
|
// We do this because there is some weird symbols that show up in the xml file for unknown reasons $pos = strpos($contents, "<"); if($pos > 1) { $contents = substr($contents, $pos); }
$pos = strpos(strrev($contents), ">"); if($pos > 1) { $contents = substr($contents, 0, (-1) * ($pos-1)); }
| $contents = trim($contents);
|
$parser = new XMLParser($contents); $tree = $parser->get_tree();
|
$parser = new XMLParser($contents); $tree = $parser->get_tree();
|
$latest_code = $tree['mybb']['version_code']['value']; $latest_version = "<strong>".$tree['mybb']['latest_version']['value']."</strong> (".$latest_code.")";
| $latest_code = (int)$tree['mybb']['version_code']['value']; $latest_version = "<strong>".htmlspecialchars_uni($tree['mybb']['latest_version']['value'])."</strong> (".$latest_code.")";
|
if($latest_code > $mybb->version_code) { $latest_version = "<span style=\"color: #C00;\">".$latest_version."</span>";
| if($latest_code > $mybb->version_code) { $latest_version = "<span style=\"color: #C00;\">".$latest_version."</span>";
|
Zeile 111 | Zeile 100 |
---|
if($feed_parser->error == '') {
|
if($feed_parser->error == '') {
|
| require_once MYBB_ROOT . '/inc/class_parser.php'; $post_parser = new postParser();
|
foreach($feed_parser->items as $item) {
|
foreach($feed_parser->items as $item) {
|
| $description = $item['description']; $content = $item['content'];
$description = $post_parser->parse_message($description, array( 'allow_html' => true, ) );
$content = $post_parser->parse_message($content, array( 'allow_html' => true, ) );
$description = preg_replace('#<img(.*)/>#', '', $description); $content = preg_replace('#<img(.*)/>#', '', $content);
|
if(!isset($updated_cache['news'][2])) { $updated_cache['news'][] = array(
|
if(!isset($updated_cache['news'][2])) { $updated_cache['news'][] = array(
|
'title' => $item['title'], 'description' => preg_replace('#<img(.*)/>#', '', $item['description']), 'link' => $item['link'], 'author' => $item['author'], 'dateline' => $item['date_timestamp']
| 'title' => htmlspecialchars_uni($item['title']), 'description' => $description, 'link' => htmlspecialchars_uni($item['link']), 'author' => htmlspecialchars_uni($item['author']), 'dateline' => $item['date_timestamp'],
|
);
|
);
|
}
| }
|
$stamp = ''; if($item['date_timestamp'])
| $stamp = ''; if($item['date_timestamp'])
|
Zeile 130 | Zeile 138 |
---|
$stamp = my_date('relative', $item['date_timestamp']); }
|
$stamp = my_date('relative', $item['date_timestamp']); }
|
$content = $item['description']; if($item['content']) { $content = $item['content']; }
$table->construct_cell("<span style=\"font-size: 16px;\"><strong>".$item['title']."</strong></span><br /><br />{$content}<strong><span style=\"float: right;\">{$stamp}</span><br /><br /><a href=\"{$item['link']}\" target=\"_blank\">» {$lang->read_more}</a></strong>");
| $link = htmlspecialchars_uni($item['link']);
$table->construct_cell("<span style=\"font-size: 16px;\"><strong>".htmlspecialchars_uni($item['title'])."</strong></span><br /><br />{$content}<strong><span style=\"float: right;\">{$stamp}</span><br /><br /><a href=\"{$link}\" target=\"_blank\" rel=\"noopener\">» {$lang->read_more}</a></strong>");
|
$table->construct_row(); } }
| $table->construct_row(); } }
|
Zeile 147 | Zeile 151 |
---|
}
$cache->update("update_check", $updated_cache);
|
}
$cache->update("update_check", $updated_cache);
|
|
|
$table->output($lang->latest_mybb_announcements); $page->output_footer(); } elseif(!$mybb->input['action']) { $plugins->run_hooks("admin_home_index_start");
|
$table->output($lang->latest_mybb_announcements); $page->output_footer(); } elseif(!$mybb->input['action']) { $plugins->run_hooks("admin_home_index_start");
|
|
|
if($mybb->request_method == "post" && isset($mybb->input['adminnotes'])) { // Update Admin Notes cache
| if($mybb->request_method == "post" && isset($mybb->input['adminnotes'])) { // Update Admin Notes cache
|
Zeile 209 | Zeile 213 |
---|
else { $awaitingusers = my_number_format($awaitingusers);
|
else { $awaitingusers = my_number_format($awaitingusers);
|
}
| }
|
// Get the number of new users for today $timecut = TIME_NOW - 86400;
| // Get the number of new users for today $timecut = TIME_NOW - 86400;
|
Zeile 237 | Zeile 241 |
---|
if($stats['numunapprovedposts'] < 0) { $stats['numunapprovedposts'] = 0;
|
if($stats['numunapprovedposts'] < 0) { $stats['numunapprovedposts'] = 0;
|
}
| }
|
$unapproved_posts = my_number_format($stats['numunapprovedposts']);
// Get the number of new posts for today $query = $db->simple_select("posts", "COUNT(*) AS newposts", "dateline > '$timecut' AND visible='1'"); $newposts = my_number_format($db->fetch_field($query, "newposts"));
|
$unapproved_posts = my_number_format($stats['numunapprovedposts']);
// Get the number of new posts for today $query = $db->simple_select("posts", "COUNT(*) AS newposts", "dateline > '$timecut' AND visible='1'"); $newposts = my_number_format($db->fetch_field($query, "newposts"));
|
|
|
// Get the number of reported post $query = $db->simple_select("reportedcontent", "COUNT(*) AS reported_posts", "type = 'post' OR type = ''"); $reported_posts = my_number_format($db->fetch_field($query, "reported_posts"));
|
// Get the number of reported post $query = $db->simple_select("reportedcontent", "COUNT(*) AS reported_posts", "type = 'post' OR type = ''"); $reported_posts = my_number_format($db->fetch_field($query, "reported_posts"));
|
// Get the number of reported posts that haven't been marked as read yet $query = $db->simple_select("reportedcontent", "COUNT(*) AS new_reported_posts", "reportstatus='0' AND (type = 'post' OR type = '')"); $new_reported_posts = my_number_format($db->fetch_field($query, "new_reported_posts"));
| // If report medium is MCP... if($mybb->settings['reportmethod'] == "db") { // Get the number of reported posts that haven't been marked as read yet $query = $db->simple_select("reportedcontent", "COUNT(*) AS new_reported_posts", "reportstatus='0' AND (type = 'post' OR type = '')"); $new_reported_posts = my_number_format($db->fetch_field($query, "new_reported_posts")); }
|
// Get the number and total file size of attachments $query = $db->simple_select("attachments", "COUNT(*) AS numattachs, SUM(filesize) as spaceused", "visible='1' AND pid > '0'"); $attachs = $db->fetch_array($query); $attachs['spaceused'] = get_friendly_size($attachs['spaceused']); $approved_attachs = my_number_format($attachs['numattachs']);
|
// Get the number and total file size of attachments $query = $db->simple_select("attachments", "COUNT(*) AS numattachs, SUM(filesize) as spaceused", "visible='1' AND pid > '0'"); $attachs = $db->fetch_array($query); $attachs['spaceused'] = get_friendly_size($attachs['spaceused']); $approved_attachs = my_number_format($attachs['numattachs']);
|
|
|
// Get the number of unapproved attachments $query = $db->simple_select("attachments", "COUNT(*) AS numattachs", "visible='0' AND pid > '0'"); $unapproved_attachs = my_number_format($db->fetch_field($query, "numattachs"));
| // Get the number of unapproved attachments $query = $db->simple_select("attachments", "COUNT(*) AS numattachs", "visible='0' AND pid > '0'"); $unapproved_attachs = my_number_format($db->fetch_field($query, "numattachs"));
|
Zeile 268 | Zeile 276 |
---|
// If last update check was greater than two weeks ago (14 days) show an alert if(isset($update_check['last_check']) && $update_check['last_check'] <= TIME_NOW-60*60*24*14)
|
// If last update check was greater than two weeks ago (14 days) show an alert if(isset($update_check['last_check']) && $update_check['last_check'] <= TIME_NOW-60*60*24*14)
|
{
| {
|
$lang->last_update_check_two_weeks = $lang->sprintf($lang->last_update_check_two_weeks, "index.php?module=home&action=version_check"); $page->output_error("<p>{$lang->last_update_check_two_weeks}</p>");
|
$lang->last_update_check_two_weeks = $lang->sprintf($lang->last_update_check_two_weeks, "index.php?module=home&action=version_check"); $page->output_error("<p>{$lang->last_update_check_two_weeks}</p>");
|
}
| }
|
// If the update check contains information about a newer version, show an alert if(isset($update_check['latest_version_code']) && $update_check['latest_version_code'] > $mybb->version_code)
|
// If the update check contains information about a newer version, show an alert if(isset($update_check['latest_version_code']) && $update_check['latest_version_code'] > $mybb->version_code)
|
{ $lang->new_version_available = $lang->sprintf($lang->new_version_available, "MyBB {$mybb->version}", "<a href=\"http://www.mybb.com/downloads\" target=\"_blank\">MyBB {$update_check['latest_version']}</a>");
| { $lang->new_version_available = $lang->sprintf($lang->new_version_available, "MyBB {$mybb->version}", "<a href=\"https://mybb.com/download\" target=\"_blank\" rel=\"noopener\">MyBB {$update_check['latest_version']}</a>");
|
$page->output_error("<p><em>{$lang->new_version_available}</em></p>"); }
$plugins->run_hooks("admin_home_index_output_message");
$adminmessage = $cache->read("adminnotes");
|
$page->output_error("<p><em>{$lang->new_version_available}</em></p>"); }
$plugins->run_hooks("admin_home_index_output_message");
$adminmessage = $cache->read("adminnotes");
|
|
|
$table = new Table; $table->construct_header($lang->mybb_server_stats, array("colspan" => 2)); $table->construct_header($lang->forum_stats, array("colspan" => 2));
| $table = new Table; $table->construct_header($lang->mybb_server_stats, array("colspan" => 2)); $table->construct_header($lang->forum_stats, array("colspan" => 2));
|
Zeile 297 | Zeile 305 |
---|
$table->construct_cell("<strong>{$lang->php_version}</strong>", array('width' => '25%')); $table->construct_cell(PHP_VERSION, array('width' => '25%')); $table->construct_cell("<strong>{$lang->posts}</strong>", array('width' => '25%'));
|
$table->construct_cell("<strong>{$lang->php_version}</strong>", array('width' => '25%')); $table->construct_cell(PHP_VERSION, array('width' => '25%')); $table->construct_cell("<strong>{$lang->posts}</strong>", array('width' => '25%'));
|
$table->construct_cell("<strong>{$posts}</strong> {$lang->posts}<br /><strong>{$newposts}</strong> {$lang->new_today}<br /><a href=\"index.php?module=forum-moderation_queue&type=posts\"><strong>{$unapproved_posts}</strong> {$lang->unapproved}</a><br /><strong>{$reported_posts}</strong> {$lang->reported_posts}<br /><strong>{$new_reported_posts}</strong> {$lang->unread_reports}", array('width' => '25%'));
| if($mybb->settings['reportmethod'] == "db") { $table->construct_cell("<strong>{$posts}</strong> {$lang->posts}<br /><strong>{$newposts}</strong> {$lang->new_today}<br /><a href=\"index.php?module=forum-moderation_queue&type=posts\"><strong>{$unapproved_posts}</strong> {$lang->unapproved}</a><br /><strong>{$reported_posts}</strong> {$lang->reported_posts}<br /><strong>{$new_reported_posts}</strong> {$lang->unread_reports}", array('width' => '25%')); } else { $table->construct_cell("<strong>{$posts}</strong> {$lang->posts}<br /><strong>{$newposts}</strong> {$lang->new_today}<br /><a href=\"index.php?module=forum-moderation_queue&type=posts\"><strong>{$unapproved_posts}</strong> {$lang->unapproved}</a><br /><strong>{$reported_posts}</strong> {$lang->reported_posts}", array('width' => '25%')); }
|
$table->construct_row();
$table->construct_cell("<strong>{$lang->sql_engine}</strong>", array('width' => '25%')); $table->construct_cell($db->short_title." ".$db->get_version(), array('width' => '25%')); $table->construct_cell("<strong>{$lang->users}</strong>", array('width' => '25%'));
|
$table->construct_row();
$table->construct_cell("<strong>{$lang->sql_engine}</strong>", array('width' => '25%')); $table->construct_cell($db->short_title." ".$db->get_version(), array('width' => '25%')); $table->construct_cell("<strong>{$lang->users}</strong>", array('width' => '25%'));
|
$table->construct_cell("<a href=\"index.php?module=user-users\"><strong>{$users}</strong> {$lang->registered_users}</a><br /><strong>{$activeusers}</strong> {$lang->active_users}<br /><strong>{$newusers}</strong> {$lang->registrations_today}<br /><a href=\"index.php?module=user-users&action=search&results=1&conditions=".urlencode(serialize(array('usergroup' => '5')))."&from=home\"><strong>{$awaitingusers}</strong> {$lang->awaiting_activation}</a>", array('width' => '25%'));
| $table->construct_cell("<a href=\"index.php?module=user-users\"><strong>{$users}</strong> {$lang->registered_users}</a><br /><strong>{$activeusers}</strong> {$lang->active_users}<br /><strong>{$newusers}</strong> {$lang->registrations_today}<br /><a href=\"index.php?module=user-awaiting_activation\"><strong>{$awaitingusers}</strong> {$lang->awaiting_activation}</a>", array('width' => '25%'));
|
$table->construct_row();
$table->construct_cell("<strong>{$lang->server_load}</strong>", array('width' => '25%'));
| $table->construct_row();
$table->construct_cell("<strong>{$lang->server_load}</strong>", array('width' => '25%'));
|
Zeile 342 | Zeile 357 |
---|
foreach($update_check['news'] as $news_item) { $posted = my_date('relative', $news_item['dateline']);
|
foreach($update_check['news'] as $news_item) { $posted = my_date('relative', $news_item['dateline']);
|
$table->construct_cell("<strong><a href=\"{$news_item['link']}\" target=\"_blank\">{$news_item['title']}</a></strong><br /><span class=\"smalltext\">{$posted}</span>");
| $table->construct_cell("<strong><a href=\"{$news_item['link']}\" target=\"_blank\" rel=\"noopener\">{$news_item['title']}</a></strong><br /><span class=\"smalltext\">{$posted}</span>");
|
$table->construct_row();
|
$table->construct_row();
|
$table->construct_cell(htmlspecialchars_uni($news_item['description']));
| $table->construct_cell($news_item['description']);
|
$table->construct_row(); } }
| $table->construct_row(); } }
|