Vergleich admin/modules/style/themes.php - 1.8.6 - 1.8.21

  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("http://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?type=themes&version={$search_version}{$keywords}{$url_page}", $post_data);


if(!$contents)
{


if(!$contents)
{

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


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


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

			$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} {$result['author']['value']}</small></i>");

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

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

			$table->construct_row();
}
}

Zeile 243Zeile 243
	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}')

Zeile 262Zeile 262
				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 284Zeile 282
	echo $search->end();

// Recommended themes = Default; Otherwise search results & pagination

	echo $search->end();

// Recommended themes = Default; Otherwise search results & pagination

	if($mybb->request_method == "post")
{
$table->output("<span style=\"float: right;\"><small><a href=\"http://community.mybb.com/mods.php?action=browse&category=themes\" target=\"_blank\">{$lang->browse_all_themes}</a></small></span>".$lang->sprintf($lang->browse_results_for_mybb, $mybb->version));
}

	if($mybb->request_method == "post")
{
$table->output("<span style=\"float: right;\"><small><a href=\"https://community.mybb.com/mods.php?action=browse&category=themes\" target=\"_blank\" rel=\"noopener\">{$lang->browse_all_themes}</a></small></span>".$lang->sprintf($lang->browse_results_for_mybb, $mybb->version));
}

	else
{

	else
{

		$table->output("<span style=\"float: right;\"><small><a href=\"http://community.mybb.com/mods.php?action=browse&category=themes\" target=\"_blank\">{$lang->browse_all_themes}</a></small></span>".$lang->sprintf($lang->recommended_themes_for_mybb, $mybb->version));

		$table->output("<span style=\"float: right;\"><small><a href=\"https://community.mybb.com/mods.php?action=browse&category=themes\" target=\"_blank\" rel=\"noopener\">{$lang->browse_all_themes}</a></small></span>".$lang->sprintf($lang->recommended_themes_for_mybb, $mybb->version));

	}

	}





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

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





	$page->output_footer();
}

	$page->output_footer();
}





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

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

Zeile 307Zeile 305
		if(!$_FILES['local_file'] && !$mybb->input['url'])
{
$errors[] = $lang->error_missing_url;

		if(!$_FILES['local_file'] && !$mybb->input['url'])
{
$errors[] = $lang->error_missing_url;

		}

		}


if(!$errors)
{


if(!$errors)
{

Zeile 316Zeile 314
			{
// Find out if there was an error with the uploaded file
if($_FILES['local_file']['error'] != 0)

			{
// Find out if there was an error with the uploaded file
if($_FILES['local_file']['error'] != 0)

				{

				{

					$errors[] = $lang->error_uploadfailed.$lang->error_uploadfailed_detail;
switch($_FILES['local_file']['error'])
{

					$errors[] = $lang->error_uploadfailed.$lang->error_uploadfailed_detail;
switch($_FILES['local_file']['error'])
{

Zeile 331Zeile 329
							break;
case 6: // UPLOAD_ERR_NO_TMP_DIR
$errors[] = $lang->error_uploadfailed_php6;

							break;
case 6: // UPLOAD_ERR_NO_TMP_DIR
$errors[] = $lang->error_uploadfailed_php6;

							break;

							break;

						case 7: // UPLOAD_ERR_CANT_WRITE
$errors[] = $lang->error_uploadfailed_php7;
break;

						case 7: // UPLOAD_ERR_CANT_WRITE
$errors[] = $lang->error_uploadfailed_php7;
break;

Zeile 347Zeile 345
					if(!is_uploaded_file($_FILES['local_file']['tmp_name']))
{
$errors[] = $lang->error_uploadfailed_lost;

					if(!is_uploaded_file($_FILES['local_file']['tmp_name']))
{
$errors[] = $lang->error_uploadfailed_lost;

					}

					}

					// Get the contents
$contents = @file_get_contents($_FILES['local_file']['tmp_name']);
// Delete the temporary file if possible

					// Get the contents
$contents = @file_get_contents($_FILES['local_file']['tmp_name']);
// Delete the temporary file if possible

Zeile 357Zeile 355
					{
$errors[] = $lang->error_uploadfailed_nocontents;
}

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

				}

				}

			}
else if(!empty($mybb->input['url']))
{

			}
else if(!empty($mybb->input['url']))
{

Zeile 367Zeile 365
				{
$errors[] = $lang->error_local_file;
}

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

			}

			}

			else
{
// UPLOAD_ERR_NO_FILE

			else
{
// UPLOAD_ERR_NO_FILE

Zeile 388Zeile 386
				if($theme_id > -1)
{
$plugins->run_hooks("admin_style_themes_import_commit");

				if($theme_id > -1)
{
$plugins->run_hooks("admin_style_themes_import_commit");





					// Log admin action
log_admin_action($theme_id);


					// Log admin action
log_admin_action($theme_id);


Zeile 549Zeile 547
			$xml .= "\t\t<{$property}><![CDATA[{$value}]]></{$property}>\r\n";
}
$xml .= "\t</properties>\r\n";

			$xml .= "\t\t<{$property}><![CDATA[{$value}]]></{$property}>\r\n";
}
$xml .= "\t</properties>\r\n";





		// 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 578Zeile 576
						}
}
}

						}
}
}

			}
}


			}
}


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

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

		$inherited_load = array_unique($inherited_load);

