Vergleich admin/modules/style/themes.php - 1.8.4 - 1.8.7

  Keine Änderungen   Hinzugefügt   Modifiziert   Entfernt
Zeile 614Zeile 614
		{
if(strpos($filename, 'css.php?stylesheet=') !== false)
{

		{
if(strpos($filename, 'css.php?stylesheet=') !== false)
{

				$style['sid'] = (integer)str_replace('css.php?stylesheet=', '', $filename);

				$style['sid'] = (int)str_replace('css.php?stylesheet=', '', $filename);

				$filename = $theme_stylesheets[$style['sid']];
}
else

				$filename = $theme_stylesheets[$style['sid']];
}
else

Zeile 756Zeile 756
		{
$query = $db->simple_select("themes", "COUNT(tid) as numthemes", "name = '".$db->escape_string($mybb->get_input('name'))."'");
$numthemes = $db->fetch_field($query, 'numthemes');

		{
$query = $db->simple_select("themes", "COUNT(tid) as numthemes", "name = '".$db->escape_string($mybb->get_input('name'))."'");
$numthemes = $db->fetch_field($query, 'numthemes');

			



			if($numthemes)
{
$errors[] = $lang->error_theme_already_exists;

			if($numthemes)
{
$errors[] = $lang->error_theme_already_exists;

Zeile 766Zeile 766
		if(!$errors)
{
$properties = my_unserialize($theme['properties']);

		if(!$errors)
{
$properties = my_unserialize($theme['properties']);

			$sid = $properties['sid'];

			$sid = $properties['templateset'];

			$nprops = null;
if($mybb->input['duplicate_templates'])
{

			$nprops = null;
if($mybb->input['duplicate_templates'])
{

Zeile 1010Zeile 1010
		while($cachefile = $db->fetch_array($query))
{
@unlink(MYBB_ROOT."cache/themes/theme{$theme['tid']}/{$cachefile['cachefile']}");

		while($cachefile = $db->fetch_array($query))
{
@unlink(MYBB_ROOT."cache/themes/theme{$theme['tid']}/{$cachefile['cachefile']}");

 

$filename_min = str_replace('.css', '.min.css', $cachefile['cachefile']);
@unlink(MYBB_ROOT."cache/themes/theme{$theme['tid']}/{$filename_min}");

		}
@unlink(MYBB_ROOT."cache/themes/theme{$theme['tid']}/index.html");


		}
@unlink(MYBB_ROOT."cache/themes/theme{$theme['tid']}/index.html");


Zeile 1092Zeile 1095
		}

$theme_properties = my_unserialize($theme['properties']);

		}

$theme_properties = my_unserialize($theme['properties']);

		if($theme_properties['disporder'])

		if(is_array($theme_properties['disporder']))

		{
$properties['disporder'] = $theme_properties['disporder'];

		{
$properties['disporder'] = $theme_properties['disporder'];

 
		}
else
{
$errors[] = $lang->error_no_display_order;

		}

$allowedgroups = array();

		}

$allowedgroups = array();

Zeile 1140Zeile 1147
		}

if($update_array['pid'])

		}

if($update_array['pid'])

		{

		{

			$query = $db->simple_select("themes", "tid", "tid='".$update_array['pid']."'");
$parent_check = $db->fetch_field($query, "tid");
if(!$parent_check)
{
$errors[] = $lang->error_invalid_parent_theme;

			$query = $db->simple_select("themes", "tid", "tid='".$update_array['pid']."'");
$parent_check = $db->fetch_field($query, "tid");
if(!$parent_check)
{
$errors[] = $lang->error_invalid_parent_theme;

			}

			}

		}
if($properties['templateset'])

		}
if($properties['templateset'])

		{

		{

			$query = $db->simple_select("templatesets", "sid", "sid='".$properties['templateset']."'");
$ts_check = $db->fetch_field($query, "sid");
if(!$ts_check)

			$query = $db->simple_select("templatesets", "sid", "sid='".$properties['templateset']."'");
$ts_check = $db->fetch_field($query, "sid");
if(!$ts_check)

Zeile 1162Zeile 1169
			$errors[] = $lang->error_invalid_templateset;
}
if(!$properties['editortheme'] || !file_exists(MYBB_ROOT."jscripts/sceditor/editor_themes/".$properties['editortheme']) || is_dir(MYBB_ROOT."jscripts/sceditor/editor_themes/".$properties['editortheme']))

			$errors[] = $lang->error_invalid_templateset;
}
if(!$properties['editortheme'] || !file_exists(MYBB_ROOT."jscripts/sceditor/editor_themes/".$properties['editortheme']) || is_dir(MYBB_ROOT."jscripts/sceditor/editor_themes/".$properties['editortheme']))

		{

		{

			$errors[] = $lang->error_invalid_editortheme;

			$errors[] = $lang->error_invalid_editortheme;

		}

		}


if(empty($errors))
{
$plugins->run_hooks("admin_style_themes_edit_commit");


if(empty($errors))
{
$plugins->run_hooks("admin_style_themes_edit_commit");





			$db->update_query("themes", $update_array, "tid='{$theme['tid']}'");

			$db->update_query("themes", $update_array, "tid='{$theme['tid']}'");




			update_theme_stylesheet_list($theme['tid']);


			if($theme['def'] == 1)
{
$cache->update_default_theme();
}

			if($theme['def'] == 1)
{
$cache->update_default_theme();
}





			// Log admin action
log_admin_action($theme['tid'], htmlspecialchars_uni($theme['name']));

flash_message($lang->success_theme_properties_updated, 'success');

			// Log admin action
log_admin_action($theme['tid'], htmlspecialchars_uni($theme['name']));

flash_message($lang->success_theme_properties_updated, 'success');

			admin_redirect("index.php?module=style-themes&action=edit&tid={$theme['tid']}");
}
}

			admin_redirect("index.php?module=style-themes&action=edit&tid={$theme['tid']}");
}
}


// Fetch list of all of the stylesheets for this theme
$file_stylesheets = my_unserialize($theme['stylesheets']);


// Fetch list of all of the stylesheets for this theme
$file_stylesheets = my_unserialize($theme['stylesheets']);

Zeile 1263Zeile 1271
				$order = (int)$mybb->input['disporder'][$properties['sid']];

$orders[$properties['name']] = $order;

				$order = (int)$mybb->input['disporder'][$properties['sid']];

$orders[$properties['name']] = $order;

			}
}

asort($orders, SORT_NUMERIC);

			}
}

