Vergleich admin/modules/style/themes.php - 1.8.20 - 1.8.26

  Keine Änderungen   Hinzugefügt   Modifiziert   Entfernt
Zeile 168Zeile 168
	// Convert to mods site version codes
$search_version = ($major_version_code/100).'x';


	// Convert to mods site version codes
$search_version = ($major_version_code/100).'x';


	$contents = fetch_remote_file("https://community.mybb.com/xmlbrowse.php?type=themes&version={$search_version}{$keywords}{$url_page}", $post_data);

	$contents = fetch_remote_file("https://community.mybb.com/xmlbrowse.php?api=2&type=themes&version={$search_version}{$keywords}{$url_page}", $post_data);


if(!$contents)
{


if(!$contents)
{

Zeile 208Zeile 208
			$result['thumbnail']['value'] = htmlspecialchars_uni($result['thumbnail']['value']);
$result['name']['value'] = htmlspecialchars_uni($result['name']['value']);
$result['description']['value'] = htmlspecialchars_uni($result['description']['value']);

			$result['thumbnail']['value'] = htmlspecialchars_uni($result['thumbnail']['value']);
$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['author']['url']['value'] = htmlspecialchars_uni($result['author']['url']['value']);
$result['author']['name']['value'] = htmlspecialchars_uni($result['author']['name']['value']);



			$result['download_url']['value'] = htmlspecialchars_uni(html_entity_decode($result['download_url']['value']));

$table->construct_cell("<img src=\"https://community.mybb.com/{$result['thumbnail']['value']}\" alt=\"{$lang->theme_thumbnail}\" title=\"{$lang->theme_thumbnail}\"/>", array("class" => "align_center", "width" => 100));

			$result['download_url']['value'] = htmlspecialchars_uni(html_entity_decode($result['download_url']['value']));

$table->construct_cell("<img src=\"https://community.mybb.com/{$result['thumbnail']['value']}\" alt=\"{$lang->theme_thumbnail}\" title=\"{$lang->theme_thumbnail}\"/>", array("class" => "align_center", "width" => 100));

			$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("<strong>{$result['name']['value']}</strong><br /><small>{$result['description']['value']}</small><br /><i><small>{$lang->created_by} <a href=\"{$result['author']['url']['value']}\" target=\"_blank\" rel=\"noopener\">{$result['author']['name']['value']}</a></small></i>");

			$table->construct_cell("<strong><a href=\"https://community.mybb.com/{$result['download_url']['value']}\" target=\"_blank\" rel=\"noopener\">{$lang->download}</a></strong>", array("class" => "align_center"));
$table->construct_row();
}
}

if($table->num_rows() == 0)

			$table->construct_cell("<strong><a href=\"https://community.mybb.com/{$result['download_url']['value']}\" target=\"_blank\" rel=\"noopener\">{$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();
}

		$table->construct_cell($lang->error_no_results_found, array("colspan" => 3));
$table->construct_row();
}