$inherited_themes = array();
if(count($inherited_load) > 0)

		$inherited_load = array_unique($inherited_load);

$inherited_themes = $theme_stylesheets = array();
if(count($inherited_load) > 0)

		{
$query = $db->simple_select("themes", "tid, name", "tid IN (".implode(",", $inherited_load).")");
while($inherited_theme = $db->fetch_array($query))
{
$inherited_themes[$inherited_theme['tid']] = $inherited_theme['name'];

		{
$query = $db->simple_select("themes", "tid, name", "tid IN (".implode(",", $inherited_load).")");
while($inherited_theme = $db->fetch_array($query))
{
$inherited_themes[$inherited_theme['tid']] = $inherited_theme['name'];

			}
}

$theme_stylesheets = array();

if(count($inherited_load) > 0)
{

			}







			$query = $db->simple_select("themestylesheets", "*", "tid IN (".implode(",", $inherited_load).")", array('order_by' => 'tid', 'order_dir' => 'desc'));
while($theme_stylesheet = $db->fetch_array($query))
{

			$query = $db->simple_select("themestylesheets", "*", "tid IN (".implode(",", $inherited_load).")", array('order_by' => 'tid', 'order_dir' => 'desc'));
while($theme_stylesheet = $db->fetch_array($query))
{

Zeile 614Zeile 607
		{
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 667Zeile 660
		$plugins->run_hooks("admin_style_themes_export_commit");

// Log admin action

		$plugins->run_hooks("admin_style_themes_export_commit");

// Log admin action

		log_admin_action($theme['tid'], htmlspecialchars_uni($theme['name']));

		log_admin_action($theme['tid'], $theme['name']);


$theme['name'] = rawurlencode($theme['name']);
header("Content-disposition: attachment; filename=".$theme['name']."-theme.xml");


$theme['name'] = rawurlencode($theme['name']);
header("Content-disposition: attachment; filename=".$theme['name']."-theme.xml");

Zeile 677Zeile 670
		header("Expires: 0");
echo $xml;
exit;

		header("Expires: 0");
echo $xml;
exit;

	}


	}


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

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

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

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

Zeile 756Zeile 749
		{
$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)

			if($numthemes)

			{

			{

				$errors[] = $lang->error_theme_already_exists;
}
}

				$errors[] = $lang->error_theme_already_exists;
}
}

Zeile 783Zeile 776
						"version" => $db->escape_string($template['version']),
"dateline" => TIME_NOW
);

						"version" => $db->escape_string($template['version']),
"dateline" => TIME_NOW
);





					if($db->engine == "pgsql")
{
echo " ";
flush();

					if($db->engine == "pgsql")
{
echo " ";
flush();

					}

					}


$db->insert_query("templates", $insert);
}


$db->insert_query("templates", $insert);
}

Zeile 799Zeile 792
					if($property == "inherited")
{
continue;

					if($property == "inherited")
{
continue;

					}

					}


$nprops[$property] = $value;
if($properties['inherited'][$property])


$nprops[$property] = $value;
if($properties['inherited'][$property])

Zeile 879Zeile 872
	$form->output_submit_wrapper($buttons);

$form->end();

	$form->output_submit_wrapper($buttons);

$form->end();





	$page->output_footer();
}


	$page->output_footer();
}


Zeile 889Zeile 882

$query = $db->simple_select("themes", "tid, name");
while($theme = $db->fetch_array($query))