asort($orders, SORT_NUMERIC);


// Save the orders in the theme properties
$properties = my_unserialize($theme['properties']);


// Save the orders in the theme properties
$properties = my_unserialize($theme['properties']);

Zeile 1275Zeile 1283
		$update_array = array(
"properties" => $db->escape_string(my_serialize($properties))
);

		$update_array = array(
"properties" => $db->escape_string(my_serialize($properties))
);





		$db->update_query("themes", $update_array, "tid = '{$theme['tid']}'");

if($theme['def'] == 1)

		$db->update_query("themes", $update_array, "tid = '{$theme['tid']}'");

if($theme['def'] == 1)

Zeile 1288Zeile 1296

flash_message($lang->success_stylesheet_order_updated, 'success');
admin_redirect("index.php?module=style-themes&action=edit&tid={$theme['tid']}");


flash_message($lang->success_stylesheet_order_updated, 'success');
admin_redirect("index.php?module=style-themes&action=edit&tid={$theme['tid']}");

	}


	}


	$page->add_breadcrumb_item(htmlspecialchars_uni($theme['name']), "index.php?module=style-themes&action=edit&tid={$mybb->input['tid']}");

$page->output_header("{$lang->themes} - {$lang->stylesheets}");

	$page->add_breadcrumb_item(htmlspecialchars_uni($theme['name']), "index.php?module=style-themes&action=edit&tid={$mybb->input['tid']}");

$page->output_header("{$lang->themes} - {$lang->stylesheets}");

Zeile 1338Zeile 1346
		{
if(strpos($filename, 'css.php?stylesheet=') !== false)
{

		{
if(strpos($filename, 'css.php?stylesheet=') !== false)
{

				$style['sid'] = (integer)str_replace('css.php?stylesheet=', '', $filename);

				$style['sid'] = (int)str_replace('css.php?stylesheet=', '', $filename);

				$filename = $theme_stylesheets[$style['sid']];
}

if(basename($filename) != $style_name)

				$filename = $theme_stylesheets[$style['sid']];
}

if(basename($filename) != $style_name)

			{

			{

				continue;
}


				continue;
}


Zeile 1355Zeile 1363
	{
if(strpos($filename, 'css.php?stylesheet=') !== false)
{

	{
if(strpos($filename, 'css.php?stylesheet=') !== false)
{

			$style['sid'] = (integer)str_replace('css.php?stylesheet=', '', $filename);

			$style['sid'] = (int)str_replace('css.php?stylesheet=', '', $filename);

			$filename = $theme_stylesheets[$style['sid']];
}
else

			$filename = $theme_stylesheets[$style['sid']];
}
else

Zeile 1397Zeile 1405
				}

$inherited .= $sep.$file;

				}

$inherited .= $sep.$file;

				$sep = $lang->comma;

				$sep = $lang->comma;


++$count;
}


++$count;
}

