Vergleich admin/modules/style/templates.php - 1.8.6 - 1.8.25

  Keine Änderungen   Hinzugefügt   Modifiziert   Entfernt
Zeile 102Zeile 102
$query = $db->simple_select("templatesets", "*", "", array('order_by' => 'title', 'order_dir' => 'ASC'));
while($template_set = $db->fetch_array($query))
{

$query = $db->simple_select("templatesets", "*", "", array('order_by' => 'title', 'order_dir' => 'ASC'));
while($template_set = $db->fetch_array($query))
{

	$template_sets[$template_set['sid']] = $template_set['title'];

	$template_sets[$template_set['sid']] = htmlspecialchars_uni($template_set['title']);

}

$plugins->run_hooks("admin_style_templates");

}

$plugins->run_hooks("admin_style_templates");

Zeile 157Zeile 157
	$form = new Form("index.php?module=style-templates&action=add_set", "post", "add_set");

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

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

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

	$form_container->output_row($lang->title, "", $form->generate_text_box('title', $mybb->input['title'], array('id' => 'title')), 'title');

	$form_container->output_row($lang->title, "", $form->generate_text_box('title', htmlspecialchars_uni($mybb->input['title']), array('id' => 'title')), 'title');

	$form_container->end();

$buttons = array();

	$form_container->end();

$buttons = array();

Zeile 238Zeile 238
	else
{
if(!$sid)

	else
{
if(!$sid)

		{
$sid = -1;
}

		{
$sid = -1;
}


$template['template'] = "";
$template['sid'] = $sid;


$template['template'] = "";
$template['sid'] = $sid;

Zeile 254Zeile 254
	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">
<script src="./jscripts/codemirror/lib/codemirror.js"></script>
<script src="./jscripts/codemirror/mode/xml/xml.js"></script>
<script src="./jscripts/codemirror/mode/javascript/javascript.js"></script>
<script src="./jscripts/codemirror/mode/css/css.js"></script>
<script src="./jscripts/codemirror/mode/htmlmixed/htmlmixed.js"></script>
<link href="./jscripts/codemirror/addon/dialog/dialog-mybb.css" rel="stylesheet">
<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>
<script src="./jscripts/codemirror/addon/fold/foldcode.js"></script>
<script src="./jscripts/codemirror/addon/fold/xml-fold.js"></script>
<script src="./jscripts/codemirror/addon/fold/foldgutter.js"></script>
<link href="./jscripts/codemirror/addon/fold/foldgutter.css" rel="stylesheet">

<link href="./jscripts/codemirror/lib/codemirror.css?ver=1813" rel="stylesheet">
<link href="./jscripts/codemirror/theme/mybb.css?ver=1813" rel="stylesheet">
<script src="./jscripts/codemirror/lib/codemirror.js?ver=1813"></script>
<script src="./jscripts/codemirror/mode/xml/xml.js?ver=1813"></script>
<script src="./jscripts/codemirror/mode/javascript/javascript.js?ver=1813"></script>
<script src="./jscripts/codemirror/mode/css/css.js?ver=1813"></script>
<script src="./jscripts/codemirror/mode/htmlmixed/htmlmixed.js?ver=1813"></script>
<link href="./jscripts/codemirror/addon/dialog/dialog-mybb.css?ver=1813" rel="stylesheet">
<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>
<script src="./jscripts/codemirror/addon/fold/foldcode.js?ver=1813"></script>
<script src="./jscripts/codemirror/addon/fold/xml-fold.js?ver=1813"></script>
<script src="./jscripts/codemirror/addon/fold/foldgutter.js?ver=1813"></script>
<link href="./jscripts/codemirror/addon/fold/foldgutter.css?ver=1813" rel="stylesheet">

';
}


';
}


Zeile 341Zeile 341
		if(!$prefix)
{
$errors[] = $lang->error_missing_group_prefix;

		if(!$prefix)
{
$errors[] = $lang->error_missing_group_prefix;

 
		}

if(strpos($prefix, "_") !== false)
{
$errors[] = $lang->error_invalid_group_title;

		}

$title = trim($mybb->input['title']);

		}

$title = trim($mybb->input['title']);

Zeile 391Zeile 396

$page->add_breadcrumb_item($lang->add_template_group);
$page->output_header($lang->add_template_group);


$page->add_breadcrumb_item($lang->add_template_group);
$page->output_header($lang->add_template_group);

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