$query = $db->simple_select("themes", "tid, name");
while($theme = $db->fetch_array($query))

	{

	{

		$themes[$theme['tid']] = $theme['name'];
}

if($mybb->request_method == "post")

		$themes[$theme['tid']] = $theme['name'];
}

if($mybb->request_method == "post")

	{

	{

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

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

Zeile 909Zeile 902
			$tid = build_new_theme($mybb->input['name'], null, $mybb->input['tid']);

$plugins->run_hooks("admin_style_themes_add_commit");

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

$plugins->run_hooks("admin_style_themes_add_commit");





			// Log admin action

			// Log admin action

			log_admin_action(htmlspecialchars_uni($mybb->input['name']), $tid);

			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 921Zeile 914
	$page->add_breadcrumb_item($lang->create_new_theme, "index.php?module=style-themes&amp;action=add");

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

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

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


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

if($errors)
{
$page->output_inline_error($errors);
}

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



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

if($errors)
{
$page->output_inline_error($errors);
}

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

Zeile 940Zeile 933
	$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);





	$form->end();

$page->output_footer();

	$form->end();

$page->output_footer();

Zeile 963Zeile 956
	{
admin_redirect("index.php?module=style-themes");
}

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





	$plugins->run_hooks("admin_style_themes_delete");

if($mybb->request_method == "post")

	$plugins->run_hooks("admin_style_themes_delete");

if($mybb->request_method == "post")

	{

	{

		$inherited_theme_cache = array();

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

		$inherited_theme_cache = array();

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

Zeile 1010Zeile 1003
		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");

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

		}
@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->update_query("users", array('style' => 0), "style='{$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']}/");

$children = make_child_theme_list($theme['tid']);
$child_tid = $children[0];

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








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















		$children = (array)make_child_theme_list($theme['tid']);
$child_tids = array();

foreach($children as $child_tid)
{
if($child_tid != 0)
{
$child_tids[] = $child_tid;
}
}

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

$plugins->run_hooks("admin_style_themes_delete_commit");

// Log admin action


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

$plugins->run_hooks("admin_style_themes_delete_commit");

// Log admin action

		log_admin_action($theme['tid'], htmlspecialchars_uni($theme['name']));

		log_admin_action($theme['tid'], $theme['name']);


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


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

Zeile 1079Zeile 1086
			$colors = explode("\n", $mybb->input['colors']);

foreach($colors as $color)

			$colors = explode("\n", $mybb->input['colors']);

foreach($colors as $color)

			{
$color = explode("=", $color);

$properties['colors'][$color[0]] = $color[1];








			{
$color = trim($color);
if(preg_match('/^[a-z0-9]+={1}[a-z0-9]+$/i', $color))
{
$color = explode("=", $color);
$properties['colors'][$color[0]] = $color[1];
}
else
{
$errors[] = $lang->sprintf($lang->error_invalid_color, $color);
}

			}

			}

		}


		}


		if($properties['templateset'] <= 0)

		if($properties['templateset'] <= 0)

		{

		{

			$errors[] = $lang->error_invalid_templateset;

			$errors[] = $lang->error_invalid_templateset;

		}

		}


$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 1155Zeile 1173
			if(!$ts_check)
{
unset($properties['templateset']);

			if(!$ts_check)
{
unset($properties['templateset']);

			}
}

			}
}

		if(!$properties['templateset'])
{
$errors[] = $lang->error_invalid_templateset;
}

		if(!$properties['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 1179Zeile 1197
			}

// Log admin action

			}