Zeile 1743Zeile 1751
					$db->update_query("themestylesheets", array('cachefile' => "css.php?stylesheet={$stylesheet['sid']}"), "sid='{$stylesheet['sid']}'", 1);
}
@unlink(MYBB_ROOT."cache/themes/theme{$theme['tid']}/{$stylesheet['cachefile']}");

					$db->update_query("themestylesheets", array('cachefile' => "css.php?stylesheet={$stylesheet['sid']}"), "sid='{$stylesheet['sid']}'", 1);
}
@unlink(MYBB_ROOT."cache/themes/theme{$theme['tid']}/{$stylesheet['cachefile']}");

			}





$filename_min = str_replace('.css', '.min.css', $stylesheet['cachefile']);
@unlink(MYBB_ROOT."cache/themes/theme{$theme['tid']}/{$filename_min}");
}


// Update the CSS file list for this theme
update_theme_stylesheet_list($theme['tid'], $theme_c, $update_d);


// Update the CSS file list for this theme
update_theme_stylesheet_list($theme['tid'], $theme_c, $update_d);





			$plugins->run_hooks("admin_style_themes_stylesheet_properties_commit");

// Log admin action
log_admin_action($stylesheet['sid'], $mybb->input['name'], $theme['tid'], htmlspecialchars_uni($theme['name']));

			$plugins->run_hooks("admin_style_themes_stylesheet_properties_commit");

// Log admin action
log_admin_action($stylesheet['sid'], $mybb->input['name'], $theme['tid'], htmlspecialchars_uni($theme['name']));





			flash_message($lang->success_stylesheet_properties_updated, 'success');
admin_redirect("index.php?module=style-themes&action=edit&tid={$theme['tid']}");
}

			flash_message($lang->success_stylesheet_properties_updated, 'success');
admin_redirect("index.php?module=style-themes&action=edit&tid={$theme['tid']}");
}

Zeile 1772Zeile 1783

// Show inherited warning
if($stylesheet['tid'] == 1)


// Show inherited warning
if($stylesheet['tid'] == 1)

		{

		{

			$page->output_alert($lang->sprintf($lang->stylesheet_inherited_default, $stylesheet_parent));

			$page->output_alert($lang->sprintf($lang->stylesheet_inherited_default, $stylesheet_parent));

		}

		}

		else
{
$page->output_alert($lang->sprintf($lang->stylesheet_inherited, $stylesheet_parent));

		else
{
$page->output_alert($lang->sprintf($lang->stylesheet_inherited, $stylesheet_parent));

Zeile 1782Zeile 1793
	}

$applied_to = $this_stylesheet['applied_to'];

	}

$applied_to = $this_stylesheet['applied_to'];

	unset($this_stylesheet);

	unset($this_stylesheet);


