Vergleich admin/modules/style/themes.php - 1.8.1 - 1.8.19

  Keine Änderungen   Hinzugefügt   Modifiziert   Entfernt
Zeile 35Zeile 35
if($mybb->input['action'] == "xmlhttp_stylesheet" && $mybb->request_method == "post")
{
// Fetch the theme we want to edit this stylesheet in

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

	$query = $db->simple_select("themes", "*", "tid='".$mybb->get_input('tid', 1)."'");

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

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

if(!$theme['tid'] || $theme['tid'] == 1)

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

if(!$theme['tid'] || $theme['tid'] == 1)

Zeile 155Zeile 155

if($mybb->input['page'])
{


if($mybb->input['page'])
{

		$url_page = "&page=".$mybb->get_input('page', 1);

		$url_page = "&page=".$mybb->get_input('page', MyBB::INPUT_INT);

	}
else
{

	}
else
{

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 199Zeile 199
			unset($tree['results']['result']);
$tree['results']['result'][0] = $only_theme;
}

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

 

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


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


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

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










			$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['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} {$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 270Zeile 282
		</script>\n";
echo "</div>\n";
echo $search->end();

		</script>\n";
echo "</div>\n";
echo $search->end();





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

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

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

Zeile 367Zeile 379
				$options = array(
'no_stylesheets' => ($mybb->input['import_stylesheets'] ? 0 : 1),
'no_templates' => ($mybb->input['import_templates'] ? 0 : 1),

				$options = array(
'no_stylesheets' => ($mybb->input['import_stylesheets'] ? 0 : 1),
'no_templates' => ($mybb->input['import_templates'] ? 0 : 1),

					'version_compat' => (int)$mybb->input['version_compat'],
'parent' => $mybb->get_input('tid', 1),

					'version_compat' => $mybb->get_input('version_compat', MyBB::INPUT_INT),
'parent' => $mybb->get_input('tid', MyBB::INPUT_INT),

					'force_name_check' => true,
);
$theme_id = import_theme_xml($contents, $options);

					'force_name_check' => true,
);
$theme_id = import_theme_xml($contents, $options);

Zeile 376Zeile 388
				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 478Zeile 490
		<table cellpadding="4">
<tr>
<td>'.$form->generate_text_box("url", $mybb->input['file']).'</td>

		<table cellpadding="4">
<tr>
<td>'.$form->generate_text_box("url", $mybb->input['file']).'</td>

				</tr>

				</tr>

		</table></dd>
</dl>
<script type="text/javascript">
checkAction(\'import\');
</script>';

		</table></dd>
</dl>
<script type="text/javascript">
checkAction(\'import\');
</script>';





	$form_container = new FormContainer($lang->import_a_theme);
$form_container->output_row($lang->import_from, $lang->import_from_desc, $actions, 'file');
$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->output_row($lang->new_name, $lang->new_name_desc, $form->generate_text_box('name', $mybb->input['name'], array('id' => 'name')), 'name');
$form_container->output_row($lang->advanced_options, "", $form->generate_check_box('version_compat', '1', $lang->ignore_version_compatibility, array('checked' => $mybb->input['version_compat'], 'id' => 'version_compat'))."<br /><small>{$lang->ignore_version_compat_desc}</small><br />".$form->generate_check_box('import_stylesheets', '1', $lang->import_stylesheets, array('checked' => $mybb->input['import_stylesheets'], 'id' => 'import_stylesheets'))."<br /><small>{$lang->import_stylesheets_desc}</small><br />".$form->generate_check_box('import_templates', '1', $lang->import_templates, array('checked' => $mybb->input['import_templates'], 'id' => 'import_templates'))."<br /><small>{$lang->import_templates_desc}</small>");

	$form_container = new FormContainer($lang->import_a_theme);
$form_container->output_row($lang->import_from, $lang->import_from_desc, $actions, 'file');
$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->output_row($lang->new_name, $lang->new_name_desc, $form->generate_text_box('name', $mybb->input['name'], array('id' => 'name')), 'name');
$form_container->output_row($lang->advanced_options, "", $form->generate_check_box('version_compat', '1', $lang->ignore_version_compatibility, array('checked' => $mybb->input['version_compat'], 'id' => 'version_compat'))."<br /><small>{$lang->ignore_version_compat_desc}</small><br />".$form->generate_check_box('import_stylesheets', '1', $lang->import_stylesheets, array('checked' => $mybb->input['import_stylesheets'], 'id' => 'import_stylesheets'))."<br /><small>{$lang->import_stylesheets_desc}</small><br />".$form->generate_check_box('import_templates', '1', $lang->import_templates, array('checked' => $mybb->input['import_templates'], 'id' => 'import_templates'))."<br /><small>{$lang->import_templates_desc}</small>");





	$form_container->end();

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

$form->output_submit_wrapper($buttons);

	$form_container->end();

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

$form->output_submit_wrapper($buttons);





	$form->end();

$page->output_footer();
}

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

	$form->end();

$page->output_footer();
}

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

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

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

{
$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'])
{
flash_message($lang->error_invalid_theme, 'error');
admin_redirect("index.php?module=style-themes");
}


$plugins->run_hooks("admin_style_themes_export");



$plugins->run_hooks("admin_style_themes_export");


Zeile 529Zeile 541

if(is_array($value))
{


if(is_array($value))
{

				$value = serialize($value);

				$value = my_serialize($value);

			}

$value = str_replace(']]>', ']]]]><![CDATA[>', $value);

			}

$value = str_replace(']]>', ']]]]><![CDATA[>', $value);

Zeile 546Zeile 558

// Now we loop through the list of stylesheets for each file
foreach($file_stylesheets as $file => $action_stylesheet)


// Now we loop through the list of stylesheets for each file
foreach($file_stylesheets as $file => $action_stylesheet)

		{

		{

			if($file == 'inherited' || !is_array($action_stylesheet))
{
continue;
}

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

			if($file == 'inherited' || !is_array($action_stylesheet))
{
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 572Zeile 584
		$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).")");
while($inherited_theme = $db->fetch_array($query))
{
$inherited_themes[$inherited_theme['tid']] = $inherited_theme['name'];

		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'];

			}
}

$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 602Zeile 609
		{
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 653Zeile 660
		$xml .= "</theme>";

$plugins->run_hooks("admin_style_themes_export_commit");

		$xml .= "</theme>";

$plugins->run_hooks("admin_style_themes_export_commit");





		// Log admin action

		// 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 666Zeile 673
		echo $xml;
exit;
}

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





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

$sub_tabs['edit_stylesheets'] = array(

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

$sub_tabs['edit_stylesheets'] = array(

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

		'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,


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

Zeile 722Zeile 729

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


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

	$query = $db->simple_select("themes", "*", "tid='".$mybb->get_input('tid', 1)."'");

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

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

// Does the theme not exist?

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

// Does the theme not exist?

Zeile 744Zeile 751
		{
$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;
}
}





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

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

			$sid = $properties['sid'];

			$sid = $properties['templateset'];

			$nprops = null;

			$nprops = null;

			if($mybb->input['duplicate_templates'])
{
$nsid = $db->insert_query("templatesets", array('title' => $db->escape_string($mybb->input['name'])." Templates"));


			if($mybb->input['duplicate_templates'])
{
$nsid = $db->insert_query("templatesets", array('title' => $db->escape_string($mybb->input['name'])." Templates"));


				// Copy all old Templates to our new templateset
$query = $db->simple_select("templates", "*", "sid='{$sid}'");
while($template = $db->fetch_array($query))

				// Copy all old Templates to our new templateset
$query = $db->simple_select("templates", "*", "sid='{$sid}'");
while($template = $db->fetch_array($query))

Zeile 899Zeile 906
			$plugins->run_hooks("admin_style_themes_add_commit");

// Log admin action

			$plugins->run_hooks("admin_style_themes_add_commit");

// 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 936Zeile 943

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


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

	$query = $db->simple_select("themes", "*", "tid='".$mybb->get_input('tid', 1)."'");

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

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

Zeile 966Zeile 973
			if(!$theme2['stylesheets']['inherited'])
{
continue;

			if(!$theme2['stylesheets']['inherited'])
{
continue;

			}

			}


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


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

Zeile 975Zeile 982

// Are any other themes relying on stylesheets from this theme? Get a list and show an error
foreach($inherited_theme_cache as $tid => $inherited)


// Are any other themes relying on stylesheets from this theme? Get a list and show an error
foreach($inherited_theme_cache as $tid => $inherited)

		{

		{

			foreach($inherited as $file => $value)
{
foreach($value as $filepath => $val)

			foreach($inherited as $file => $value)
{
foreach($value as $filepath => $val)

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

		{
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))
{
@unlink(MYBB_ROOT."cache/themes/theme{$theme['tid']}/{$cachefile['cachefile']}");


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

 

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

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

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





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


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

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

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














$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

		$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 1032Zeile 1053
}

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

}

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

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

// Does the theme not exist?
if(!$theme['tid'] || $theme['tid'] == 1)
{
flash_message($lang->error_invalid_theme, 'error');

{
$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'] || $theme['tid'] == 1)
{
flash_message($lang->error_invalid_theme, 'error');

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

$plugins->run_hooks("admin_style_themes_edit");

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

$plugins->run_hooks("admin_style_themes_edit");





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

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

			'templateset' => (int)$mybb->input['templateset'],

			'templateset' => $mybb->get_input('templateset', MyBB::INPUT_INT),

			'editortheme' => $mybb->input['editortheme'],
'imgdir' => $mybb->input['imgdir'],
'logo' => $mybb->input['logo'],

			'editortheme' => $mybb->input['editortheme'],
'imgdir' => $mybb->input['imgdir'],
'logo' => $mybb->input['logo'],

			'tablespace' => (int)$mybb->input['tablespace'],
'borderwidth' => (int)$mybb->input['borderwidth'],

			'tablespace' => $mybb->get_input('tablespace', MyBB::INPUT_INT),
'borderwidth' => $mybb->get_input('borderwidth', MyBB::INPUT_INT),

			'color' => $mybb->input['color']
);


			'color' => $mybb->input['color']
);


Zeile 1068Zeile 1089

foreach($colors as $color)
{


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();
if(is_array($mybb->input['allowedgroups']))
{

		$allowedgroups = array();
if(is_array($mybb->input['allowedgroups']))
{

Zeile 1106Zeile 1138

$update_array = array(
'name' => $db->escape_string($mybb->input['name']),


$update_array = array(
'name' => $db->escape_string($mybb->input['name']),

			'pid' => $mybb->get_input('pid', 1),

			'pid' => $mybb->get_input('pid', MyBB::INPUT_INT),

			'allowedgroups' => $allowedgroups,

			'allowedgroups' => $allowedgroups,

			'properties' => $db->escape_string(serialize($properties))

			'properties' => $db->escape_string(my_serialize($properties))

		);

// perform validation
if(!$update_array['name'])
{
$errors[] = $lang->error_missing_name;

		);

// perform validation
if(!$update_array['name'])
{
$errors[] = $lang->error_missing_name;

		}

		}

		else
{
$query = $db->simple_select("themes", "COUNT(tid) as numthemes", "name = '".$db->escape_string($update_array['name'])."' AND tid != '{$theme['tid']}'");

		else
{
$query = $db->simple_select("themes", "COUNT(tid) as numthemes", "name = '".$db->escape_string($update_array['name'])."' AND tid != '{$theme['tid']}'");

Zeile 1159Zeile 1191
			$plugins->run_hooks("admin_style_themes_edit_commit");

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

			$plugins->run_hooks("admin_style_themes_edit_commit");

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

 
			update_theme_stylesheet_list($theme['tid']);


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


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

Zeile 1166Zeile 1199
			}

// 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 1207Zeile 1240
	$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).")");
while($inherited_theme = $db->fetch_array($query))
{
$inherited_themes[$inherited_theme['tid']] = $inherited_theme['name'];

	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'];

		}
}

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

		{

		{

			if(!isset($theme_stylesheets[$theme_stylesheet['name']]) && in_array($theme_stylesheet['tid'], $inherited_load))
{
$theme_stylesheets[$theme_stylesheet['name']] = $theme_stylesheet;

			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['sid']] = $theme_stylesheet['name'];
}


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

Zeile 1252Zeile 1280

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


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

		}

asort($orders, SORT_NUMERIC);

		}

asort($orders, SORT_NUMERIC);


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

$update_array = array(


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

$update_array = array(

			"properties" => $db->escape_string(serialize($properties))

			"properties" => $db->escape_string(my_serialize($properties))

		);

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

		);

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

Zeile 1323Zeile 1351
	foreach($properties['disporder'] as $style_name => $order)
{
foreach($stylesheets as $filename => $style)

	foreach($properties['disporder'] as $style_name => $order)
{
foreach($stylesheets as $filename => $style)

		{

		{

			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 1343Zeile 1371
	{
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 1492Zeile 1520
		}

$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("<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;')), array("class" => "align_center"));

		$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($popup->fetch(), array("class" => "align_center"));
$table->construct_row();
}

		$table->construct_cell($popup->fetch(), array("class" => "align_center"));
$table->construct_row();
}

Zeile 1527Zeile 1555
		$options[(int)$usergroup['gid']] = $usergroup['title'];
}
$form_container->output_row($lang->allowed_user_groups, $lang->allowed_user_groups_desc, $form->generate_select_box('allowedgroups[]', $options, explode(",", $theme['allowedgroups']), array('id' => 'allowedgroups', 'multiple' => true, 'size' => 5)), 'allowedgroups');

		$options[(int)$usergroup['gid']] = $usergroup['title'];
}
$form_container->output_row($lang->allowed_user_groups, $lang->allowed_user_groups_desc, $form->generate_select_box('allowedgroups[]', $options, explode(",", $theme['allowedgroups']), array('id' => 'allowedgroups', 'multiple' => true, 'size' => 5)), 'allowedgroups');


$options = array();


$options = array();

	$query = $db->simple_select("templatesets", "*", "", array('order_by' => 'title'));
while($templateset = $db->fetch_array($query))
{
$options[(int)$templateset['sid']] = $templateset['title'];

	$query = $db->simple_select("templatesets", "*", "", array('order_by' => 'title'));
while($templateset = $db->fetch_array($query))
{
$options[(int)$templateset['sid']] = $templateset['title'];

	}

	}

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

Zeile 1554Zeile 1582

$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->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')), 'tablespace');
$form_container->output_row($lang->inner_border, $lang->inner_border_desc, $form->generate_numeric_field('borderwidth', $properties['borderwidth'], array('id' => 'borderwidth')), 'borderwidth');


	$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 1564Zeile 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
{
$colors = array('none' => $lang->colors_please_select);
$colors = array_merge($colors, $properties['colors']);

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

$mybb->input['colors'] = '';

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

$mybb->input['colors'] = '';

Zeile 1593Zeile 1621
	$buttons[] = $form->generate_submit_button($lang->save_theme_properties);
$form->output_submit_wrapper($buttons);
$form->end();

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





	$page->output_footer();
}

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

	$page->output_footer();
}

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

{
// Fetch the theme we want to edit this stylesheet in
$query = $db->simple_select("themes", "*", "tid='".$mybb->get_input('tid', 1)."'");
$theme = $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)
{


if(!$theme['tid'] || $theme['tid'] == 1)
{

Zeile 1726Zeile 1754
				$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");

// Log admin action

			$plugins->run_hooks("admin_style_themes_stylesheet_properties_commit");

// Log admin action

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


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

Zeile 1876Zeile 1907
		{
$global_checked[3] = "";
$global_checked[2] = "checked=\"checked\"";

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

			$global_checked[1] = "";

			$global_checked[1] = "";

		}

if(!empty($stylesheet['colors']))

		}

if(!empty($stylesheet['colors']))

Zeile 1974Zeile 2005
if($mybb->input['action'] == "edit_stylesheet" && (!isset($mybb->input['mode']) || $mybb->input['mode'] == "simple"))
{
// Fetch the theme we want to edit this stylesheet in

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', 1)."'");

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

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

if(!$theme['tid'] || $theme['tid'] == 1)

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

if(!$theme['tid'] || $theme['tid'] == 1)

Zeile 2044Zeile 2075
		// 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 2219Zeile 2250

$form->output_submit_wrapper($buttons);



$form->output_submit_wrapper($buttons);


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

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

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

$(document).ready(function() {
//<![CDATA[

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

$(document).ready(function() {
//<![CDATA[

	new ThemeSelector("./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'].'");

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

	lang.saving = "'.$lang->saving.'";
});
//]]>

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

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

	$query = $db->simple_select("themes", "*", "tid='".$mybb->get_input('tid', 1)."'");

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

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

if(!$theme['tid'] || $theme['tid'] == 1)

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

if(!$theme['tid'] || $theme['tid'] == 1)

Zeile 2279Zeile 2310
		// 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 2318Zeile 2349
	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" 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=1813"></script>

';
}


';
}


Zeile 2379Zeile 2410
	$table = new Table;
$table->construct_cell($form->generate_text_area('stylesheet', $stylesheet['stylesheet'], array('id' => 'stylesheet', 'style' => 'width: 99%;', 'class' => '', 'rows' => '30')));
$table->construct_row();

	$table = new Table;
$table->construct_cell($form->generate_text_area('stylesheet', $stylesheet['stylesheet'], array('id' => 'stylesheet', 'style' => 'width: 99%;', 'class' => '', 'rows' => '30')));
$table->construct_row();

	$table->output("{$lang->full_stylesheet_for} ".htmlspecialchars_uni($stylesheet['name']));

	$table->output($lang->full_stylesheet_for.' '.htmlspecialchars_uni($stylesheet['name']), 1, 'tfixed');


$buttons[] = $form->generate_submit_button($lang->save_changes, array('id' => 'save', 'name' => 'save'));
$buttons[] = $form->generate_submit_button($lang->save_changes_and_close, array('id' => 'save_close', 'name' => 'save_close'));


$buttons[] = $form->generate_submit_button($lang->save_changes, array('id' => 'save', 'name' => 'save'));
$buttons[] = $form->generate_submit_button($lang->save_changes_and_close, array('id' => 'save_close', 'name' => 'save_close'));

Zeile 2390Zeile 2421

if($admin_options['codepress'] != 0)
{


if($admin_options['codepress'] != 0)
{

		echo "<script type=\"text/javascript\">
var editor = CodeMirror.fromTextArea(document.getElementById(\"stylesheet\"), {

		echo '<script type="text/javascript">
var editor = CodeMirror.fromTextArea(document.getElementById("stylesheet"), {

				lineNumbers: true,

				lineNumbers: true,

				tabMode: \"indent\",
theme: \"mybb\",
lineWrapping: true
});</script>";




				lineWrapping: true,
viewportMargin: Infinity,
indentWithTabs: true,
indentUnit: 4,
mode: "text/css",
theme: "mybb"
});</script>';

	}

$page->output_footer();

	}

$page->output_footer();

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

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

	$query = $db->simple_select("themes", "*", "tid='".$mybb->get_input('tid', 1)."'");

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

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

if(!$theme['tid'] || $theme['tid'] == 1)

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

if(!$theme['tid'] || $theme['tid'] == 1)

Zeile 2443Zeile 2477
	{
$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 2450Zeile 2487
		$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 2464Zeile 2501
if($mybb->input['action'] == "add_stylesheet")
{
// Fetch the theme we want to edit this stylesheet in

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

	$query = $db->simple_select("themes", "*", "tid='".$mybb->get_input('tid', 1)."'");

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

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

if(!$theme['tid'] || $theme['tid'] == 1)

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

if(!$theme['tid'] || $theme['tid'] == 1)

Zeile 2558Zeile 2595
			// Add Stylesheet
$insert_array = array(
'name' => $db->escape_string($mybb->input['name']),

			// Add Stylesheet
$insert_array = array(
'name' => $db->escape_string($mybb->input['name']),

				'tid' => $mybb->get_input('tid', 1),

				'tid' => $mybb->get_input('tid', MyBB::INPUT_INT),

				'attachedto' => implode('|', array_map(array($db, "escape_string"), $attached)),
'stylesheet' => $db->escape_string($stylesheet),
'cachefile' => $db->escape_string(str_replace('/', '', $mybb->input['name'])),

				'attachedto' => implode('|', array_map(array($db, "escape_string"), $attached)),
'stylesheet' => $db->escape_string($stylesheet),
'cachefile' => $db->escape_string(str_replace('/', '', $mybb->input['name'])),

Zeile 2578Zeile 2615
			$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 2588Zeile 2625
	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" 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=1813"></script>

';
}


';
}


Zeile 2812Zeile 2849

echo $form->generate_hidden_field("sid", $stylesheet['sid'])."<br />\n";



echo $form->generate_hidden_field("sid", $stylesheet['sid'])."<br />\n";


	$form_container = new FormContainer("{$lang->add_stylesheet_to} ".htmlspecialchars_uni($theme['name']));

	$form_container = new FormContainer($lang->add_stylesheet_to.' '.htmlspecialchars_uni($theme['name']), 'tfixed');

	$form_container->output_row($lang->file_name, $lang->file_name_desc, $form->generate_text_box('name', $mybb->input['name'], array('id' => 'name', 'style' => 'width: 200px;')), 'name');

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

	$form_container->output_row($lang->file_name, $lang->file_name_desc, $form->generate_text_box('name', $mybb->input['name'], array('id' => 'name', 'style' => 'width: 200px;')), 'name');

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

Zeile 2846Zeile 2883

if($admin_options['codepress'] != 0)
{


if($admin_options['codepress'] != 0)
{

		echo "<script type=\"text/javascript\">
var editor = CodeMirror.fromTextArea(document.getElementById(\"stylesheet\"), {

		echo '<script type="text/javascript">
var editor = CodeMirror.fromTextArea(document.getElementById("stylesheet"), {

				lineNumbers: true,

				lineNumbers: true,

				tabMode: \"indent\",
theme: \"mybb\",
lineWrapping: true
});</script>";




				lineWrapping: true,
viewportMargin: Infinity,
indentWithTabs: true,
indentUnit: 4,
mode: "text/css",
theme: "mybb"
});</script>';

	}


	}


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

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

	echo '<script type="text/javascript" src="./jscripts/theme_properties.js"></script>';
echo '<script type="text/javascript">
$(function() {

	echo '<script type="text/javascript" src="./jscripts/theme_properties.js"></script>';
echo '<script type="text/javascript">
$(function() {

Zeile 2879Zeile 2919
		admin_redirect("index.php?module=style-themes");
}


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


	$query = $db->simple_select("themes", "*", "tid='".$mybb->get_input('tid', 1)."'");

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

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

// Does the theme not exist?

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

// Does the theme not exist?

Zeile 2894Zeile 2934
	$cache->update('default_theme', $theme);

$db->update_query("themes", array('def' => 0));

	$cache->update('default_theme', $theme);

$db->update_query("themes", array('def' => 0));

	$db->update_query("themes", array('def' => 1), "tid='".$mybb->get_input('tid', 1)."'");

	$db->update_query("themes", array('def' => 1), "tid='".$mybb->get_input('tid', MyBB::INPUT_INT)."'");


$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 2907Zeile 2947

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


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

	$query = $db->simple_select("themes", "*", "tid='".$mybb->get_input('tid', 1)."'");

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

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

// Does the theme not exist?

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

// Does the theme not exist?

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

// Log admin action

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

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