// Log admin action

			log_admin_action($theme['tid'], htmlspecialchars_uni($theme['name']));

			log_admin_action($theme['tid'], $theme['name']);


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


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

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


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


	$inherited_themes = array();

	$inherited_themes = $theme_stylesheets = array();

	if(count($inherited_load) > 0)
{
$query = $db->simple_select("themes", "tid, name", "tid IN (".implode(",", $inherited_load).")");

	if(count($inherited_load) > 0)
{
$query = $db->simple_select("themes", "tid, name", "tid IN (".implode(",", $inherited_load).")");

Zeile 1228Zeile 1246
		{
$inherited_themes[$inherited_theme['tid']] = $inherited_theme['name'];
}

		{
$inherited_themes[$inherited_theme['tid']] = $inherited_theme['name'];
}

	}

$theme_stylesheets = array();

 




	if(count($inherited_load) > 0)
{

 
		$query = $db->simple_select("themestylesheets", "*", "", array('order_by' => 'sid DESC, tid', 'order_dir' => 'desc'));
while($theme_stylesheet = $db->fetch_array($query))
{

		$query = $db->simple_select("themestylesheets", "*", "", array('order_by' => 'sid DESC, tid', 'order_dir' => 'desc'));
while($theme_stylesheet = $db->fetch_array($query))
{

Zeile 1339Zeile 1352
		{
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']];
}


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


Zeile 1356Zeile 1369
	{
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 1441Zeile 1454

// It's a file:
++$count;


// It's a file:
++$count;

 

$name = htmlspecialchars_uni($name);


if($actions[0] != "global")
{


if($actions[0] != "global")
{

 
					$actions = array_map('htmlspecialchars_uni', $actions);


					$name = "{$name} ({$lang->actions}: ".implode(',', $actions).")";
}


					$name = "{$name} ({$lang->actions}: ".implode(',', $actions).")";
}


Zeile 1452Zeile 1469
					$sep = " {$lang->and} ";
}
$attached_to .= $sep.$name;

					$sep = " {$lang->and} ";
}
$attached_to .= $sep.$name;





				$sep = $lang->comma;

				$sep = $lang->comma;

			}


			}


			if($attached_to)
{
$attached_to = "<small>{$lang->attached_to} {$attached_to}</small>";
}

if(count($colors))

			if($attached_to)
{
$attached_to = "<small>{$lang->attached_to} {$attached_to}</small>";
}

if(count($colors))

			{

			{

				// Attached to color instead of files.
$count = 1;
$color_list = $sep = '';

				// Attached to color instead of files.
$count = 1;
$color_list = $sep = '';





				foreach($colors as $color)
{
if($count == count($colors) && $count > 1)
{
$sep = " {$lang->and} ";
}

				foreach($colors as $color)
{
if($count == count($colors) && $count > 1)
{
$sep = " {$lang->and} ";
}





					$color_list .= $sep.trim($color);
++$count;

					$color_list .= $sep.trim($color);
++$count;





					$sep = ', ';
}

$attached_to = "<small>{$lang->attached_to} ".$lang->sprintf($lang->colors_attached_to)." {$color_list}</small>";

					$sep = ', ';
}

$attached_to = "<small>{$lang->attached_to} ".$lang->sprintf($lang->colors_attached_to)." {$color_list}</small>";

			}


			}


			if($attached_to == '')
{
// Orphaned! :(

			if($attached_to == '')
{
// Orphaned! :(

Zeile 1490Zeile 1507
			}
}
else

			}
}
else

		{

		{

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

$popup = new PopupMenu("style_{$style['sid']}", $lang->options);

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

$popup = new PopupMenu("style_{$style['sid']}", $lang->options);





		$popup->add_item($lang->edit_style, "index.php?module=style-themes&amp;action=edit_stylesheet&amp;file=".htmlspecialchars_uni($filename)."&amp;tid={$theme['tid']}");
$popup->add_item($lang->properties, "index.php?module=style-themes&amp;action=stylesheet_properties&amp;file=".htmlspecialchars_uni($filename)."&amp;tid={$theme['tid']}");

if($inherited == "")
{
$popup->add_item($lang->delete_revert, "index.php?module=style-themes&amp;action=delete_stylesheet&amp;file=".htmlspecialchars_uni($filename)."&amp;tid={$theme['tid']}&amp;my_post_key={$mybb->post_code}", "return AdminCP.deleteConfirmation(this, '{$lang->confirm_stylesheet_deletion}')");

		$popup->add_item($lang->edit_style, "index.php?module=style-themes&amp;action=edit_stylesheet&amp;file=".htmlspecialchars_uni($filename)."&amp;tid={$theme['tid']}");
$popup->add_item($lang->properties, "index.php?module=style-themes&amp;action=stylesheet_properties&amp;file=".htmlspecialchars_uni($filename)."&amp;tid={$theme['tid']}");

if($inherited == "")
{
$popup->add_item($lang->delete_revert, "index.php?module=style-themes&amp;action=delete_stylesheet&amp;file=".htmlspecialchars_uni($filename)."&amp;tid={$theme['tid']}&amp;my_post_key={$mybb->post_code}", "return AdminCP.deleteConfirmation(this, '{$lang->confirm_stylesheet_deletion}')");

		}

		}


$table->construct_cell("<strong><a href=\"index.php?module=style-themes&amp;action=edit_stylesheet&amp;file=".htmlspecialchars_uni($filename)."&amp;tid={$theme['tid']}\">{$filename}</a></strong>{$inherited}<br />{$attached_to}");
$table->construct_cell($form->generate_numeric_field("disporder[{$theme_stylesheets[$filename]['sid']}]", $properties['disporder'][$filename], array('style' => 'width: 80%; text-align: center;', 'min' => 0)), array("class" => "align_center"));


$table->construct_cell("<strong><a href=\"index.php?module=style-themes&amp;action=edit_stylesheet&amp;file=".htmlspecialchars_uni($filename)."&amp;tid={$theme['tid']}\">{$filename}</a></strong>{$inherited}<br />{$attached_to}");
$table->construct_cell($form->generate_numeric_field("disporder[{$theme_stylesheets[$filename]['sid']}]", $properties['disporder'][$filename], array('style' => 'width: 80%; text-align: center;', 'min' => 0)), array("class" => "align_center"));

Zeile 1515Zeile 1532
	$buttons = array($form->generate_submit_button($lang->save_stylesheet_order));
$form->output_submit_wrapper($buttons);
$form->end();

	$buttons = array($form->generate_submit_button($lang->save_stylesheet_order));
$form->output_submit_wrapper($buttons);
$form->end();





	echo '<br />';

// Theme Properties table
if($errors)
{
$page->output_inline_error($errors);

	echo '<br />';

// Theme Properties table
if($errors)
{
$page->output_inline_error($errors);

	}

	}


$form = new Form("index.php?module=style-themes&amp;action=edit", "post", "edit");
echo $form->generate_hidden_field("tid", $theme['tid']);


$form = new Form("index.php?module=style-themes&amp;action=edit", "post", "edit");
echo $form->generate_hidden_field("tid", $theme['tid']);

Zeile 1550Zeile 1567
	$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 1560Zeile 1577
				continue;
}
$options[$dir] = ucfirst(str_replace(array('_', '.css'), array(' ', ''), $dir));

				continue;
}
$options[$dir] = ucfirst(str_replace(array('_', '.css'), array(' ', ''), $dir));

		}
}

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


		}
}

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


	$form_container->output_row($lang->img_directory, $lang->img_directory_desc, $form->generate_text_box('imgdir', $properties['imgdir'], array('id' => 'imgdir')), 'imgdir');
