Vergleich admin/modules/config/plugins.php - 1.6.2 - 1.6.17

  Keine Änderungen   Hinzugefügt   Modifiziert   Entfernt
Zeile 6Zeile 6
 * Website: http://mybb.com
* License: http://mybb.com/about/license
*

 * Website: http://mybb.com
* License: http://mybb.com/about/license
*

 * $Id: plugins.php 5117 2010-07-26 04:09:21Z RyanGordon $

 * $Id$

 */

// Disallow direct access to this file for security reasons

 */

// Disallow direct access to this file for security reasons

Zeile 90Zeile 90
	$parser = new XMLParser($contents);
$tree = $parser->get_tree();


	$parser = new XMLParser($contents);
$tree = $parser->get_tree();


	if(!array_key_exists("results", $tree))

	if(!is_array($tree) || !isset($tree['results']))

	{
$page->output_inline_error($lang->error_communication_problem);
$page->output_footer();

	{
$page->output_inline_error($lang->error_communication_problem);
$page->output_footer();

Zeile 105Zeile 105
			unset($tree['results']['result']);
$tree['results']['result'][0] = $only_plugin;
}

			unset($tree['results']['result']);
$tree['results']['result'][0] = $only_plugin;
}

	





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


		foreach($tree['results']['result'] as $result)
{

		foreach($tree['results']['result'] as $result)
{

 
			$result['name']['value'] = htmlspecialchars_uni($result['name']['value']);
$result['description']['value'] = htmlspecialchars_uni($result['description']['value']);
$result['author']['value'] = $post_parser->parse_message($result['author']['value'], array(
'allow_html' => true
)
);
$result['version']['value'] = htmlspecialchars_uni($result['version']['value']);
$result['download_url']['value'] = htmlspecialchars_uni(html_entity_decode($result['download_url']['value']));


			$table->construct_cell("<strong>{$result['name']['value']}</strong><br /><small>{$result['description']['value']}</small><br /><i><small>{$lang->created_by} {$result['author']['value']}</small></i>");
$table->construct_cell($result['version']['value'], array("class" => "align_center"));
$table->construct_cell("<strong><a href=\"http://mods.mybb.com/view/{$result['download_url']['value']}\" target=\"_blank\">{$lang->download}</a></strong>", array("class" => "align_center"));
$table->construct_row();

			$table->construct_cell("<strong>{$result['name']['value']}</strong><br /><small>{$result['description']['value']}</small><br /><i><small>{$lang->created_by} {$result['author']['value']}</small></i>");
$table->construct_cell($result['version']['value'], array("class" => "align_center"));
$table->construct_cell("<strong><a href=\"http://mods.mybb.com/view/{$result['download_url']['value']}\" target=\"_blank\">{$lang->download}</a></strong>", array("class" => "align_center"));
$table->construct_row();

		}

		}

	}

if($table->num_rows() == 0)
{
$table->construct_cell($lang->error_no_results_found, array("colspan" => 3));
$table->construct_row();

	}

if($table->num_rows() == 0)
{
$table->construct_cell($lang->error_no_results_found, array("colspan" => 3));
$table->construct_row();

	}

	}

	
$search = new Form("index.php?module=config-plugins&amp;action=browse", 'post', 'search_form');
echo "<div style=\"padding-bottom: 3px; margin-top: -9px; text-align: right;\">";

	
$search = new Form("index.php?module=config-plugins&amp;action=browse", 'post', 'search_form');
echo "<div style=\"padding-bottom: 3px; margin-top: -9px; text-align: right;\">";

Zeile 140Zeile 152
		form.onsubmit = function() {
var search = document.getElementById('search_keywords');
if(search.value == '' || search.value == '{$lang->search_for_plugins}')

		form.onsubmit = function() {
var search = document.getElementById('search_keywords');
if(search.value == '' || search.value == '{$lang->search_for_plugins}')

			{

			{

				search.focus();
return false;
}

				search.focus();
return false;
}

Zeile 161Zeile 173
			{
$(this).addClassName('search_default');
this.value = '{$lang->search_for_plugins}';

			{
$(this).addClassName('search_default');
this.value = '{$lang->search_for_plugins}';

			}

			}

		}
// fix the styling used if we have a different default value
if(search.value != '{$lang->search_for_plugins}')

		}
// fix the styling used if we have a different default value
if(search.value != '{$lang->search_for_plugins}')

Zeile 174Zeile 186
	