Zeile 233Zeile 231
	{
$default_class = '';
$value = htmlspecialchars_uni($mybb->input['keywords']);

	{
$default_class = '';
$value = htmlspecialchars_uni($mybb->input['keywords']);

	}

	}

	else
{
$default_class = "search_default";

	else
{
$default_class = "search_default";

Zeile 243Zeile 241
	echo "<input type=\"submit\" class=\"search_button\" value=\"{$lang->search}\" />\n";
echo "<script type=\"text/javascript\">
var form = $(\"#search_form\");

	echo "<input type=\"submit\" class=\"search_button\" value=\"{$lang->search}\" />\n";
echo "<script type=\"text/javascript\">
var form = $(\"#search_form\");

		form.submit(function()

		form.on('submit', function()

		{
var search = $('#search_keywords');
if(search.val() == '' || search.val() == '{$lang->search_for_themes}')
{

		{
var search = $('#search_keywords');
if(search.val() == '' || search.val() == '{$lang->search_for_themes}')
{

				search.focus();

				search.trigger('focus');

				return false;
}
});

var search = $('#search_keywords');

				return false;
}
});

var search = $('#search_keywords');

		search.focus(function()

		search.on('focus', function()

		{
var search_focus = $(this);
if(search_focus.val() == '{$lang->search_for_themes}')

		{
var search_focus = $(this);
if(search_focus.val() == '{$lang->search_for_themes}')

			{

			{

				search_focus.removeClass('search_default');
search_focus.val('');
}

				search_focus.removeClass('search_default');
search_focus.val('');
}

		});

search.blur(function()

		}).on('blur', function()



		{
var search_blur = $(this);
if(search_blur.val() == '')

		{
var search_blur = $(this);
if(search_blur.val() == '')

Zeile 473Zeile 469
		if($(\'#\'+id+\'_\'+checked))
{
$(\'#\'+id+\'_\'+checked).show();

		if($(\'#\'+id+\'_\'+checked))
{
$(\'#\'+id+\'_\'+checked).show();

		}
}

		}
}

</script>
<dl style="margin-top: 0; margin-bottom: 0; width: 35%;">
<dt><label style="display: block;"><input type="radio" name="import" value="0" '.$import_checked[1].' class="imports_check" onclick="checkAction(\'import\');" style="vertical-align: middle;" /> '.$lang->local_file.'</label></dt>

</script>
<dl style="margin-top: 0; margin-bottom: 0; width: 35%;">
<dt><label style="display: block;"><input type="radio" name="import" value="0" '.$import_checked[1].' class="imports_check" onclick="checkAction(\'import\');" style="vertical-align: middle;" /> '.$lang->local_file.'</label></dt>

Zeile 560Zeile 556
		foreach($file_stylesheets as $file => $action_stylesheet)
{
if($file == 'inherited' || !is_array($action_stylesheet))

		foreach($file_stylesheets as $file => $action_stylesheet)
{
if($file == 'inherited' || !is_array($action_stylesheet))

			{

			{

				continue;
}

foreach($action_stylesheet as $action => $style)

				continue;
}

foreach($action_stylesheet as $action => $style)

			{

			{

				foreach($style as $stylesheet)
{
$stylesheets[$stylesheet]['applied_to'][$file][] = $action;

				foreach($style as $stylesheet)
{
$stylesheets[$stylesheet]['applied_to'][$file][] = $action;

Zeile 577Zeile 573
							$inherited_load[] = $value;
}
}

							$inherited_load[] = $value;
}
}

				}
}
}


				}
}
}


		$inherited_load[] = $mybb->input['tid'];
$inherited_load = array_unique($inherited_load);


		$inherited_load[] = $mybb->input['tid'];
$inherited_load = array_unique($inherited_load);


Zeile 600Zeile 596
				{
$theme_stylesheets[$theme_stylesheet['cachefile']] = $theme_stylesheet;
$theme_stylesheets[$theme_stylesheet['sid']] = $theme_stylesheet['cachefile'];

				{
$theme_stylesheets[$theme_stylesheet['cachefile']] = $theme_stylesheet;
$theme_stylesheets[$theme_stylesheet['sid']] = $theme_stylesheet['cachefile'];

				}
}
}

				}
}
}


$xml .= "\t<stylesheets>\r\n";
foreach($stylesheets as $filename => $style)
{
if(strpos($filename, 'css.php?stylesheet=') !== false)


$xml .= "\t<stylesheets>\r\n";
foreach($stylesheets as $filename => $style)
{
if(strpos($filename, 'css.php?stylesheet=') !== false)

			{

			{

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

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

			{

			{

				$filename = basename($filename);
$style['sid'] = $theme_stylesheets[$filename]['sid'];

				$filename = basename($filename);
$style['sid'] = $theme_stylesheets[$filename]['sid'];

			}

$style['tid'] = $theme_stylesheets[$filename]['tid'];


			}

$style['tid'] = $theme_stylesheets[$filename]['tid'];


			if($mybb->input['custom_theme'] == 1 && $style['tid'] != $mybb->input['tid'])
{
continue;

			if($mybb->input['custom_theme'] == 1 && $style['tid'] != $mybb->input['tid'])
{
continue;

			}


			}


			// Has the file on the file system been modified?
resync_stylesheet($theme_stylesheets[$filename]);

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

			// Has the file on the file system been modified?
resync_stylesheet($theme_stylesheets[$filename]);

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





			$attachedto = $theme_stylesheets[$filename]['attachedto'];
$stylesheet = $theme_stylesheets[$filename]['stylesheet'];
$stylesheet = str_replace(']]>', ']]]]><![CDATA[>', $stylesheet);

			$attachedto = $theme_stylesheets[$filename]['attachedto'];
$stylesheet = $theme_stylesheets[$filename]['stylesheet'];
$stylesheet = str_replace(']]>', ']]]]><![CDATA[>', $stylesheet);

Zeile 640Zeile 636
			}

$filename = $theme_stylesheets[$filename]['name'];

			}

$filename = $theme_stylesheets[$filename]['name'];





			$xml .= "\t\t<stylesheet name=\"{$filename}\" {$attachedto}version=\"{$mybb->version_code}\"><![CDATA[{$stylesheet}]]>\r\n\t\t</stylesheet>\r\n";

			$xml .= "\t\t<stylesheet name=\"{$filename}\" {$attachedto}version=\"{$mybb->version_code}\"><![CDATA[{$stylesheet}]]>\r\n\t\t</stylesheet>\r\n";





		}
$xml .= "\t</stylesheets>\r\n";

		}
$xml .= "\t</stylesheets>\r\n";





		if($mybb->input['include_templates'] != 0)
{
$xml .= "\t<templates>\r\n";

		if($mybb->input['include_templates'] != 0)
{
$xml .= "\t<templates>\r\n";

			$query = $db->simple_select("templates", "*", "sid='".$properties['templateset']."'");

			$query = $db->simple_select("templates", "*", "sid='".(int)$properties['templateset']."'");

			while($template = $db->fetch_array($query))
{
$template['template'] = str_replace(']]>', ']]]]><![CDATA[>', $template['template']);

			while($template = $db->fetch_array($query))
{
$template['template'] = str_replace(']]>', ']]]]><![CDATA[>', $template['template']);

Zeile 658Zeile 654
			$xml .= "\t</templates>\r\n";
}
$xml .= "</theme>";

			$xml .= "\t</templates>\r\n";
}
$xml .= "</theme>";





		$plugins->run_hooks("admin_style_themes_export_commit");

// Log admin action

		$plugins->run_hooks("admin_style_themes_export_commit");

// Log admin action

Zeile 679Zeile 675
	$page->add_breadcrumb_item($lang->export_theme, "index.php?module=style-themes&amp;action=export");

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

	$page->add_breadcrumb_item($lang->export_theme, "index.php?module=style-themes&amp;action=export");

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


$sub_tabs['edit_stylesheets'] = array(
'title' => $lang->edit_stylesheets,
'link' => "index.php?module=style-themes&amp;action=edit&amp;tid={$mybb->input['tid']}",
);

$sub_tabs['add_stylesheet'] = array(
'title' => $lang->add_stylesheet,
'link' => "index.php?module=style-themes&amp;action=add_stylesheet&amp;tid={$mybb->input['tid']}",
);



$sub_tabs['edit_stylesheets'] = array(
'title' => $lang->edit_stylesheets,
'link' => "index.php?module=style-themes&amp;action=edit&amp;tid={$mybb->input['tid']}",
);

$sub_tabs['add_stylesheet'] = array(
'title' => $lang->add_stylesheet,
'link' => "index.php?module=style-themes&amp;action=add_stylesheet&amp;tid={$mybb->input['tid']}",
);


	$sub_tabs['export_theme'] = array(
'title' => $lang->export_theme,
'link' => "index.php?module=style-themes&amp;action=export&amp;tid={$mybb->input['tid']}",
'description' => $lang->export_theme_desc

	$sub_tabs['export_theme'] = array(
'title' => $lang->export_theme,
'link' => "index.php?module=style-themes&amp;action=export&amp;tid={$mybb->input['tid']}",
'description' => $lang->export_theme_desc

	);


	);


	$sub_tabs['duplicate_theme'] = array(
'title' => $lang->duplicate_theme,
'link' => "index.php?module=style-themes&amp;action=duplicate&amp;tid={$mybb->input['tid']}",

	$sub_tabs['duplicate_theme'] = array(
'title' => $lang->duplicate_theme,
'link' => "index.php?module=style-themes&amp;action=duplicate&amp;tid={$mybb->input['tid']}",

Zeile 721Zeile 717
	$buttons[] = $form->generate_submit_button($lang->export_theme);

$form->output_submit_wrapper($buttons);

	$buttons[] = $form->generate_submit_button($lang->export_theme);

$form->output_submit_wrapper($buttons);





	$form->end();

$page->output_footer();

	$form->end();

$page->output_footer();

Zeile 731Zeile 727
{
$query = $db->simple_select("themes", "*", "tid='".$mybb->get_input('tid', MyBB::INPUT_INT)."'");
$theme = $db->fetch_array($query);

{
$query = $db->simple_select("themes", "*", "tid='".$mybb->get_input('tid', MyBB::INPUT_INT)."'");
$theme = $db->fetch_array($query);





	// Does the theme not exist?
if(!$theme['tid'])
{

	// Does the theme not exist?
if(!$theme['tid'])
{

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

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

			$sid = $properties['templateset'];

			$sid = (int)$properties['templateset'];

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

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

Zeile 859Zeile 855
	else
{
$mybb->input['duplicate_templates'] = true;

	else
{
$mybb->input['duplicate_templates'] = true;

	}

$form = new Form("index.php?module=style-themes&amp;action=duplicate&amp;tid={$theme['tid']}", "post");

	}

$form = new Form("index.php?module=style-themes&amp;action=duplicate&amp;tid={$theme['tid']}", "post");


$form_container = new FormContainer($lang->duplicate_theme);
$form_container->output_row($lang->new_name, $lang->new_name_duplicate_desc, $form->generate_text_box('name', $mybb->input['name'], array('id' => 'name')), 'name');


$form_container = new FormContainer($lang->duplicate_theme);
$form_container->output_row($lang->new_name, $lang->new_name_duplicate_desc, $form->generate_text_box('name', $mybb->input['name'], array('id' => 'name')), 'name');

Zeile 872Zeile 868
	$buttons[] = $form->generate_submit_button($lang->duplicate_theme);

$form->output_submit_wrapper($buttons);

	$buttons[] = $form->generate_submit_button($lang->duplicate_theme);

$form->output_submit_wrapper($buttons);





	$form->end();

	$form->end();





	$page->output_footer();
}

	$page->output_footer();
}





if($mybb->input['action'] == "add")
{
$plugins->run_hooks("admin_style_themes_add");

if($mybb->input['action'] == "add")
{
$plugins->run_hooks("admin_style_themes_add");

Zeile 893Zeile 889
		if(!$mybb->input['name'])
{
$errors[] = $lang->error_missing_name;

		if(!$mybb->input['name'])
{
$errors[] = $lang->error_missing_name;

		}

		}

		else if(in_array($mybb->input['name'], $themes))
{
$errors[] = $lang->error_theme_already_exists;
}

		else if(in_array($mybb->input['name'], $themes))
{
$errors[] = $lang->error_theme_already_exists;
}





		if(!$errors)
{
$tid = build_new_theme($mybb->input['name'], null, $mybb->input['tid']);

		if(!$errors)
{
$tid = build_new_theme($mybb->input['name'], null, $mybb->input['tid']);





			$plugins->run_hooks("admin_style_themes_add_commit");


			$plugins->run_hooks("admin_style_themes_add_commit");


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


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


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

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

Zeile 920Zeile 916
	$page->output_nav_tabs($sub_tabs, 'create_theme');

if($errors)

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

if($errors)

	{

	{

		$page->output_inline_error($errors);
}

		$page->output_inline_error($errors);
}





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

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





	$form_container = new FormContainer($lang->create_a_theme);
$form_container->output_row($lang->name, $lang->name_desc, $form->generate_text_box('name', $mybb->input['name'], array('id' => 'name')), 'name');
$form_container->output_row($lang->parent_theme, $lang->parent_theme_desc, $form->generate_select_box('tid', $themes, $mybb->input['tid'], array('id' => 'tid')), 'tid');

	$form_container = new FormContainer($lang->create_a_theme);
$form_container->output_row($lang->name, $lang->name_desc, $form->generate_text_box('name', $mybb->input['name'], array('id' => 'name')), 'name');
$form_container->output_row($lang->parent_theme, $lang->parent_theme_desc, $form->generate_select_box('tid', $themes, $mybb->input['tid'], array('id' => 'tid')), 'tid');





	$form_container->end();

	$form_container->end();





	$buttons[] = $form->generate_submit_button($lang->create_new_theme);

$form->output_submit_wrapper($buttons);

	$buttons[] = $form->generate_submit_button($lang->create_new_theme);

$form->output_submit_wrapper($buttons);

Zeile 947Zeile 943
	$theme = $db->fetch_array($query);

// Does the theme not exist? or are we trying to delete the master?

	$theme = $db->fetch_array($query);

// Does the theme not exist? or are we trying to delete the master?

	if(!$theme['tid'] || $theme['tid'] == 1)
{
flash_message($lang->error_invalid_theme, 'error');
admin_redirect("index.php?module=style-themes");

	if(!$theme['tid'] || $theme['tid'] == 1)
{
flash_message($lang->error_invalid_theme, 'error');
admin_redirect("index.php?module=style-themes");

	}

// User clicked no

	}

// User clicked no

Zeile 967Zeile 963

$query = $db->simple_select("themes", "tid,stylesheets", "tid != '{$theme['tid']}'", array('order_by' => "pid, name"));
while($theme2 = $db->fetch_array($query))


$query = $db->simple_select("themes", "tid,stylesheets", "tid != '{$theme['tid']}'", array('order_by' => "pid, name"));
while($theme2 = $db->fetch_array($query))

		{

		{

			$theme2['stylesheets'] = my_unserialize($theme2['stylesheets']);

if(!$theme2['stylesheets']['inherited'])

			$theme2['stylesheets'] = my_unserialize($theme2['stylesheets']);

if(!$theme2['stylesheets']['inherited'])

Zeile 977Zeile 973

$inherited_theme_cache[$theme2['tid']] = $theme2['stylesheets']['inherited'];
}


$inherited_theme_cache[$theme2['tid']] = $theme2['stylesheets']['inherited'];
}





		$inherited_stylesheets = false;

// Are any other themes relying on stylesheets from this theme? Get a list and show an error

		$inherited_stylesheets = false;

// Are any other themes relying on stylesheets from this theme? Get a list and show an error

Zeile 990Zeile 986
					if(strpos($filepath, "cache/themes/theme{$theme['tid']}") !== false)
{
$inherited_stylesheets = true;

					if(strpos($filepath, "cache/themes/theme{$theme['tid']}") !== false)
{
$inherited_stylesheets = true;

					}
}
}
}

					}
}
}
}


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


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

		}

		}


$query = $db->simple_select("themestylesheets", "cachefile", "tid='{$theme['tid']}'");
while($cachefile = $db->fetch_array($query))


$query = $db->simple_select("themestylesheets", "cachefile", "tid='{$theme['tid']}'");
while($cachefile = $db->fetch_array($query))

Zeile 1010Zeile 1006
			@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']}/{$filename_min}");
}
@unlink(MYBB_ROOT."cache/themes/theme{$theme['tid']}/index.html");





		$db->delete_query("themestylesheets", "tid='{$theme['tid']}'");

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

		$db->delete_query("themestylesheets", "tid='{$theme['tid']}'");

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





		$db->update_query("users", array('style' => 0), "style='{$theme['tid']}'");

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

		$db->update_query("users", array('style' => 0), "style='{$theme['tid']}'");

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

Zeile 1034Zeile 1030
		if(!empty($child_tids))
{
$db->update_query("themes", array('pid' => $theme['pid']), "tid IN (".implode(',', $child_tids).")");

		if(!empty($child_tids))
{
$db->update_query("themes", array('pid' => $theme['pid']), "tid IN (".implode(',', $child_tids).")");

		}

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


		}

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


		$plugins->run_hooks("admin_style_themes_delete_commit");

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

		$plugins->run_hooks("admin_style_themes_delete_commit");

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





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

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

	{

	{

		$page->output_confirm_action("index.php?module=style-themes&amp;action=delete&amp;tid={$theme['tid']}", $lang->confirm_theme_deletion);
}
}

		$page->output_confirm_action("index.php?module=style-themes&amp;action=delete&amp;tid={$theme['tid']}", $lang->confirm_theme_deletion);
}
}

Zeile 1063Zeile 1059
		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");

if($mybb->request_method == "post" && !$mybb->input['do'])

	$plugins->run_hooks("admin_style_themes_edit");

if($mybb->request_method == "post" && !$mybb->input['do'])

Zeile 1079Zeile 1075
		);

if($properties['color'] == 'none')

		);

if($properties['color'] == 'none')

		{

		{

			unset($properties['color']);
}


			unset($properties['color']);
}


Zeile 1170Zeile 1166
		}