$form_container->output_row($lang->logo, $lang->logo_desc, $form->generate_text_box('logo', $properties['logo'], array('id' => 'boardlogo')), 'logo');
$form_container->output_row($lang->table_spacing, $lang->table_spacing_desc, $form->generate_numeric_field('tablespace', $properties['tablespace'], array('id' => 'tablespace', 'min' => 0)), 'tablespace');
$form_container->output_row($lang->inner_border, $lang->inner_border_desc, $form->generate_numeric_field('borderwidth', $properties['borderwidth'], array('id' => 'borderwidth', 'min' => 0)), 'borderwidth');

	$form_container->output_row($lang->img_directory, $lang->img_directory_desc, $form->generate_text_box('imgdir', $properties['imgdir'], array('id' => 'imgdir')), 'imgdir');
$form_container->output_row($lang->logo, $lang->logo_desc, $form->generate_text_box('logo', $properties['logo'], array('id' => 'boardlogo')), 'logo');
$form_container->output_row($lang->table_spacing, $lang->table_spacing_desc, $form->generate_numeric_field('tablespace', $properties['tablespace'], array('id' => 'tablespace', 'min' => 0)), 'tablespace');
$form_container->output_row($lang->inner_border, $lang->inner_border_desc, $form->generate_numeric_field('borderwidth', $properties['borderwidth'], array('id' => 'borderwidth', 'min' => 0)), 'borderwidth');





	$form_container->end();

$form_container = new FormContainer($lang->colors_manage);

	$form_container->end();

$form_container = new FormContainer($lang->colors_manage);

Zeile 1584Zeile 1601
		$colors = array_merge($colors, $properties['colors']);

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

		$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 1592Zeile 1609
			{
$mybb->input['colors'] .= "\n";
}

			{
$mybb->input['colors'] .= "\n";
}





			$mybb->input['colors'] .= "{$key}={$color}";
}
}

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

			$mybb->input['colors'] .= "{$key}={$color}";
}
}