if($errors)
{

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

if($errors)
{

		$template_group = array(
'prefix' => $prefix,
'title' => $title

		$template_group = array(
'prefix' => $prefix,
'title' => $title

Zeile 405Zeile 410

$form = new Form("index.php?module=style-templates&amp;action=add_template_group{$expand_str}", "post", "add_template_group");
echo $form->generate_hidden_field('sid', $sid);


$form = new Form("index.php?module=style-templates&amp;action=add_template_group{$expand_str}", "post", "add_template_group");
echo $form->generate_hidden_field('sid', $sid);





	$form_container = new FormContainer($lang->add_template_group);
$form_container->output_row($lang->template_group_prefix, $lang->template_group_prefix_desc, $form->generate_text_box('prefix', $template_group['prefix'], array('id' => 'prefix')), 'prefix');
$form_container->output_row($lang->template_group_title, $lang->template_group_title_desc, $form->generate_text_box('title', $template_group['title'], array('id' => 'title')), 'title');

	$form_container = new FormContainer($lang->add_template_group);
$form_container->output_row($lang->template_group_prefix, $lang->template_group_prefix_desc, $form->generate_text_box('prefix', $template_group['prefix'], array('id' => 'prefix')), 'prefix');
$form_container->output_row($lang->template_group_title, $lang->template_group_title_desc, $form->generate_text_box('title', $template_group['title'], array('id' => 'title')), 'title');

Zeile 422Zeile 427
}

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

}

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

{

{

	$query = $db->simple_select("templatesets", "*", "sid='{$sid}'");
$set = $db->fetch_array($query);
if(!$set)

	$query = $db->simple_select("templatesets", "*", "sid='{$sid}'");
$set = $db->fetch_array($query);
if(!$set)

	{

	{

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

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

Zeile 450Zeile 455

// Log admin action
log_admin_action($sid, $set['title']);


// Log admin action
log_admin_action($sid, $set['title']);





			flash_message($lang->success_template_set_saved, 'success');
admin_redirect("index.php?module=style-templates&sid=".$sid.$expand_str2);
}

			flash_message($lang->success_template_set_saved, 'success');
admin_redirect("index.php?module=style-templates&sid=".$sid.$expand_str2);
}

Zeile 459Zeile 464
	if($sid)
{
$page->add_breadcrumb_item($template_sets[$sid], "index.php?module=style-templates&amp;sid={$sid}{$expand_str}");

	if($sid)
{
$page->add_breadcrumb_item($template_sets[$sid], "index.php?module=style-templates&amp;sid={$sid}{$expand_str}");

	}


	}


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

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

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

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

Zeile 477Zeile 482
	if($errors)
{
$page->output_inline_error($errors);

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

	}
else

	}
else

	{
$query = $db->simple_select("templatesets", "title", "sid='{$sid}'");
$mybb->input['title'] = $db->fetch_field($query, "title");

	{
$query = $db->simple_select("templatesets", "title", "sid='{$sid}'");
$mybb->input['title'] = $db->fetch_field($query, "title");

Zeile 588Zeile 593
			flash_message($lang->success_template_saved, 'success');

if($mybb->input['continue'])

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

if($mybb->input['continue'])

			{
if($mybb->input['from'] == "diff_report")
{
admin_redirect("index.php?module=style-templates&action=edit_template&title=".urlencode($mybb->input['title'])."&sid=".$mybb->get_input('sid', MyBB::INPUT_INT).$expand_str2."&amp;from=diff_report");
}
else

			{
if($mybb->input['from'] == "diff_report")





				{

				{

					admin_redirect("index.php?module=style-templates&action=edit_template&title=".urlencode($mybb->input['title'])."&sid=".$mybb->get_input('sid', MyBB::INPUT_INT).$expand_str2);

					admin_redirect("index.php?module=style-templates&action=edit_template&title=".urlencode($mybb->input['title'])."&sid=".$mybb->get_input('sid', MyBB::INPUT_INT).$expand_str2."&amp;from=diff_report");

				}

				}

			}





				else
{
admin_redirect("index.php?module=style-templates&action=edit_template&title=".urlencode($mybb->input['title'])."&sid=".$mybb->get_input('sid', MyBB::INPUT_INT).$expand_str2);
}
}

			else
{
if($mybb->input['from'] == "diff_report")

			else
{
if($mybb->input['from'] == "diff_report")

				{

				{

					admin_redirect("index.php?module=style-templates&amp;action=find_updated");
}
else

					admin_redirect("index.php?module=style-templates&amp;action=find_updated");
}
else

Zeile 615Zeile 620
	if($errors)
{
$template = $mybb->input;

	if($errors)
{
$template = $mybb->input;

	}
else
{

	}
else
{

		$query = $db->simple_select("templates", "*", "title='".$db->escape_string($mybb->input['title'])."' AND (sid='-2' OR sid='{$sid}')", array('order_by' => 'sid', 'order_dir' => 'DESC', 'limit' => 1));
$template = $db->fetch_array($query);
}
$template['title'] = htmlspecialchars_uni($template['title']);

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

		$query = $db->simple_select("templates", "*", "title='".$db->escape_string($mybb->input['title'])."' AND (sid='-2' OR sid='{$sid}')", array('order_by' => 'sid', 'order_dir' => 'DESC', 'limit' => 1));
$template = $db->fetch_array($query);
}
$template['title'] = htmlspecialchars_uni($template['title']);

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

	{

	{

		$page->extra_header .= '

		$page->extra_header .= '

<link href="./jscripts/codemirror/lib/codemirror.css" rel="stylesheet">
<link href="./jscripts/codemirror/theme/mybb.css?ver=1804" rel="stylesheet">
<script src="./jscripts/codemirror/lib/codemirror.js"></script>
<script src="./jscripts/codemirror/mode/xml/xml.js"></script>
<script src="./jscripts/codemirror/mode/javascript/javascript.js"></script>
<script src="./jscripts/codemirror/mode/css/css.js"></script>
<script src="./jscripts/codemirror/mode/htmlmixed/htmlmixed.js"></script>
<link href="./jscripts/codemirror/addon/dialog/dialog-mybb.css" rel="stylesheet">
<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>
<script src="./jscripts/codemirror/addon/fold/foldcode.js"></script>
<script src="./jscripts/codemirror/addon/fold/xml-fold.js"></script>
<script src="./jscripts/codemirror/addon/fold/foldgutter.js"></script>
<link href="./jscripts/codemirror/addon/fold/foldgutter.css" rel="stylesheet">

<link href="./jscripts/codemirror/lib/codemirror.css?ver=1813" rel="stylesheet">
<link href="./jscripts/codemirror/theme/mybb.css?ver=1813" rel="stylesheet">
<script src="./jscripts/codemirror/lib/codemirror.js?ver=1813"></script>
<script src="./jscripts/codemirror/mode/xml/xml.js?ver=1813"></script>
<script src="./jscripts/codemirror/mode/javascript/javascript.js?ver=1813"></script>
<script src="./jscripts/codemirror/mode/css/css.js?ver=1813"></script>
<script src="./jscripts/codemirror/mode/htmlmixed/htmlmixed.js?ver=1813"></script>
<link href="./jscripts/codemirror/addon/dialog/dialog-mybb.css?ver=1813" rel="stylesheet">
<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>
<script src="./jscripts/codemirror/addon/fold/foldcode.js?ver=1813"></script>
<script src="./jscripts/codemirror/addon/fold/xml-fold.js?ver=1813"></script>
<script src="./jscripts/codemirror/addon/fold/foldgutter.js?ver=1813"></script>
<link href="./jscripts/codemirror/addon/fold/foldgutter.css?ver=1813" rel="stylesheet">

';

';

	}


	}


	$page->add_breadcrumb_item($template_sets[$sid], "index.php?module=style-templates&amp;sid={$sid}{$expand_str}");

if(!isset($mybb->input['from']))
{
$mybb->input['from'] = '';

	$page->add_breadcrumb_item($template_sets[$sid], "index.php?module=style-templates&amp;sid={$sid}{$expand_str}");

if(!isset($mybb->input['from']))
{
$mybb->input['from'] = '';

	}


	}


	if($mybb->input['from'] == "diff_report")
{
$page->add_breadcrumb_item($lang->find_updated, "index.php?module=style-templates&amp;action=find_updated");

	if($mybb->input['from'] == "diff_report")
{
$page->add_breadcrumb_item($lang->find_updated, "index.php?module=style-templates&amp;action=find_updated");

Zeile 659Zeile 664
	$page->add_breadcrumb_item($lang->edit_template_breadcrumb.$template['title'], "index.php?module=style-templates&amp;sid={$sid}");

$page->output_header($lang->sprintf($lang->editing_template, $template['title']));

	$page->add_breadcrumb_item($lang->edit_template_breadcrumb.$template['title'], "index.php?module=style-templates&amp;sid={$sid}");

$page->output_header($lang->sprintf($lang->editing_template, $template['title']));







	$sub_tabs = array();

if($mybb->input['from'] == "diff_report")

	$sub_tabs = array();

if($mybb->input['from'] == "diff_report")

	{

	{

		$sub_tabs['find_updated'] = array(
'title' => $lang->find_updated,
'link' => "index.php?module=style-templates&amp;action=find_updated"

		$sub_tabs['find_updated'] = array(
'title' => $lang->find_updated,
'link' => "index.php?module=style-templates&amp;action=find_updated"

		);


		);


		$sub_tabs['diff_report'] = array(
'title' => $lang->diff_report,
'link' => "index.php?module=style-templates&amp;action=diff_report&amp;title=".$db->escape_string($template['title'])."&amp;sid1=".(int)$template['sid']."&amp;sid2=-2",
);

		$sub_tabs['diff_report'] = array(
'title' => $lang->diff_report,
'link' => "index.php?module=style-templates&amp;action=diff_report&amp;title=".$db->escape_string($template['title'])."&amp;sid1=".(int)$template['sid']."&amp;sid2=-2",
);

	}

	}


$sub_tabs['edit_template'] = array(
'title' => $lang->edit_template,
'link' => "index.php?module=style-templates&amp;action=edit_template&amp;title=".htmlspecialchars_uni($template['title']).$expand_str,
'description' => $lang->edit_template_desc


$sub_tabs['edit_template'] = array(
'title' => $lang->edit_template,
'link' => "index.php?module=style-templates&amp;action=edit_template&amp;title=".htmlspecialchars_uni($template['title']).$expand_str,
'description' => $lang->edit_template_desc

	);

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

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


	);

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

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


	$form = new Form("index.php?module=style-templates&amp;action=edit_template{$expand_str}", "post", "edit_template");
echo $form->generate_hidden_field('tid', $template['tid'])."\n";

if($mybb->input['from'] == "diff_report")
{
echo $form->generate_hidden_field('from', "diff_report");

	$form = new Form("index.php?module=style-templates&amp;action=edit_template{$expand_str}", "post", "edit_template");
echo $form->generate_hidden_field('tid', $template['tid'])."\n";

if($mybb->input['from'] == "diff_report")
{
echo $form->generate_hidden_field('from', "diff_report");

	}

	}


$form_container = new FormContainer($lang->edit_template_breadcrumb.$template['title'], 'tfixed');
$form_container->output_row($lang->template_name, $lang->template_name_desc, $form->generate_text_box('title', $template['title'], array('id' => 'title')), 'title');


$form_container = new FormContainer($lang->edit_template_breadcrumb.$template['title'], 'tfixed');
$form_container->output_row($lang->template_name, $lang->template_name_desc, $form->generate_text_box('title', $template['title'], array('id' => 'title')), 'title');





	// Force users to save the default template to a specific set, rather than the "global" templates - where they can delete it
if($template['sid'] == "-2")
{

	// Force users to save the default template to a specific set, rather than the "global" templates - where they can delete it
if($template['sid'] == "-2")
{

Zeile 714Zeile 719
	$buttons[] = $form->generate_submit_button($lang->save_continue, array('name' => 'continue'));
$buttons[] = $form->generate_submit_button($lang->save_close, array('name' => 'close'));


	$buttons[] = $form->generate_submit_button($lang->save_continue, array('name' => 'continue'));
$buttons[] = $form->generate_submit_button($lang->save_close, array('name' => 'close'));


	$form->output_submit_wrapper($buttons);

$form->end();


	$form->output_submit_wrapper($buttons);

$form->end();


	if($admin_options['codepress'] != 0)
{
echo '<script type="text/javascript">

	if($admin_options['codepress'] != 0)
{
echo '<script type="text/javascript">

Zeile 734Zeile 739
			});
</script>';
}

			});
</script>';
}





	$page->output_footer();
}

	$page->output_footer();
}





if($mybb->input['action'] == "edit_template_group")
{
$query = $db->simple_select("templategroups", "*", "gid = '".$mybb->get_input('gid', MyBB::INPUT_INT)."'");

if(!$db->num_rows($query))

if($mybb->input['action'] == "edit_template_group")
{
$query = $db->simple_select("templategroups", "*", "gid = '".$mybb->get_input('gid', MyBB::INPUT_INT)."'");

if(!$db->num_rows($query))

	{

	{

		flash_message($lang->error_missing_template_group, 'error');

		flash_message($lang->error_missing_template_group, 'error');

		admin_redirect("index.php?module=style-templates&amp;sid={$sid}{$expand_str}");
}


		admin_redirect("index.php?module=style-templates&amp;sid={$sid}{$expand_str}");
}


	$template_group = $db->fetch_array($query);
if(isset($template_group['isdefault']) && $template_group['isdefault'] == 1)

	$template_group = $db->fetch_array($query);
if(isset($template_group['isdefault']) && $template_group['isdefault'] == 1)

	{

	{

		flash_message($lang->error_default_template_group, 'error');
admin_redirect("index.php?module=style-templates&amp;sid={$sid}{$expand_str}");
}

		flash_message($lang->error_default_template_group, 'error');
admin_redirect("index.php?module=style-templates&amp;sid={$sid}{$expand_str}");
}





	$plugins->run_hooks("admin_style_templates_edit_template_group");

$errors = array();

	$plugins->run_hooks("admin_style_templates_edit_template_group");

$errors = array();

Zeile 764Zeile 769
		if(!$prefix)
{
$errors[] = $lang->error_missing_group_prefix;

		if(!$prefix)
{
$errors[] = $lang->error_missing_group_prefix;

 
		}

if(strpos($prefix, "_") !== false)
{
$errors[] = $lang->error_invalid_group_title;

		}

$title = trim($mybb->input['title']);
if(!$title)
{
$errors[] = $lang->error_missing_group_title;

		}

$title = trim($mybb->input['title']);
if(!$title)
{
$errors[] = $lang->error_missing_group_title;

		}


		}


		if(!$errors)
{
if($prefix != $template_group['prefix'])

		if(!$errors)
{
if($prefix != $template_group['prefix'])

Zeile 798Zeile 808

$db->update_query('templategroups', $update_array, "gid = '{$template_group['gid']}'");



$db->update_query('templategroups', $update_array, "gid = '{$template_group['gid']}'");


				log_admin_action($template_group['gid'], htmlspecialchars_uni($title));

				log_admin_action($template_group['gid'], $title);

				flash_message($lang->success_template_group_saved, 'success');
admin_redirect("index.php?module=style-templates&amp;sid={$sid}");
}

				flash_message($lang->success_template_group_saved, 'success');
admin_redirect("index.php?module=style-templates&amp;sid={$sid}");
}

Zeile 828Zeile 838
	$form_container->output_row($lang->template_group_prefix, $lang->template_group_prefix_desc, $form->generate_text_box('prefix', $template_group['prefix'], array('id' => 'prefix')), 'prefix');
$form_container->output_row($lang->template_group_title, $lang->template_group_title_desc, $form->generate_text_box('title', $template_group['title'], array('id' => 'title')), 'title');
$form_container->end();

	$form_container->output_row($lang->template_group_prefix, $lang->template_group_prefix_desc, $form->generate_text_box('prefix', $template_group['prefix'], array('id' => 'prefix')), 'prefix');
$form_container->output_row($lang->template_group_title, $lang->template_group_title_desc, $form->generate_text_box('title', $template_group['title'], array('id' => 'title')), 'title');
$form_container->end();





	$buttons = array(
$form->generate_submit_button($lang->save_template_group)
);

	$buttons = array(
$form->generate_submit_button($lang->save_template_group)
);

Zeile 838Zeile 848

$page->output_footer();
}


$page->output_footer();
}





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

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

Zeile 850Zeile 860
			// Search and replace in templates

if(!$mybb->input['find'])

			// Search and replace in templates

if(!$mybb->input['find'])

			{
flash_message($lang->search_noneset, "error");
admin_redirect("index.php?module=style-templates&action=search_replace");
}
else
{

			{
flash_message($lang->search_noneset, "error");
admin_redirect("index.php?module=style-templates&action=search_replace");
}
else
{

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

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

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

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





				$plugins->run_hooks("admin_style_templates_search_replace_find");

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

$templates_list = array();
$table = new Table;

				$plugins->run_hooks("admin_style_templates_search_replace_find");

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

$templates_list = array();
$table = new Table;





				$template_sets = array();

// Get the names of all template sets

				$template_sets = array();

// Get the names of all template sets

Zeile 878Zeile 888
				{
$template_sets[$set['sid']] = $set['title'];
}

				{
$template_sets[$set['sid']] = $set['title'];
}

 

$search_string = str_replace(array("\r\n", "\r"), "\n", $mybb->input['find']);
$search_string = str_replace(array(" ", "\t"), "", $search_string);


// Select all templates with that search term
$query = $db->query("
SELECT t.tid, t.title, t.sid, t.template


// Select all templates with that search term
$query = $db->query("
SELECT t.tid, t.title, t.sid, t.template

					FROM ".TABLE_PREFIX."templates t
LEFT JOIN ".TABLE_PREFIX."templatesets s ON (t.sid=s.sid)

					FROM ".TABLE_PREFIX."templates t
LEFT JOIN ".TABLE_PREFIX."templatesets s ON (t.sid=s.sid)

					LEFT JOIN ".TABLE_PREFIX."templates t2 ON (t.title=t2.title AND t2.sid='1')

					LEFT JOIN ".TABLE_PREFIX."templates t2 ON (t.title=t2.title AND t2.sid='1')

					WHERE t.template LIKE '%".$db->escape_string_like($mybb->input['find'])."%' AND NOT (t.sid = -2 AND (t2.tid) IS NOT NULL)

					WHERE REPLACE(REPLACE(REPLACE(REPLACE(t.template, '\r\n', '\n'), '\r', '\n'), '  ', ''), '\t', '') LIKE '%".$db->escape_string_like($search_string)."%' AND NOT (t.sid = -2 AND (t2.tid) IS NOT NULL)

					ORDER BY t.title ASC
");
if($db->num_rows($query) == 0)
{
$table->construct_cell($lang->sprintf($lang->search_noresults, htmlspecialchars_uni($mybb->input['find'])), array("class" => "align_center"));

					ORDER BY t.title ASC
");
if($db->num_rows($query) == 0)
{
$table->construct_cell($lang->sprintf($lang->search_noresults, htmlspecialchars_uni($mybb->input['find'])), array("class" => "align_center"));





					$table->construct_row();

$table->output($lang->search_results);

					$table->construct_row();

$table->output($lang->search_results);

Zeile 905Zeile 918
					}

$count = 0;

					}

$count = 0;





					foreach($template_list as $sid => $templates)
{
++$count;

$search_header = $lang->sprintf($lang->search_header, htmlspecialchars_uni($mybb->input['find']), $template_sets[$sid]);
$table->construct_header($search_header, array("colspan" => 2));

					foreach($template_list as $sid => $templates)
{
++$count;

$search_header = $lang->sprintf($lang->search_header, htmlspecialchars_uni($mybb->input['find']), $template_sets[$sid]);
$table->construct_header($search_header, array("colspan" => 2));





						foreach($templates as $title => $template)
{
// Do replacement

						foreach($templates as $title => $template)
{
// Do replacement

Zeile 967Zeile 980
							{
// Just show that the term was found
if($template['sid'] == -2)

							{
// Just show that the term was found
if($template['sid'] == -2)

								{
$label = $lang->sprintf($lang->search_found, $template['title']);

								{
$label = $lang->sprintf($lang->search_found, $template['title']);

								}
else
{

								}
else
{

Zeile 1077Zeile 1090
						$template['modified'] = false;
}
$templatessets[$template['sid']][$template['title']] = $template;

						$template['modified'] = false;
}
$templatessets[$template['sid']][$template['title']] = $template;

				}

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

				}

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


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



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


Zeile 1166Zeile 1179
	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">
<script src="./jscripts/codemirror/lib/codemirror.js"></script>
<script src="./jscripts/codemirror/mode/xml/xml.js"></script>
<script src="./jscripts/codemirror/mode/javascript/javascript.js"></script>
<script src="./jscripts/codemirror/mode/css/css.js"></script>
<script src="./jscripts/codemirror/mode/htmlmixed/htmlmixed.js"></script>
<link href="./jscripts/codemirror/addon/dialog/dialog-mybb.css" rel="stylesheet">
<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>
<script src="./jscripts/codemirror/addon/fold/foldcode.js"></script>
<script src="./jscripts/codemirror/addon/fold/xml-fold.js"></script>
<script src="./jscripts/codemirror/addon/fold/foldgutter.js"></script>
<link href="./jscripts/codemirror/addon/fold/foldgutter.css" rel="stylesheet">

<link href="./jscripts/codemirror/lib/codemirror.css?ver=1813" rel="stylesheet">
<link href="./jscripts/codemirror/theme/mybb.css?ver=1813" rel="stylesheet">
<script src="./jscripts/codemirror/lib/codemirror.js?ver=1813"></script>
<script src="./jscripts/codemirror/mode/xml/xml.js?ver=1813"></script>
<script src="./jscripts/codemirror/mode/javascript/javascript.js?ver=1813"></script>
<script src="./jscripts/codemirror/mode/css/css.js?ver=1813"></script>
<script src="./jscripts/codemirror/mode/htmlmixed/htmlmixed.js?ver=1813"></script>
<link href="./jscripts/codemirror/addon/dialog/dialog-mybb.css?ver=1813" rel="stylesheet">
<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>
<script src="./jscripts/codemirror/addon/fold/foldcode.js?ver=1813"></script>
<script src="./jscripts/codemirror/addon/fold/xml-fold.js?ver=1813"></script>
<script src="./jscripts/codemirror/addon/fold/foldgutter.js?ver=1813"></script>
<link href="./jscripts/codemirror/addon/fold/foldgutter.css?ver=1813" rel="stylesheet">

';
}


';
}


Zeile 1311Zeile 1324
		FROM ".TABLE_PREFIX."templates t
LEFT JOIN ".TABLE_PREFIX."templates m ON (m.title=t.title AND m.sid=-2 AND m.version > t.version)
WHERE t.sid > 0 AND m.template != t.template

		FROM ".TABLE_PREFIX."templates t
LEFT JOIN ".TABLE_PREFIX."templates m ON (m.title=t.title AND m.sid=-2 AND m.version > t.version)
WHERE t.sid > 0 AND m.template != t.template

		ORDER BY t.sid ASC, title ASC

		ORDER BY t.sid ASC, t.title ASC

	");
while($template = $db->fetch_array($query))
{

	");
while($template = $db->fetch_array($query))
{

Zeile 1322Zeile 1335
	{
if(!$done_set[$sid])
{

	{
if(!$done_set[$sid])
{

			$table->construct_header($templatesets[$sid]['title'], array("colspan" => 2));

			$table->construct_header(htmlspecialchars_uni($templatesets[$sid]['title']), array("colspan" => 2));


$done_set[$sid] = 1;
++$count;


$done_set[$sid] = 1;
++$count;

Zeile 1387Zeile 1400
		$plugins->run_hooks("admin_style_template_group_delete_commit");

// Log admin action

		$plugins->run_hooks("admin_style_template_group_delete_commit");

// Log admin action

		log_admin_action($template_group['gid'], htmlspecialchars_uni($template_group['title']));

		log_admin_action($template_group['gid'], $template_group['title']);


flash_message($lang->success_template_group_deleted, 'success');
admin_redirect("index.php?module=style-templates&amp;sid={$sid}");


flash_message($lang->success_template_group_deleted, 'success');
admin_redirect("index.php?module=style-templates&amp;sid={$sid}");

Zeile 1764Zeile 1777
		else
{
$group = -1;

		else
{
$group = -1;

		}


		}


		$template['gid'] = -1;
if(isset($template_groups[$exploded[0]]['gid']))
{

		$template['gid'] = -1;
if(isset($template_groups[$exploded[0]]['gid']))
{

Zeile 1776Zeile 1789
		if($template['sid'] != -2)
{
$template['original'] = false;

		if($template['sid'] != -2)
{
$template['original'] = false;

			$template['modified'] = false;

			$template['modified'] = false;

			$template_groups[$group]['templates'][$template['title']] = $template;
}
else if(!in_array($template['gid'], $expand_array) && !isset($expand_array[-1]))

			$template_groups[$group]['templates'][$template['title']] = $template;
}
else if(!in_array($template['gid'], $expand_array) && !isset($expand_array[-1]))

Zeile 1793Zeile 1806
		{
// Master template that hasn't been customised in the set we have expanded
if(!isset($template_groups[$group]['templates'][$template['title']]) || $template_groups[$group]['templates'][$template['title']]['template'] == $template['template'])

		{
// Master template that hasn't been customised in the set we have expanded
if(!isset($template_groups[$group]['templates'][$template['title']]) || $template_groups[$group]['templates'][$template['title']]['template'] == $template['template'])

			{

			{

				$template['original'] = true;
$template_groups[$group]['templates'][$template['title']] = $template;

				$template['original'] = true;
$template_groups[$group]['templates'][$template['title']] = $template;

			}

			}

			// Template has been modified in the set we have expanded (it doesn't match the master)
else if($template_groups[$group]['templates'][$template['title']]['template'] != $template['template'] && $template_groups[$group]['templates'][$template['title']]['sid'] != -2)
{

			// Template has been modified in the set we have expanded (it doesn't match the master)
else if($template_groups[$group]['templates'][$template['title']]['template'] != $template['template'] && $template_groups[$group]['templates'][$template['title']]['sid'] != -2)
{

Zeile 1820Zeile 1833
			$unsetgid = array_search($group['gid'], $tmp_expand);
unset($tmp_expand[$unsetgid]);
$group['expand_str'] = implode("|", $tmp_expand);

			$unsetgid = array_search($group['gid'], $tmp_expand);
unset($tmp_expand[$unsetgid]);
$group['expand_str'] = implode("|", $tmp_expand);

		}
else

		}
else

		{
$expand = $lang->expand;
$expanded = false;

		{
$expand = $lang->expand;
$expanded = false;

Zeile 1856Zeile 1869
			$table->construct_cell("<a href=\"index.php?module=style-templates&amp;sid={$sid}{$group['expand_str']}#group_{$group['gid']}\">{$expand}</a>", array("class" => "align_center"));
$table->construct_row(array("class" => "alt_row", "id" => "group_".$group['gid'], "name" => "group_".$group['gid']));


			$table->construct_cell("<a href=\"index.php?module=style-templates&amp;sid={$sid}{$group['expand_str']}#group_{$group['gid']}\">{$expand}</a>", array("class" => "align_center"));
$table->construct_row(array("class" => "alt_row", "id" => "group_".$group['gid'], "name" => "group_".$group['gid']));


			if(isset($group['templates']) && count($group['templates']) > 0)

			if(isset($group['templates']) && is_array($group['templates']) && count($group['templates']) > 0)

			{
$templates = $group['templates'];
ksort($templates);

			{
$templates = $group['templates'];
ksort($templates);

Zeile 1887Zeile 1900
						$template['pretty_title'] = "<span style=\"color: blue;\">{$template['title']}</span>";
}


						$template['pretty_title'] = "<span style=\"color: blue;\">{$template['title']}</span>";
}


					$table->construct_cell("<span style=\"padding: 20px;\"><a href=\"index.php?module=style-templates&amp;action=edit_template&amp;title=".urlencode($template['title'])."&amp;sid={$sid}{$expand_str}\" >{$template['pretty_title']}</a></span>");

					$table->construct_cell("<span style=\"padding-left: 20px;\"><a href=\"index.php?module=style-templates&amp;action=edit_template&amp;title=".urlencode($template['title'])."&amp;sid={$sid}{$expand_str}\" >{$template['pretty_title']}</a></span>");

					$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 1906Zeile 1919
			$table->construct_cell("{$set_popup}<strong><a href=\"index.php?module=style-templates&amp;sid={$sid}{$group['expand_str']}#group_{$group['gid']}\">{$group['title']}</a></strong>");
$table->construct_cell("<a href=\"index.php?module=style-templates&amp;sid={$sid}{$group['expand_str']}#group_{$group['gid']}\">{$expand}</a>", array("class" => "align_center"));
$table->construct_row(array("class" => "alt_row", "id" => "group_".$group['gid'], "name" => "group_".$group['gid']));

			$table->construct_cell("{$set_popup}<strong><a href=\"index.php?module=style-templates&amp;sid={$sid}{$group['expand_str']}#group_{$group['gid']}\">{$group['title']}</a></strong>");
$table->construct_cell("<a href=\"index.php?module=style-templates&amp;sid={$sid}{$group['expand_str']}#group_{$group['gid']}\">{$expand}</a>", array("class" => "align_center"));
$table->construct_row(array("class" => "alt_row", "id" => "group_".$group['gid'], "name" => "group_".$group['gid']));

		}

		}

	}

$table->output($template_sets[$sid]);

	}

$table->output($template_sets[$sid]);

Zeile 1962Zeile 1975
			{
$used_by_note .= $comma.$theme_name;
$comma = $lang->comma;

			{
$used_by_note .= $comma.$theme_name;
$comma = $lang->comma;

			}

			}

		}
else
{

		}
else
{

Zeile 1990Zeile 2003

$actions = $popup->fetch();
}


$actions = $popup->fetch();
}

 

$set['title'] = htmlspecialchars_uni($set['title']);


$table->construct_cell("<strong><a href=\"index.php?module=style-templates&amp;sid={$set['sid']}\">{$set['title']}</a></strong><br /><small>{$used_by_note}</small>");
$table->construct_cell($actions, array("class" => "align_center"));


$table->construct_cell("<strong><a href=\"index.php?module=style-templates&amp;sid={$set['sid']}\">{$set['title']}</a></strong><br /><small>{$used_by_note}</small>");
$table->construct_cell($actions, array("class" => "align_center"));