if($properties['templateset'])
{

		}
if($properties['templateset'])
{

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

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

			$ts_check = $db->fetch_field($query, "sid");
if(!$ts_check)
{

			$ts_check = $db->fetch_field($query, "sid");
if(!$ts_check)
{

Zeile 1181Zeile 1177
		{
$errors[] = $lang->error_invalid_templateset;
}

		{
$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']))

		if(!$properties['editortheme'] || !file_exists(MYBB_ROOT."jscripts/sceditor/themes/".$properties['editortheme']) || is_dir(MYBB_ROOT."jscripts/sceditor/themes/".$properties['editortheme']))

		{
$errors[] = $lang->error_invalid_editortheme;
}

		{
$errors[] = $lang->error_invalid_editortheme;
}

Zeile 1253Zeile 1249
		while($theme_stylesheet = $db->fetch_array($query))
{
if(!isset($theme_stylesheets[$theme_stylesheet['name']]) && in_array($theme_stylesheet['tid'], $inherited_load))

		while($theme_stylesheet = $db->fetch_array($query))
{
if(!isset($theme_stylesheets[$theme_stylesheet['name']]) && in_array($theme_stylesheet['tid'], $inherited_load))

			{

			{

				$theme_stylesheets[$theme_stylesheet['name']] = $theme_stylesheet;
}


				$theme_stylesheets[$theme_stylesheet['name']] = $theme_stylesheet;
}


Zeile 1269Zeile 1265
			// Error out
flash_message($lang->error_no_display_order, 'error');
admin_redirect("index.php?module=style-themes&action=edit&tid={$theme['tid']}");

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

		}

		}


$orders = array();
foreach($theme_stylesheets as $stylesheet => $properties)


$orders = array();
foreach($theme_stylesheets as $stylesheet => $properties)

Zeile 1295Zeile 1291
		$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)

		{

		{

			$cache->update_default_theme();
}


			$cache->update_default_theme();
}


Zeile 1421Zeile 1417
		}

if(is_array($style['applied_to']) && (!isset($style['applied_to']['global']) || $style['applied_to']['global'][0] != "global"))

		}

if(is_array($style['applied_to']) && (!isset($style['applied_to']['global']) || $style['applied_to']['global'][0] != "global"))

		{
$attached_to = '';


		{
$attached_to = '';


			$applied_to_count = count($style['applied_to']);
$count = 0;
$sep = " ";

			$applied_to_count = count($style['applied_to']);
$count = 0;
$sep = " ";

Zeile 1509Zeile 1505
			}
}
else

			}
}
else

		{

		{

			$attached_to = "<small>{$lang->attached_to_all_pages}</small>";
}


			$attached_to = "<small>{$lang->attached_to_all_pages}</small>";
}