$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();
$buttons[] = $form->generate_submit_button($lang->save_theme_properties);

	$form_container->end();

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

	$form->output_submit_wrapper($buttons);

	$form->output_submit_wrapper($buttons);

	$form->end();

$page->output_footer();

	$form->end();

$page->output_footer();

Zeile 1665Zeile 1682
		if(get_extension($mybb->input['name']) != "css")
{
// Does not end with '.css'

		if(get_extension($mybb->input['name']) != "css")
{
// Does not end with '.css'

			$errors[] = $lang->sprintf($lang->error_missing_stylesheet_extension, $mybb->input['name']);




			$errors[] = $lang->sprintf(
$lang->error_missing_stylesheet_extension,
htmlspecialchars_uni($mybb->input['name'])
);

		}

if(!$errors)

		}

if(!$errors)

Zeile 1739Zeile 1759
				$update_d = true;

$db->update_query("themestylesheets", array('lastmodified' => TIME_NOW), "sid='{$stylesheet['sid']}'", 1);

				$update_d = true;

$db->update_query("themestylesheets", array('lastmodified' => TIME_NOW), "sid='{$stylesheet['sid']}'", 1);

				if(!cache_stylesheet($theme['tid'], str_replace('/', '', $mybb->input['name']), $theme['stylesheet']))

				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']}");

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

			$plugins->run_hooks("admin_style_themes_stylesheet_properties_commit");





			// Log admin action

			// Log admin action

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

			log_admin_action($stylesheet['sid'], $mybb->input['name'], $theme['tid'], $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']}");

		}

		}

	}

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

	}

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

