Vergleich admin/modules/home/index.php - 1.8.13 - 1.8.22

  Keine Änderungen   Hinzugefügt   Modifiziert   Entfernt
Zeile 53Zeile 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();

Zeile 77Zeile 66
		$version_warn = 1;
$updated_cache['latest_version'] = $latest_version;
$updated_cache['latest_version_code'] = $latest_code;

		$version_warn = 1;
$updated_cache['latest_version'] = $latest_version;
$updated_cache['latest_version_code'] = $latest_code;

	}
else

	}
else

	{
$latest_version = "<span style=\"color: green;\">".$latest_version."</span>";

	{
$latest_version = "<span style=\"color: green;\">".$latest_version."</span>";

	}


	}


	if($version_warn)
{
$page->output_error("<p><em>{$lang->error_out_of_date}</em> {$lang->update_forum}</p>");

	if($version_warn)
{
$page->output_error("<p><em>{$lang->error_out_of_date}</em> {$lang->update_forum}</p>");

	}

	}

	else
{
$page->output_success("<p><em>{$lang->success_up_to_date}</em></p>");
}

	else
{
$page->output_success("<p><em>{$lang->success_up_to_date}</em></p>");
}





	$table = new Table;
$table->construct_header($lang->your_version);
$table->construct_header($lang->latest_version);

$table->construct_cell("<strong>".$mybb->version."</strong> (".$mybb->version_code.")");
$table->construct_cell($latest_version);

	$table = new Table;
$table->construct_header($lang->your_version);
$table->construct_header($lang->latest_version);

$table->construct_cell("<strong>".$mybb->version."</strong> (".$mybb->version_code.")");
$table->construct_cell($latest_version);

	$table->construct_row();

$table->output($lang->version_check);

	$table->construct_row();

$table->output($lang->version_check);


require_once MYBB_ROOT."inc/class_feedparser.php";


require_once MYBB_ROOT."inc/class_feedparser.php";





	$feed_parser = new FeedParser();
$feed_parser->parse_feed("http://feeds.feedburner.com/MyBBDevelopmentBlog");

$updated_cache['news'] = array();

	$feed_parser = new FeedParser();
$feed_parser->parse_feed("http://feeds.feedburner.com/MyBBDevelopmentBlog");

$updated_cache['news'] = array();


require_once MYBB_ROOT . '/inc/class_parser.php';
$post_parser = new postParser();

 

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)
{
if(!isset($updated_cache['news'][2]))
{

		foreach($feed_parser->items as $item)
{
if(!isset($updated_cache['news'][2]))
{

				$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);


 
				$updated_cache['news'][] = array(

				$updated_cache['news'][] = array(

					'title' => htmlspecialchars_uni($item['title']),
'description' => $description,
'link' => htmlspecialchars_uni($item['link']),
'author' => htmlspecialchars_uni($item['author']),

					'title' => $item['title'],
'description' => $item['description'],
'link' => $item['link'],
'author' => $item['author'],

					'dateline' => $item['date_timestamp'],
);
}

					'dateline' => $item['date_timestamp'],
);
}

Zeile 146Zeile 119
			$stamp = '';
if($item['date_timestamp'])
{

			$stamp = '';
if($item['date_timestamp'])
{

				$stamp = my_date('relative', $item['date_timestamp']);

				$stamp = my_date('relative', (int)$item['date_timestamp']);

			}

$link = htmlspecialchars_uni($item['link']);

			}

$link = htmlspecialchars_uni($item['link']);

 
			$title = htmlspecialchars_uni($item['title']);
$description = htmlspecialchars_uni(strip_tags($item['description']));





			$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\">&raquo; {$lang->read_more}</a></strong>");

			$table->construct_cell("<span style=\"font-size: 16px;\"><strong>{$title}</strong></span><br /><br />{$description}<strong><span style=\"float: right;\">{$stamp}</span><br /><br /><a href=\"{$link}\" target=\"_blank\" rel=\"noopener\">&raquo; {$lang->read_more}</a></strong>");

			$table->construct_row();
}
}

			$table->construct_row();
}
}

Zeile 193Zeile 168
		'link' => "index.php",
'description' => $lang->dashboard_description
);

		'link' => "index.php",
'description' => $lang->dashboard_description
);





	$page->output_nav_tabs($sub_tabs, 'dashboard');

// Load stats cache

	$page->output_nav_tabs($sub_tabs, 'dashboard');

// Load stats cache

Zeile 263Zeile 238
	// 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"));





	// 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"));

	// 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);

	// 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);

Zeile 284Zeile 259

// Fetch the last time an update check was run
$update_check = $cache->read("update_check");


// Fetch the last time an update check was run
$update_check = $cache->read("update_check");





	// 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)
{

Zeile 297Zeile 272
	{
$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>");

	{
$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");

	$plugins->run_hooks("admin_home_index_output_message");

$adminmessage = $cache->read("adminnotes");

Zeile 367Zeile 342
	{
foreach($update_check['news'] as $news_item)
{

	{
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\" rel=\"noopener\">{$news_item['title']}</a></strong><br /><span class=\"smalltext\">{$posted}</span>");





			$posted = my_date('relative', (int)$news_item['dateline']);
$link = htmlspecialchars_uni($news_item['link']);
$title = htmlspecialchars_uni($news_item['title']);
$description = htmlspecialchars_uni(strip_tags($news_item['description']));

$table->construct_cell("<strong><a href=\"{$link}\" target=\"_blank\" rel=\"noopener\">{$title}</a></strong><br /><span class=\"smalltext\">{$posted}</span>");

			$table->construct_row();


			$table->construct_row();


			$table->construct_cell($news_item['description']);

			$table->construct_cell($description);

			$table->construct_row();
}
}

			$table->construct_row();
}
}