// Recommended plugins = Default; Otherwise search results & pagination
if($mybb->request_method == "post")

	
// Recommended plugins = Default; Otherwise search results & pagination
if($mybb->request_method == "post")

	{

	{

		$table->output("<span style=\"float: right;\"><small><a href=\"http://mods.mybb.com/mods\" target=\"_blank\">{$lang->browse_all_plugins}</a></small></span>".$lang->sprintf($lang->browse_results_for_mybb, $mybb->version));

		$table->output("<span style=\"float: right;\"><small><a href=\"http://mods.mybb.com/mods\" target=\"_blank\">{$lang->browse_all_plugins}</a></small></span>".$lang->sprintf($lang->browse_results_for_mybb, $mybb->version));

	}

	}

	else
{
$table->output("<span style=\"float: right;\"><small><a href=\"http://mods.mybb.com/mods\" target=\"_blank\">{$lang->browse_all_plugins}</a></small></span>".$lang->sprintf($lang->recommended_plugins_for_mybb, $mybb->version));

	else
{
$table->output("<span style=\"float: right;\"><small><a href=\"http://mods.mybb.com/mods\" target=\"_blank\">{$lang->browse_all_plugins}</a></small></span>".$lang->sprintf($lang->recommended_plugins_for_mybb, $mybb->version));

	}


	}


	echo "<br />".draw_admin_pagination($mybb->input['page'], 15, $tree['results']['attributes']['total'], "index.php?module=config-plugins&amp;action=browse{$keywords}&amp;page={page}");

$page->output_footer();

	echo "<br />".draw_admin_pagination($mybb->input['page'], 15, $tree['results']['attributes']['total'], "index.php?module=config-plugins&amp;action=browse{$keywords}&amp;page={page}");

$page->output_footer();

Zeile 217Zeile 229
			}
}
$plugins->hooks = $active_hooks;

			}
}
$plugins->hooks = $active_hooks;

	}


	}


	if(empty($info))
{
flash_message($lang->error_vcheck_no_supported_plugins, 'error');

	if(empty($info))
{
flash_message($lang->error_vcheck_no_supported_plugins, 'error');

		admin_redirect("index.php?module=config-plugins");
}

$url = "http://mods.mybboard.net/version_check.php?";

		admin_redirect("index.php?module=config-plugins");
}

$url = "http://mods.mybb.com/version_check.php?";

	foreach($info as $guid)
{
$url .= "info[]=".urlencode($guid)."&";
}
$url = substr($url, 0, -1);

	foreach($info as $guid)
{
$url .= "info[]=".urlencode($guid)."&";
}
$url = substr($url, 0, -1);

	

	

	require_once MYBB_ROOT."inc/class_xml.php";
$contents = fetch_remote_file($url);

	require_once MYBB_ROOT."inc/class_xml.php";