if($errors)
{


if($errors)
{

Zeile 1812Zeile 1823
	$global_checked[1] = "checked=\"checked\"";
$global_checked[2] = "";
$global_checked[3] = "";

	$global_checked[1] = "checked=\"checked\"";
$global_checked[2] = "";
$global_checked[3] = "";





	$form = new Form("index.php?module=style-themes&action=stylesheet_properties", "post");

$specific_files = "<div id=\"attach_1\" class=\"attachs\">";

	$form = new Form("index.php?module=style-themes&amp;action=stylesheet_properties", "post");

$specific_files = "<div id=\"attach_1\" class=\"attachs\">";

Zeile 1821Zeile 1832
	{
$check_actions = "";
$stylesheet['colors'] = array();

	{
$check_actions = "";
$stylesheet['colors'] = array();





		if(!is_array($properties['colors']))
{
$properties['colors'] = array();

		if(!is_array($properties['colors']))
{
$properties['colors'] = array();

Zeile 1874Zeile 1885

$form_container = new FormContainer();
$form_container->output_row("", "", "<span style=\"float: right;\"><a href=\"\" id=\"delete_img_{$count}\"><img src=\"styles/{$page->style}/images/icons/cross.png\" alt=\"{$lang->delete}\" title=\"{$lang->delete}\" /></a></span>{$lang->file} &nbsp;".$form->generate_text_box("attached_{$count}", $name, array('id' => "attached_{$count}", 'style' => 'width: 200px;')), "attached_{$count}");


$form_container = new FormContainer();
$form_container->output_row("", "", "<span style=\"float: right;\"><a href=\"\" id=\"delete_img_{$count}\"><img src=\"styles/{$page->style}/images/icons/cross.png\" alt=\"{$lang->delete}\" title=\"{$lang->delete}\" /></a></span>{$lang->file} &nbsp;".$form->generate_text_box("attached_{$count}", $name, array('id' => "attached_{$count}", 'style' => 'width: 200px;')), "attached_{$count}");





			$form_container->output_row("", "", $specific_file);

$specific_files .= "<div id=\"attached_form_{$count}\">".$form_container->end(true)."</div><div id=\"attach_box_".($count+1)."\"></div>";

			$form_container->output_row("", "", $specific_file);

$specific_files .= "<div id=\"attached_form_{$count}\">".$form_container->end(true)."</div><div id=\"attach_box_".($count+1)."\"></div>";

Zeile 2033Zeile 2044
		}

$css_to_insert = '';

		}

$css_to_insert = '';

		foreach($mybb->input['css_bits'] as $field => $value)

		foreach($mybb->input['css_bits'] as $field => $value)

		{
if(!trim($value) || !trim($field))
{

		{
if(!trim($value) || !trim($field))
{

Zeile 2242Zeile 2253
//]]>
</script>';


//]]>
</script>';


	$form->end();

$page->output_footer();
}


	$form->end();

$page->output_footer();
}


if($mybb->input['action'] == "edit_stylesheet" && $mybb->input['mode'] == "advanced")
{
// Fetch the theme we want to edit this stylesheet in

if($mybb->input['action'] == "edit_stylesheet" && $mybb->input['mode'] == "advanced")
{
// Fetch the theme we want to edit this stylesheet in

Zeile 2257Zeile 2268
	{
flash_message($lang->error_invalid_theme, 'error');
admin_redirect("index.php?module=style-themes");

	{
flash_message($lang->error_invalid_theme, 'error');
admin_redirect("index.php?module=style-themes");

	}

$plugins->run_hooks("admin_style_themes_edit_stylesheet_advanced");


	}

$plugins->run_hooks("admin_style_themes_edit_stylesheet_advanced");


	$parent_list = make_parent_theme_list($theme['tid']);
$parent_list = implode(',', $parent_list);
if(!$parent_list)
{
$parent_list = 1;
}

	$parent_list = make_parent_theme_list($theme['tid']);
$parent_list = implode(',', $parent_list);
if(!$parent_list)
{
$parent_list = 1;
}





	$query = $db->simple_select("themestylesheets", "*", "name='".$db->escape_string($mybb->input['file'])."' AND tid IN ({$parent_list})", array('order_by' => 'tid', 'order_dir' => 'desc', 'limit' => 1));
$stylesheet = $db->fetch_array($query);

// Does the theme not exist?
if(!$stylesheet['sid'])

	$query = $db->simple_select("themestylesheets", "*", "name='".$db->escape_string($mybb->input['file'])."' AND tid IN ({$parent_list})", array('order_by' => 'tid', 'order_dir' => 'desc', 'limit' => 1));
$stylesheet = $db->fetch_array($query);

// Does the theme not exist?
if(!$stylesheet['sid'])

	{

	{

		flash_message($lang->error_invalid_stylesheet, 'error');
admin_redirect("index.php?module=style-themes");
}

		flash_message($lang->error_invalid_stylesheet, 'error');
admin_redirect("index.php?module=style-themes");
}

Zeile 2326Zeile 2337
	$stylesheets = fetch_theme_stylesheets($theme);
$this_stylesheet = $stylesheets[$stylesheet['name']];
unset($stylesheets);

	$stylesheets = fetch_theme_stylesheets($theme);
$this_stylesheet = $stylesheets[$stylesheet['name']];
unset($stylesheets);





	if($admin_options['codepress'] != 0)
{
$page->extra_header .= '

	if($admin_options['codepress'] != 0)
{
$page->extra_header .= '

Zeile 2378Zeile 2389

// Has the file on the file system been modified?
if(resync_stylesheet($stylesheet))


// Has the file on the file system been modified?
if(resync_stylesheet($stylesheet))

	{

	{

		// Need to refetch new stylesheet as it was modified
$query = $db->simple_select("themestylesheets", "stylesheet", "sid='{$stylesheet['sid']}'");
$stylesheet['stylesheet'] = $db->fetch_field($query, 'stylesheet');

		// Need to refetch new stylesheet as it was modified
$query = $db->simple_select("themestylesheets", "stylesheet", "sid='{$stylesheet['sid']}'");
$stylesheet['stylesheet'] = $db->fetch_field($query, 'stylesheet');

Zeile 2458Zeile 2469
	{
$db->delete_query("themestylesheets", "sid='{$stylesheet['sid']}'", 1);
@unlink(MYBB_ROOT."cache/themes/theme{$theme['tid']}/{$stylesheet['cachefile']}");

	{
$db->delete_query("themestylesheets", "sid='{$stylesheet['sid']}'", 1);
@unlink(MYBB_ROOT."cache/themes/theme{$theme['tid']}/{$stylesheet['cachefile']}");

 

$filename_min = str_replace('.css', '.min.css', $stylesheet['cachefile']);
@unlink(MYBB_ROOT."cache/themes/theme{$theme['tid']}/{$filename_min}");


// Update the CSS file list for this theme
update_theme_stylesheet_list($theme['tid'], $theme, true);


// Update the CSS file list for this theme
update_theme_stylesheet_list($theme['tid'], $theme, true);