Zeile 1832Zeile 1855
		{
// Verify this is a color for this theme
if(array_key_exists($name, $properties['colors']))

		{
// Verify this is a color for this theme
if(array_key_exists($name, $properties['colors']))

			{

			{

				$stylesheet['colors'][] = $name;
}


				$stylesheet['colors'][] = $name;
}


Zeile 1909Zeile 1932
	{
$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>";
}

$actions = '<script type="text/javascript">
function checkAction(id)
{
var checked = \'\';

$(\'.\'+id+\'s_check\').each(function(e, val)
{
if($(this).prop(\'checked\') == true)
{
checked = $(this).val();
}
});
$(\'.\'+id+\'s\').each(function(e)
{
$(this).hide();
});


$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">
function checkAction(id)
{
var checked = \'\';

$(\'.\'+id+\'s_check\').each(function(e, val)
{
if($(this).prop(\'checked\') == true)
{
checked = $(this).val();
}
});
$(\'.\'+id+\'s\').each(function(e)
{
$(this).hide();
});

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

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

Zeile 1963Zeile 1986
	$form_container->output_row($lang->attached_to, $lang->attached_to_desc, $actions);

$form_container->end();

	$form_container->output_row($lang->attached_to, $lang->attached_to_desc, $actions);

$form_container->end();





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

$form->output_submit_wrapper($buttons);

echo <<<EOF


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

$form->output_submit_wrapper($buttons);

echo <<<EOF


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

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

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

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


$form->end();



$form->end();


	$page->output_footer();
}


	$page->output_footer();
}


Zeile 2057Zeile 2080
		// Now we have the new stylesheet, save it
$updated_stylesheet = array(
"cachefile" => $db->escape_string($stylesheet['name']),

		// Now we have the new stylesheet, save it
$updated_stylesheet = array(
"cachefile" => $db->escape_string($stylesheet['name']),

			"stylesheet" => $db->escape_string(unfix_css_urls($new_stylesheet)),

			"stylesheet" => $db->escape_string($new_stylesheet),

			"lastmodified" => TIME_NOW
);
$db->update_query("themestylesheets", $updated_stylesheet, "sid='{$sid}'");

			"lastmodified" => TIME_NOW
);
$db->update_query("themestylesheets", $updated_stylesheet, "sid='{$sid}'");

Zeile 2102Zeile 2125
		// 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');

	}


	}


	$css_array = css_to_array($stylesheet['stylesheet']);
$selector_list = get_selectors_as_options($css_array, $mybb->input['selector']);

// Do we not have any selectors? Send em to the full edit page
if(!$selector_list)

	$css_array = css_to_array($stylesheet['stylesheet']);
$selector_list = get_selectors_as_options($css_array, $mybb->input['selector']);

// Do we not have any selectors? Send em to the full edit page
if(!$selector_list)

	{

	{

		flash_message($lang->error_cannot_parse, 'error');
admin_redirect("index.php?module=style-themes&action=edit_stylesheet&tid={$theme['tid']}&file=".htmlspecialchars_uni($stylesheet['name'])."&mode=advanced");
exit;
}

		flash_message($lang->error_cannot_parse, 'error');
admin_redirect("index.php?module=style-themes&action=edit_stylesheet&tid={$theme['tid']}&file=".htmlspecialchars_uni($stylesheet['name'])."&mode=advanced");
exit;
}





	// Fetch list of all of the stylesheets for this theme
$stylesheets = fetch_theme_stylesheets($theme);
$this_stylesheet = $stylesheets[$stylesheet['name']];
unset($stylesheets);

	// Fetch list of all of the stylesheets for this theme
$stylesheets = fetch_theme_stylesheets($theme);
$this_stylesheet = $stylesheets[$stylesheet['name']];
unset($stylesheets);





	$page->extra_header .= "
<script type=\"text/javascript\">
var my_post_key = '".$mybb->post_code."';
</script>";

	$page->extra_header .= "
<script type=\"text/javascript\">
var my_post_key = '".$mybb->post_code."';
</script>";





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


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


Zeile 2144Zeile 2167
		else
{
$page->output_alert($lang->sprintf($lang->stylesheet_inherited, $stylesheet_parent), "ajax_alert");

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

		}
}

		}
}


$sub_tabs['edit_stylesheet'] = array(
'title' => $lang->edit_stylesheet_simple_mode,


$sub_tabs['edit_stylesheet'] = array(
'title' => $lang->edit_stylesheet_simple_mode,

Zeile 2232Zeile 2255

$form->output_submit_wrapper($buttons);



$form->output_submit_wrapper($buttons);


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

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

	echo '<script type="text/javascript">


	echo '<script type="text/javascript">


$(document).ready(function() {

$(function() {

//<![CDATA[
ThemeSelector.init("./index.php?module=style-themes&action=xmlhttp_stylesheet", "./index.php?module=style-themes&action=edit_stylesheet", $("#selector"), $("#stylesheet"), "'.htmlspecialchars_uni($mybb->input['file']).'", $("#selector_form"), "'.$mybb->input['tid'].'");
lang.saving = "'.$lang->saving.'";

//<![CDATA[
ThemeSelector.init("./index.php?module=style-themes&action=xmlhttp_stylesheet", "./index.php?module=style-themes&action=edit_stylesheet", $("#selector"), $("#stylesheet"), "'.htmlspecialchars_uni($mybb->input['file']).'", $("#selector_form"), "'.$mybb->input['tid'].'");
lang.saving = "'.$lang->saving.'";

Zeile 2247Zeile 2270

$page->output_footer();
}


$page->output_footer();
}





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

{
// 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;
}

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


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

Zeile 2292Zeile 2315
		// Now we have the new stylesheet, save it
$updated_stylesheet = array(
"cachefile" => $db->escape_string($stylesheet['name']),

		// Now we have the new stylesheet, save it
$updated_stylesheet = array(
"cachefile" => $db->escape_string($stylesheet['name']),

			"stylesheet" => $db->escape_string(unfix_css_urls($mybb->input['stylesheet'])),

			"stylesheet" => $db->escape_string($mybb->input['stylesheet']),

			"lastmodified" => TIME_NOW
);
$db->update_query("themestylesheets", $updated_stylesheet, "sid='{$sid}'");

			"lastmodified" => TIME_NOW
);
$db->update_query("themestylesheets", $updated_stylesheet, "sid='{$sid}'");

Zeile 2316Zeile 2339
		if(!$mybb->input['save_close'])
{
admin_redirect("index.php?module=style-themes&action=edit_stylesheet&file=".htmlspecialchars_uni($stylesheet['name'])."&tid={$theme['tid']}&mode=advanced");

		if(!$mybb->input['save_close'])
{
admin_redirect("index.php?module=style-themes&action=edit_stylesheet&file=".htmlspecialchars_uni($stylesheet['name'])."&tid={$theme['tid']}&mode=advanced");

		}

		}

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

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

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

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

<link href="./jscripts/codemirror/lib/codemirror.css" rel="stylesheet">
<link href="./jscripts/codemirror/theme/mybb.css?ver=1804" rel="stylesheet">
<link href="./jscripts/codemirror/addon/dialog/dialog-mybb.css" rel="stylesheet">
<script src="./jscripts/codemirror/lib/codemirror.js"></script>
<script src="./jscripts/codemirror/mode/css/css.js"></script>
<script src="./jscripts/codemirror/addon/dialog/dialog.js"></script>
<script src="./jscripts/codemirror/addon/search/searchcursor.js"></script>
<script src="./jscripts/codemirror/addon/search/search.js"></script>

<link href="./jscripts/codemirror/lib/codemirror.css?ver=1813" rel="stylesheet">
<link href="./jscripts/codemirror/theme/mybb.css?ver=1813" rel="stylesheet">
<link href="./jscripts/codemirror/addon/dialog/dialog-mybb.css?ver=1813" rel="stylesheet">
<script src="./jscripts/codemirror/lib/codemirror.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=1821"></script>

';
}


';
}


Zeile 2413Zeile 2436
				mode: "text/css",
theme: "mybb"
});</script>';

				mode: "text/css",
theme: "mybb"
});</script>';

	}


	}


	$page->output_footer();
}


	$page->output_footer();
}