$contents = fetch_remote_file($url);

	

	

	if(!$contents)
{
flash_message($lang->error_vcheck_communications_problem, 'error');

	if(!$contents)
{
flash_message($lang->error_vcheck_communications_problem, 'error');

Zeile 243Zeile 255
	
$parser = new XMLParser($contents);
$tree = $parser->get_tree();

	
$parser = new XMLParser($contents);
$tree = $parser->get_tree();

	









if(!is_array($tree) || !isset($tree['plugins']))
{
$page->output_inline_error($lang->error_communication_problem);
$page->output_footer();
exit;
}


	if(array_key_exists('error', $tree['plugins']))
{
switch($tree['plugins'][0]['error'])

	if(array_key_exists('error', $tree['plugins']))
{
switch($tree['plugins'][0]['error'])

Zeile 285Zeile 304
	{
if(version_compare($names[$plugin['attributes']['guid']]['version'], $plugin['version']['value'], "<"))
{

	{
if(version_compare($names[$plugin['attributes']['guid']]['version'], $plugin['version']['value'], "<"))
{

 
			$plugin['download_url']['value'] = htmlspecialchars_uni($plugin['download_url']['value']);
$plugin['version']['value'] = htmlspecialchars_uni($plugin['version']['value']);


			$table->construct_cell("<strong>{$names[$plugin['attributes']['guid']]['name']}</strong>");
$table->construct_cell("{$names[$plugin['attributes']['guid']]['version']}", array("class" => "align_center"));
$table->construct_cell("<strong><span style=\"color: #C00\">{$plugin['version']['value']}</span></strong>", array("class" => "align_center"));

			$table->construct_cell("<strong>{$names[$plugin['attributes']['guid']]['name']}</strong>");
$table->construct_cell("{$names[$plugin['attributes']['guid']]['version']}", array("class" => "align_center"));
$table->construct_cell("<strong><span style=\"color: #C00\">{$plugin['version']['value']}</span></strong>", array("class" => "align_center"));

			$table->construct_cell("<strong><a href=\"http://mods.mybboard.net/view/{$plugin['download_url']['value']}\" target=\"_blank\">{$lang->download}</a></strong>", array("class" => "align_center"));

			$table->construct_cell("<strong><a href=\"http://mods.mybb.com/view/{$plugin['download_url']['value']}\" target=\"_blank\">{$lang->download}</a></strong>", array("class" => "align_center"));

			$table->construct_row();
}
}

			$table->construct_row();
}
}

Zeile 296Zeile 318
	if($table->num_rows() == 0)
{
flash_message($lang->success_plugins_up_to_date, 'success');

	if($table->num_rows() == 0)
{
flash_message($lang->success_plugins_up_to_date, 'success');

		admin_redirect("index.php?module=config-plugins");

		admin_redirect("index.php?module=config-plugins");

	}

	}

	

	

	$page->add_breadcrumb_item($lang->plugin_updates);

	$page->add_breadcrumb_item($lang->plugin_updates);

	

	

	$page->output_header($lang->plugin_updates);

	$page->output_header($lang->plugin_updates);

	

	

	$sub_tabs['plugins'] = array(
'title' => $lang->plugins,
'link' => "index.php?module=config-plugins",

	$sub_tabs['plugins'] = array(
'title' => $lang->plugins,
'link' => "index.php?module=config-plugins",

Zeile 333Zeile 355
	if(!verify_post_check($mybb->input['my_post_key']))
{
flash_message($lang->invalid_post_verify_key2, 'error');

	if(!verify_post_check($mybb->input['my_post_key']))
{
flash_message($lang->invalid_post_verify_key2, 'error');

		admin_redirect("index.php?module=config-plugins");
}

		admin_redirect("index.php?module=config-plugins");
}

	
if($mybb->input['action'] == "activate")
{

	
if($mybb->input['action'] == "activate")
{

Zeile 505Zeile 527
			$installed_func = "{$codename}_is_installed";
$install_func = "{$codename}_install";
$uninstall_func = "{$codename}_uninstall";

			$installed_func = "{$codename}_is_installed";
$install_func = "{$codename}_install";
$uninstall_func = "{$codename}_uninstall";





			$installed = true;
$install_button = false;
$uninstall_button = false;

if(function_exists($installed_func) && $installed_func() != true)

			$installed = true;
$install_button = false;
$uninstall_button = false;

if(function_exists($installed_func) && $installed_func() != true)

			{

			{

				$installed = false;

				$installed = false;

			}

			}


if(function_exists($install_func))
{
$install_button = true;


if(function_exists($install_func))
{
$install_button = true;

			}

			}


if(function_exists($uninstall_func))
{


if(function_exists($uninstall_func))
{

Zeile 543Zeile 565
			else if($active_plugins[$codename])
{
$table->construct_cell("<a href=\"index.php?module=config-plugins&amp;action=deactivate&amp;plugin={$codename}&amp;my_post_key={$mybb->post_code}\">{$lang->deactivate}</a>", array("class" => "align_center", "width" => 150));

			else if($active_plugins[$codename])
{
$table->construct_cell("<a href=\"index.php?module=config-plugins&amp;action=deactivate&amp;plugin={$codename}&amp;my_post_key={$mybb->post_code}\">{$lang->deactivate}</a>", array("class" => "align_center", "width" => 150));

				if($uninstall_button)
{
$table->construct_cell("<a href=\"index.php?module=config-plugins&amp;action=deactivate&amp;uninstall=1&amp;plugin={$codename}&amp;my_post_key={$mybb->post_code}\">{$lang->uninstall}</a>", array("class" => "align_center", "width" => 150));
}

				if($uninstall_button)
{
$table->construct_cell("<a href=\"index.php?module=config-plugins&amp;action=deactivate&amp;uninstall=1&amp;plugin={$codename}&amp;my_post_key={$mybb->post_code}\">{$lang->uninstall}</a>", array("class" => "align_center", "width" => 150));
}

				else
{
$table->construct_cell("&nbsp;", array("class" => "align_center", "width" => 150));

				else
{
$table->construct_cell("&nbsp;", array("class" => "align_center", "width" => 150));

Zeile 555Zeile 577
			// Plugin is installed but not active
else if($installed == true)
{

			// Plugin is installed but not active
else if($installed == true)
{

				$table->construct_cell("<a href=\"index.php?module=config-plugins&amp;action=activate&amp;plugin={$codename}&amp;my_post_key={$mybb->post_code}\">{$lang->activate}</a>", array("class" => "align_center", "width" => 150));
if($uninstall_button)
{
$table->construct_cell("<a href=\"index.php?module=config-plugins&amp;action=deactivate&amp;uninstall=1&amp;plugin={$codename}&amp;my_post_key={$mybb->post_code}\">{$lang->uninstall}</a>", array("class" => "align_center", "width" => 150));

				if($compatibility_warning && !$uninstall_button)
{
$table->construct_cell("{$compatibility_warning}", array("class" => "align_center", "colspan" => 2));


				}
else
{

				}
else
{

					$table->construct_cell("&nbsp;", array("class" => "align_center", "width" => 150));









					$table->construct_cell("<a href=\"index.php?module=config-plugins&amp;action=activate&amp;plugin={$codename}&amp;my_post_key={$mybb->post_code}\">{$lang->activate}</a>", array("class" => "align_center", "width" => 150));
if($uninstall_button)
{
$table->construct_cell("<a href=\"index.php?module=config-plugins&amp;action=deactivate&amp;uninstall=1&amp;plugin={$codename}&amp;my_post_key={$mybb->post_code}\">{$lang->uninstall}</a>", array("class" => "align_center", "width" => 150));
}
else
{
$table->construct_cell("&nbsp;", array("class" => "align_center", "width" => 150));
}

				}
}
$table->construct_row();

				}
}
$table->construct_row();