Zeile 1569Zeile 1565
	$form_container->output_row($lang->template_set." <em>*</em>", $lang->template_set_desc, $form->generate_select_box('templateset', $options, $properties['templateset'], array('id' => 'templateset')), 'templateset');

$options = array();

	$form_container->output_row($lang->template_set." <em>*</em>", $lang->template_set_desc, $form->generate_select_box('templateset', $options, $properties['templateset'], array('id' => 'templateset')), 'templateset');

$options = array();

	$editor_theme_root = MYBB_ROOT."jscripts/sceditor/editor_themes/";

	$editor_theme_root = MYBB_ROOT."jscripts/sceditor/themes/";

	if($dh = @opendir($editor_theme_root))
{
while($dir = readdir($dh))

	if($dh = @opendir($editor_theme_root))
{
while($dir = readdir($dh))

Zeile 1596Zeile 1592
	if(!$properties['colors'] || !is_array($properties['colors']))
{
$color_setting = $lang->colors_no_color_setting;

	if(!$properties['colors'] || !is_array($properties['colors']))
{
$color_setting = $lang->colors_no_color_setting;

	}
else
{

	}
else
{

		$colors = array('none' => $lang->colors_please_select);
$colors = array_merge($colors, $properties['colors']);

$color_setting = $form->generate_select_box('color', $colors, $properties['color'], array('class' => "select\" style=\"width: 200px;"));

		$colors = array('none' => $lang->colors_please_select);
$colors = array_merge($colors, $properties['colors']);

$color_setting = $form->generate_select_box('color', $colors, $properties['color'], array('class' => "select\" style=\"width: 200px;"));





		$mybb->input['colors'] = '';
foreach($properties['colors'] as $key => $color)
{

		$mybb->input['colors'] = '';
foreach($properties['colors'] as $key => $color)
{

Zeile 1618Zeile 1614

$form_container->output_row($lang->colors_setting, $lang->colors_setting_desc, $color_setting, 'color');
$form_container->output_row($lang->colors_add, $lang->colors_add_desc, $form->generate_text_area('colors', $mybb->input['colors'], array('style' => 'width: 200px;', 'rows' => '5')));


$form_container->output_row($lang->colors_setting, $lang->colors_setting_desc, $color_setting, 'color');
$form_container->output_row($lang->colors_add, $lang->colors_add_desc, $form->generate_text_area('colors', $mybb->input['colors'], array('style' => 'width: 200px;', 'rows' => '5')));





	$form_container->end();

$buttons = array();

	$form_container->end();

$buttons = array();

Zeile 1628Zeile 1624

$page->output_footer();
}


$page->output_footer();
}





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

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

Zeile 1638Zeile 1634
	if(!$theme['tid'] || $theme['tid'] == 1)
{
flash_message($lang->error_invalid_theme, 'error');

	if(!$theme['tid'] || $theme['tid'] == 1)
{
flash_message($lang->error_invalid_theme, 'error');

		admin_redirect("index.php?module=style-themes");

		admin_redirect("index.php?module=style-themes");

	}

$plugins->run_hooks("admin_style_themes_stylesheet_properties");

	}

$plugins->run_hooks("admin_style_themes_stylesheet_properties");

Zeile 1722Zeile 1718
						{
$attached_to .= "?".$actions_list;
}

						{
$attached_to .= "?".$actions_list;
}





						$attached[] = $attached_to;
}
}

						$attached[] = $attached_to;
}
}

