Vergleich admin/modules/style/templates.php - 1.8.14 - 1.8.16

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

$form->output_submit_wrapper($buttons);

	$form_container->end();

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

$form->output_submit_wrapper($buttons);





	$form->end();

$page->output_footer();

	$form->end();

$page->output_footer();

Zeile 186Zeile 186
			if($db->fetch_field($query, "count") > 0)
{
$errors[] = $lang->error_already_exists;

			if($db->fetch_field($query, "count") > 0)
{
$errors[] = $lang->error_already_exists;

			}

			}

		}

if(!isset($template_sets[$sid]))
{
$errors[] = $lang->error_invalid_set;

		}

if(!isset($template_sets[$sid]))
{
$errors[] = $lang->error_invalid_set;

		}

		}


// Are we trying to do malicious things in our template?
if(check_template($mybb->input['template']))


// Are we trying to do malicious things in our template?
if(check_template($mybb->input['template']))

		{

		{

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

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





		if(!$errors)
{
$template_array = array(

		if(!$errors)
{
$template_array = array(

Zeile 210Zeile 210
				'status' => '',
'dateline' => TIME_NOW
);

				'status' => '',
'dateline' => TIME_NOW
);





			$tid = $db->insert_query("templates", $template_array);

			$tid = $db->insert_query("templates", $template_array);





			$plugins->run_hooks("admin_style_templates_add_template_commit");

			$plugins->run_hooks("admin_style_templates_add_template_commit");





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


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


Zeile 270Zeile 270
<script src="./jscripts/codemirror/addon/fold/foldgutter.js?ver=1813"></script>
<link href="./jscripts/codemirror/addon/fold/foldgutter.css?ver=1813" rel="stylesheet">
';

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

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

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

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

Zeile 328Zeile 328
if($mybb->input['action'] == "add_template_group")
{
$plugins->run_hooks("admin_style_templates_add_template_group");

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





	if($mybb->get_input('sid', MyBB::INPUT_INT) == -1)
{
admin_redirect("index.php?module=style-templates&amp;sid={$sid}".$expand_str2);

	if($mybb->get_input('sid', MyBB::INPUT_INT) == -1)
{
admin_redirect("index.php?module=style-templates&amp;sid={$sid}".$expand_str2);

Zeile 385Zeile 385
				}

admin_redirect('index.php?module=style-templates');

				}

admin_redirect('index.php?module=style-templates');

			}
}
}

			}
}
}


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


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

Zeile 439Zeile 439
	$plugins->run_hooks("admin_style_templates_edit_set");

$sid = $set['sid'];

	$plugins->run_hooks("admin_style_templates_edit_set");

$sid = $set['sid'];


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


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

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

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

Zeile 498Zeile 498

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


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





	$form->output_submit_wrapper($buttons);

$form->end();

	$form->output_submit_wrapper($buttons);

$form->end();

Zeile 555Zeile 555
				$query = $db->simple_select("templates", "sid", "title='".$db->escape_string($mybb->input['title'])."' AND (sid = '-2' OR sid = '{$sid}' OR sid='{$template['sid']}')", array('order_by' => 'sid', 'order_dir' => 'desc'));
$existing_sid = $db->fetch_field($query, "sid");
$existing_rows = $db->num_rows($query);

				$query = $db->simple_select("templates", "sid", "title='".$db->escape_string($mybb->input['title'])."' AND (sid = '-2' OR sid = '{$sid}' OR sid='{$template['sid']}')", array('order_by' => 'sid', 'order_dir' => 'desc'));
$existing_sid = $db->fetch_field($query, "sid");
$existing_rows = $db->num_rows($query);





				if(($existing_sid == -2 && $existing_rows == 1) || $existing_rows == 0)
{
$template['tid'] = $db->insert_query("templates", $template_array);

				if(($existing_sid == -2 && $existing_rows == 1) || $existing_rows == 0)
{
$template['tid'] = $db->insert_query("templates", $template_array);

Zeile 572Zeile 572
			}

$plugins->run_hooks("admin_style_templates_edit_template_commit");

			}

$plugins->run_hooks("admin_style_templates_edit_template_commit");





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

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





			$exploded = explode("_", $template_array['title'], 2);
$prefix = $exploded[0];


			$exploded = explode("_", $template_array['title'], 2);
$prefix = $exploded[0];


Zeile 583Zeile 583
			$group = $db->fetch_field($query, "gid");

if(!$group)

			$group = $db->fetch_field($query, "gid");

if(!$group)

			{

			{

				$group = "-1";
}


				$group = "-1";
}


Zeile 593Zeile 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")

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

				{
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
{
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")
{
admin_redirect("index.php?module=style-templates&amp;action=find_updated");

			}
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&sid=".$mybb->get_input('sid', MyBB::INPUT_INT).$expand_str2."#group_{$group}");

				else
{
admin_redirect("index.php?module=style-templates&sid=".$mybb->get_input('sid', MyBB::INPUT_INT).$expand_str2."#group_{$group}");

				}
}
}
}

if($errors)

				}
}
}
}

if($errors)

	{
$template = $mybb->input;
}

	{
$template = $mybb->input;
}

Zeile 808Zeile 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 1078Zeile 1078
						if(!$template['customtid'])
{
$template['original'] = true;

						if(!$template['customtid'])
{
$template['original'] = true;

						}
else

						}
else

						{
$template['modified'] = true;
}

						{
$template['modified'] = true;
}

Zeile 1335Zeile 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 1400Zeile 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 1541Zeile 1541
		'title' => $lang->diff_report,
'link' => "index.php?module=style-templates&amp;action=diff_report&amp;title=".$db->escape_string($mybb->input['title'])."&amp;from=".htmlspecialchars_uni($mybb->input['from'])."sid1=".$mybb->get_input('sid1', MyBB::INPUT_INT)."&amp;sid2=".$mybb->get_input('sid2', MyBB::INPUT_INT),
'description' => $lang->diff_report_desc

		'title' => $lang->diff_report,
'link' => "index.php?module=style-templates&amp;action=diff_report&amp;title=".$db->escape_string($mybb->input['title'])."&amp;from=".htmlspecialchars_uni($mybb->input['from'])."sid1=".$mybb->get_input('sid1', MyBB::INPUT_INT)."&amp;sid2=".$mybb->get_input('sid2', MyBB::INPUT_INT),
'description' => $lang->diff_report_desc

	);


	);


	$plugins->run_hooks("admin_style_templates_diff_report");

$query = $db->simple_select("templates", "*", "title='".$db->escape_string($mybb->input['title'])."' AND sid='".$mybb->get_input('sid1', MyBB::INPUT_INT)."'");

	$plugins->run_hooks("admin_style_templates_diff_report");

$query = $db->simple_select("templates", "*", "title='".$db->escape_string($mybb->input['title'])."' AND sid='".$mybb->get_input('sid1', MyBB::INPUT_INT)."'");

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