Zeile 2459Zeile 2482
	{
$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);

Zeile 2466Zeile 2492
		$plugins->run_hooks("admin_style_themes_delete_stylesheet_commit");

// Log admin action

		$plugins->run_hooks("admin_style_themes_delete_stylesheet_commit");

// Log admin action

		log_admin_action($stylesheet['sid'], $stylesheet['name'], $theme['tid'], htmlspecialchars_uni($theme['name']));

		log_admin_action($stylesheet['sid'], $stylesheet['name'], $theme['tid'], $theme['name']);


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


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

Zeile 2594Zeile 2620
			$plugins->run_hooks("admin_style_themes_add_stylesheet_commit");

// Log admin action

			$plugins->run_hooks("admin_style_themes_add_stylesheet_commit");

// Log admin action

			log_admin_action($sid, $mybb->input['name'], $theme['tid'], htmlspecialchars_uni($theme['name']));

			log_admin_action($sid, $mybb->input['name'], $theme['tid'], $theme['name']);


flash_message($lang->success_stylesheet_added, 'success');
admin_redirect("index.php?module=style-themes&action=edit_stylesheet&tid={$mybb->input['tid']}&sid={$sid}&file=".urlencode($mybb->input['name']));


flash_message($lang->success_stylesheet_added, 'success');
admin_redirect("index.php?module=style-themes&action=edit_stylesheet&tid={$mybb->input['tid']}&sid={$sid}&file=".urlencode($mybb->input['name']));

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

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

<link href="./jscripts/codemirror/lib/codemirror.css" rel="stylesheet">
<link href="./jscripts/codemirror/theme/mybb.css?ver=1804" rel="stylesheet">
<link href="./jscripts/codemirror/addon/dialog/dialog-mybb.css" rel="stylesheet">
<script src="./jscripts/codemirror/lib/codemirror.js"></script>
<script src="./jscripts/codemirror/mode/css/css.js"></script>
<script src="./jscripts/codemirror/addon/dialog/dialog.js"></script>
<script src="./jscripts/codemirror/addon/search/searchcursor.js"></script>
<script src="./jscripts/codemirror/addon/search/search.js"></script>

<link href="./jscripts/codemirror/lib/codemirror.css?ver=1813" rel="stylesheet">
<link href="./jscripts/codemirror/theme/mybb.css?ver=1813" rel="stylesheet">
<link href="./jscripts/codemirror/addon/dialog/dialog-mybb.css?ver=1813" rel="stylesheet">
<script src="./jscripts/codemirror/lib/codemirror.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=1821"></script>

';
}


';
}


Zeile 2874Zeile 2900
			});</script>';
}


			});</script>';
}


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

	echo '<script type="text/javascript" src="./jscripts/themes.js?ver=1808"></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 2918Zeile 2944
	$plugins->run_hooks("admin_style_themes_set_default_commit");

// Log admin action

	$plugins->run_hooks("admin_style_themes_set_default_commit");

// Log admin action

	log_admin_action($theme['tid'], htmlspecialchars_uni($theme['name']));

	log_admin_action($theme['tid'], $theme['name']);


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


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

Zeile 2953Zeile 2979
		$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

		log_admin_action($theme['tid'], htmlspecialchars_uni($theme['name']));

		log_admin_action($theme['tid'], $theme['name']);


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


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