Zeile 1732Zeile 1728
				if(!is_array($mybb->input['color']))
{
$errors[] = $lang->error_no_color_picked;

				if(!is_array($mybb->input['color']))
{
$errors[] = $lang->error_no_color_picked;

				}

				}

				else
{
$attached = $mybb->input['color'];

				else
{
$attached = $mybb->input['color'];

				}
}

				}
}


// Update Stylesheet
$update_array = array(


// Update Stylesheet
$update_array = array(

Zeile 1764Zeile 1760
				if(!cache_stylesheet($theme['tid'], str_replace('/', '', $mybb->input['name']), $stylesheet['stylesheet']))
{
$db->update_query("themestylesheets", array('cachefile' => "css.php?stylesheet={$stylesheet['sid']}"), "sid='{$stylesheet['sid']}'", 1);

				if(!cache_stylesheet($theme['tid'], str_replace('/', '', $mybb->input['name']), $stylesheet['stylesheet']))
{
$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']}/{$stylesheet['cachefile']}");

$filename_min = str_replace('.css', '.min.css', $stylesheet['cachefile']);

Zeile 1849Zeile 1845
		$stylesheet['colors'] = array();

if(!is_array($properties['colors']))

		$stylesheet['colors'] = array();

if(!is_array($properties['colors']))

		{

		{

			$properties['colors'] = array();
}


			$properties['colors'] = array();
}


Zeile 1934Zeile 1930
	{
$specific_colors = "<div id=\"attach_2\" class=\"attachs\">";
$specific_colors_option = '<dt><label style="display: block;"><input type="radio" name="attach" value="2" '.$global_checked[3].' class="attachs_check" onclick="checkAction(\'attach\');" style="vertical-align: middle;" /> '.$lang->colors_specific_color.'</label></dt><br />';

	{
$specific_colors = "<div id=\"attach_2\" class=\"attachs\">";
$specific_colors_option = '<dt><label style="display: block;"><input type="radio" name="attach" value="2" '.$global_checked[3].' class="attachs_check" onclick="checkAction(\'attach\');" style="vertical-align: middle;" /> '.$lang->colors_specific_color.'</label></dt><br />';


$specific_color = "
<small>{$lang->colors_add_edit_desc}</small>
<br /><br />
".$form->generate_select_box('color[]', $properties['colors'], $stylesheet['colors'], array('multiple' => true, 'size' => "5\" style=\"width: 200px;"))."
";

$form_container = new FormContainer();
$form_container->output_row("", "", $specific_color);
$specific_colors .= $form_container->end(true)."</div>";


$specific_color = "
<small>{$lang->colors_add_edit_desc}</small>
<br /><br />
".$form->generate_select_box('color[]', $properties['colors'], $stylesheet['colors'], array('multiple' => true, 'size' => "5\" style=\"width: 200px;"))."
";

$form_container = new FormContainer();
$form_container->output_row("", "", $specific_color);
$specific_colors .= $form_container->end(true)."</div>";

	}

$actions = '<script type="text/javascript">

	}

$actions = '<script type="text/javascript">

Zeile 1995Zeile 1991

echo <<<EOF



echo <<<EOF


	<script type="text/javascript" src="./jscripts/theme_properties.js?ver=1820"></script>

	<script type="text/javascript" src="./jscripts/theme_properties.js?ver=1821"></script>

	<script type="text/javascript">
<!---
themeProperties.setup('{$count}');

	<script type="text/javascript">
<!---
themeProperties.setup('{$count}');

Zeile 2010Zeile 2006

// Shows the page where you can actually edit a particular selector or the whole stylesheet
if($mybb->input['action'] == "edit_stylesheet" && (!isset($mybb->input['mode']) || $mybb->input['mode'] == "simple"))


// Shows the page where you can actually edit a particular selector or the whole stylesheet
if($mybb->input['action'] == "edit_stylesheet" && (!isset($mybb->input['mode']) || $mybb->input['mode'] == "simple"))

{
// Fetch the theme we want to edit this stylesheet in
$query = $db->simple_select("themes", "*", "tid='".$mybb->get_input('tid', MyBB::INPUT_INT)."'");
$theme = $db->fetch_array($query);

if(!$theme['tid'] || $theme['tid'] == 1)
{
flash_message($lang->error_invalid_theme, 'error');
admin_redirect("index.php?module=style-themes");
}

{
// Fetch the theme we want to edit this stylesheet in
$query = $db->simple_select("themes", "*", "tid='".$mybb->get_input('tid', MyBB::INPUT_INT)."'");
$theme = $db->fetch_array($query);

if(!$theme['tid'] || $theme['tid'] == 1)
{
flash_message($lang->error_invalid_theme, 'error');
admin_redirect("index.php?module=style-themes");
}


$plugins->run_hooks("admin_style_themes_edit_stylesheet_simple");



$plugins->run_hooks("admin_style_themes_edit_stylesheet_simple");


Zeile 2046Zeile 2042

// Theme & stylesheet theme ID do not match, editing inherited - we copy to local theme
if($theme['tid'] != $stylesheet['tid'])


// Theme & stylesheet theme ID do not match, editing inherited - we copy to local theme
if($theme['tid'] != $stylesheet['tid'])

		{

		{

			$sid = copy_stylesheet_to_theme($stylesheet, $theme['tid']);
}

			$sid = copy_stylesheet_to_theme($stylesheet, $theme['tid']);
}





		// Insert the modified CSS
$new_stylesheet = $stylesheet['stylesheet'];

		// Insert the modified CSS
$new_stylesheet = $stylesheet['stylesheet'];





		if($mybb->input['serialized'] == 1)
{
$mybb->input['css_bits'] = my_unserialize($mybb->input['css_bits']);

		if($mybb->input['serialized'] == 1)
{
$mybb->input['css_bits'] = my_unserialize($mybb->input['css_bits']);

Zeile 2062Zeile 2058
		foreach($mybb->input['css_bits'] as $field => $value)
{
if(!trim($value) || !trim($field))

		foreach($mybb->input['css_bits'] as $field => $value)
{
if(!trim($value) || !trim($field))

			{

			{

				continue;
}

if($field == "extra")

				continue;
}

if($field == "extra")

			{

			{

				$css_to_insert .= $value."\n";
}
else

				$css_to_insert .= $value."\n";
}
else

Zeile 2075Zeile 2071
				$field = str_replace("_", "-", $field);
$css_to_insert .= "{$field}: {$value};\n";
}

				$field = str_replace("_", "-", $field);
$css_to_insert .= "{$field}: {$value};\n";
}

		}

$new_stylesheet = insert_into_css($css_to_insert, $mybb->input['selector'], $new_stylesheet);

		}

$new_stylesheet = insert_into_css($css_to_insert, $mybb->input['selector'], $new_stylesheet);


// Now we have the new stylesheet, save it
$updated_stylesheet = array(


// Now we have the new stylesheet, save it
$updated_stylesheet = array(

Zeile 2104Zeile 2100
		if(!$mybb->input['ajax'])
{
flash_message($lang->success_stylesheet_updated, 'success');

		if(!$mybb->input['ajax'])
{
flash_message($lang->success_stylesheet_updated, 'success');





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

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

Zeile 2231Zeile 2227
	$table = new Table;
$table->construct_cell("<div style=\"float: right;\">".$form->generate_text_box('css_bits[background]', $properties['background'], array('id' => 'css_bits[background]', 'style' => 'width: 260px;'))."</div><div><strong>{$lang->background}</strong></div>", array('style' => 'width: 20%;'));
$table->construct_cell("<strong>{$lang->extra_css_atribs}</strong><br /><div style=\"align: center;\">".$form->generate_text_area('css_bits[extra]', $properties['extra'], array('id' => 'css_bits[extra]', 'style' => 'width: 98%;', 'rows' => '19'))."</div>", array('rowspan' => 8));

	$table = new Table;
$table->construct_cell("<div style=\"float: right;\">".$form->generate_text_box('css_bits[background]', $properties['background'], array('id' => 'css_bits[background]', 'style' => 'width: 260px;'))."</div><div><strong>{$lang->background}</strong></div>", array('style' => 'width: 20%;'));
$table->construct_cell("<strong>{$lang->extra_css_atribs}</strong><br /><div style=\"align: center;\">".$form->generate_text_area('css_bits[extra]', $properties['extra'], array('id' => 'css_bits[extra]', 'style' => 'width: 98%;', 'rows' => '19'))."</div>", array('rowspan' => 8));

	$table->construct_row();

	$table->construct_row();

	$table->construct_cell("<div style=\"float: right;\">".$form->generate_text_box('css_bits[color]', $properties['color'], array('id' => 'css_bits[color]', 'style' => 'width: 260px;'))."</div><div><strong>{$lang->color}</strong></div>", array('style' => 'width: 40%;'));

	$table->construct_cell("<div style=\"float: right;\">".$form->generate_text_box('css_bits[color]', $properties['color'], array('id' => 'css_bits[color]', 'style' => 'width: 260px;'))."</div><div><strong>{$lang->color}</strong></div>", array('style' => 'width: 40%;'));

	$table->construct_row();

	$table->construct_row();

	$table->construct_cell("<div style=\"float: right;\">".$form->generate_text_box('css_bits[width]', $properties['width'], array('id' => 'css_bits[width]', 'style' => 'width: 260px;'))."</div><div><strong>{$lang->width}</strong></div>", array('style' => 'width: 40%;'));

	$table->construct_cell("<div style=\"float: right;\">".$form->generate_text_box('css_bits[width]', $properties['width'], array('id' => 'css_bits[width]', 'style' => 'width: 260px;'))."</div><div><strong>{$lang->width}</strong></div>", array('style' => 'width: 40%;'));

	$table->construct_row();

	$table->construct_row();

	$table->construct_cell("<div style=\"float: right;\">".$form->generate_text_box('css_bits[font_family]', $properties['font-family'], array('id' => 'css_bits[font_family]', 'style' => 'width: 260px;'))."</div><div><strong>{$lang->font_family}</strong></div>", array('style' => 'width: 40%;'));

	$table->construct_cell("<div style=\"float: right;\">".$form->generate_text_box('css_bits[font_family]', $properties['font-family'], array('id' => 'css_bits[font_family]', 'style' => 'width: 260px;'))."</div><div><strong>{$lang->font_family}</strong></div>", array('style' => 'width: 40%;'));

	$table->construct_row();

	$table->construct_row();

	$table->construct_cell("<div style=\"float: right;\">".$form->generate_text_box('css_bits[font_size]', $properties['font-size'], array('id' => 'css_bits[font_size]', 'style' => 'width: 260px;'))."</div><div><strong>{$lang->font_size}</strong></div>", array('style' => 'width: 40%;'));
$table->construct_row();
$table->construct_cell("<div style=\"float: right;\">".$form->generate_text_box('css_bits[font_style]', $properties['font-style'], array('id' => 'css_bits[font_style]', 'style' => 'width: 260px;'))."</div><div><strong>{$lang->font_style}</strong></div>", array('style' => 'width: 40%;'));

	$table->construct_cell("<div style=\"float: right;\">".$form->generate_text_box('css_bits[font_size]', $properties['font-size'], array('id' => 'css_bits[font_size]', 'style' => 'width: 260px;'))."</div><div><strong>{$lang->font_size}</strong></div>", array('style' => 'width: 40%;'));
$table->construct_row();
$table->construct_cell("<div style=\"float: right;\">".$form->generate_text_box('css_bits[font_style]', $properties['font-style'], array('id' => 'css_bits[font_style]', 'style' => 'width: 260px;'))."</div><div><strong>{$lang->font_style}</strong></div>", array('style' => 'width: 40%;'));

Zeile 2274Zeile 2270
}

if($mybb->input['action'] == "edit_stylesheet" && $mybb->input['mode'] == "advanced")

}

if($mybb->input['action'] == "edit_stylesheet" && $mybb->input['mode'] == "advanced")

{
// Fetch the theme we want to edit this stylesheet in
$query = $db->simple_select("themes", "*", "tid='".$mybb->get_input('tid', MyBB::INPUT_INT)."'");
$theme = $db->fetch_array($query);

if(!$theme['tid'] || $theme['tid'] == 1)
{
flash_message($lang->error_invalid_theme, 'error');
admin_redirect("index.php?module=style-themes");
}

$plugins->run_hooks("admin_style_themes_edit_stylesheet_advanced");

$parent_list = make_parent_theme_list($theme['tid']);
$parent_list = implode(',', $parent_list);

{
// Fetch the theme we want to edit this stylesheet in
$query = $db->simple_select("themes", "*", "tid='".$mybb->get_input('tid', MyBB::INPUT_INT)."'");
$theme = $db->fetch_array($query);

if(!$theme['tid'] || $theme['tid'] == 1)
{
flash_message($lang->error_invalid_theme, 'error');
admin_redirect("index.php?module=style-themes");
}

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

	if(!$parent_list)
{
$parent_list = 1;

Zeile 2363Zeile 2359
<script src="./jscripts/codemirror/mode/css/css.js?ver=1813"></script>
<script src="./jscripts/codemirror/addon/dialog/dialog.js?ver=1813"></script>
<script src="./jscripts/codemirror/addon/search/searchcursor.js?ver=1813"></script>

<script src="./jscripts/codemirror/mode/css/css.js?ver=1813"></script>
<script src="./jscripts/codemirror/addon/dialog/dialog.js?ver=1813"></script>
<script src="./jscripts/codemirror/addon/search/searchcursor.js?ver=1813"></script>

<script src="./jscripts/codemirror/addon/search/search.js?ver=1813"></script>

<script src="./jscripts/codemirror/addon/search/search.js?ver=1821"></script>

';
}


';
}


Zeile 2639Zeile 2635
<script src="./jscripts/codemirror/mode/css/css.js?ver=1813"></script>
<script src="./jscripts/codemirror/addon/dialog/dialog.js?ver=1813"></script>
<script src="./jscripts/codemirror/addon/search/searchcursor.js?ver=1813"></script>

<script src="./jscripts/codemirror/mode/css/css.js?ver=1813"></script>
<script src="./jscripts/codemirror/addon/dialog/dialog.js?ver=1813"></script>
<script src="./jscripts/codemirror/addon/search/searchcursor.js?ver=1813"></script>

<script src="./jscripts/codemirror/addon/search/search.js?ver=1813"></script>

<script src="./jscripts/codemirror/addon/search/search.js?ver=1821"></script>

';
}


';
}


Zeile 2903Zeile 2899
	}

echo '<script type="text/javascript" src="./jscripts/themes.js?ver=1808"></script>';

	}

echo '<script type="text/javascript" src="./jscripts/themes.js?ver=1808"></script>';

	echo '<script type="text/javascript" src="./jscripts/theme_properties.js?ver=1820"></script>';

	echo '<script type="text/javascript" src="./jscripts/theme_properties.js?ver=1821"></script>';

	echo '<script type="text/javascript">
$(function() {
//<![CDATA[

	echo '<script type="text/javascript">
$(function() {
//<![CDATA[

Zeile 2981Zeile 2977
		$plugins->run_hooks("admin_style_themes_force_commit");

$db->update_query("users", $updated_users);

		$plugins->run_hooks("admin_style_themes_force_commit");

$db->update_query("users", $updated_users);

 

// The theme has to be accessible to all usergroups in order to force on all users
if($theme['allowedgroups'] !== "all")
{
$db->update_query("themes", array("allowedgroups" => "all"), "tid='{$theme['tid']}'");
}


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


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