Vergleich admin/templates.php - 1.2.1 - 1.2.12

  Keine Änderungen   Hinzugefügt   Modifiziert   Entfernt
Zeile 3Zeile 3
 * MyBB 1.2
* Copyright � 2006 MyBB Group, All Rights Reserved
*

 * MyBB 1.2
* Copyright � 2006 MyBB Group, All Rights Reserved
*

 * Website: http://www.mybboard.com
* License: http://www.mybboard.com/eula.html

 * Website: http://www.mybboard.net
* License: http://www.mybboard.net/eula.html

 *

 *

 * $Id: templates.php 2154 2006-08-27 16:52:47Z Tikitiki $

 * $Id: templates.php 3273 2007-08-19 17:36:57Z Tikitiki $

 */

define("IN_MYBB", 1);

 */

define("IN_MYBB", 1);

Zeile 15Zeile 15

// Just a little fix here
$db->query("DELETE FROM ".TABLE_PREFIX."templates WHERE title=''");


// Just a little fix here
$db->query("DELETE FROM ".TABLE_PREFIX."templates WHERE title=''");

 
$db->query("SET SQL_BIG_SELECTS=1");


// Load language packs for this section
global $lang;


// Load language packs for this section
global $lang;

Zeile 224Zeile 225
		$plugins->run_hooks("admin_templates_do_replace");
// Select all templates with that search term
$query = $db->query("SELECT tid, title, template, sid FROM ".TABLE_PREFIX."templates WHERE template LIKE '%".$db->escape_string($mybb->input['find'])."%' ORDER BY sid,title ASC");

		$plugins->run_hooks("admin_templates_do_replace");
// Select all templates with that search term
$query = $db->query("SELECT tid, title, template, sid FROM ".TABLE_PREFIX."templates WHERE template LIKE '%".$db->escape_string($mybb->input['find'])."%' ORDER BY sid,title ASC");

		while($template = $db->fetch_array($query))
{
if($template['sid'] == 1)
{
$template_list[-2][$template['title']] = $template;
}
else
{
$template_list[$template['sid']][$template['title']] = $template;
}

		if($db->num_rows($query) == 0)
{
makelabelcode(sprintf($lang->search_noresults, htmlspecialchars_uni($mybb->input['find'])));








		}

		}


// Loop templates we found
foreach($template_list as $sid => $templates)

		else



		{

		{

			// Show group header
$search_header = sprintf($lang->search_header, $mybb->input['find'], $template_groups[$sid]);
tablesubheader($search_header);

foreach($templates as $title => $template)

			while($template = $db->fetch_array($query))





			{

			{

				// Do replacement
$newtemplate = str_replace($mybb->input['find'], $mybb->input['replace'], $template['template']);
if($newtemplate != $template['template'])

				if($template['sid'] == 1)



				{

				{

					// If the template is different, that means the search term has been found. 
if($mybb->input['replace'] != "")



















					$template_list[-2][$template['title']] = $template;
}
else
{
$template_list[$template['sid']][$template['title']] = $template;
}
}

// Loop templates we found
foreach($template_list as $sid => $templates)
{
// Show group header
$search_header = sprintf($lang->search_header, htmlspecialchars_uni($mybb->input['find']), $template_groups[$sid]);
tablesubheader($search_header);

foreach($templates as $title => $template)
{
// Do replacement
$newtemplate = str_replace($mybb->input['find'], $mybb->input['replace'], $template['template']);
if($newtemplate != $template['template'])

					{

					{

						if($template['sid'] == -2)
{
// The template is a master template. We have to make a new custom template.
$new_template = array(
"title" => $db->escape_string($title),
"template" => $db->escape_string($newtemplate),
"sid" => 1,
"version" => $mybb->version_code,
"status" => '',
"dateline" => time()
);
$db->insert_query(TABLE_PREFIX."templates", $new_template);
$new_tid = $db->insert_id();
$label = sprintf($lang->search_created_custom, $template['title']);
makelabelcode($label, makelinkcode($lang->search_edit, "templates.php?".SID."&action=edit&tid=".$new_tid));
}
else

						// If the template is different, that means the search term has been found. 
if($mybb->input['replace'] != "")
















						{

						{

							// The template is a custom template.  Replace as normal.
// Update the template if there is a replacement term
$updatedtemplate = array(
"template" => $db->escape_string($newtemplate)







							if($template['sid'] == -2)
{
// The template is a master template. We have to make a new custom template.
$new_template = array(
"title" => $db->escape_string($title),
"template" => $db->escape_string($newtemplate),
"sid" => 1,
"version" => $mybb->version_code,
"status" => '',
"dateline" => time()

								);

								);

							$db->update_query(TABLE_PREFIX."templates", $updatedtemplate, "tid='".$template['tid']."'");
$label = sprintf($lang->search_updated, $template['title']);
makelabelcode($label, makelinkcode($lang->search_edit, "templates.php?".SID."&action=edit&tid=".$template['tid']));
}
}
else
{
// Just show that the term was found
if($template['sid'] == -2)
{
$label = sprintf($lang->search_found, $template['title']);
makelabelcode($label, makelinkcode($lang->search_change_original, "templates.php?".SID."&action=add&title=".$template['title']."&sid=1"));





								$db->insert_query(TABLE_PREFIX."templates", $new_template);
$new_tid = $db->insert_id();
$label = sprintf($lang->search_created_custom, $template['title']);
makelabelcode($label, makelinkcode($lang->search_edit, "templates.php?".SID."&action=edit&tid=".$new_tid));
}
else
{
// The template is a custom template. Replace as normal.
// Update the template if there is a replacement term
$updatedtemplate = array(
"template" => $db->escape_string($newtemplate)
);
$db->update_query(TABLE_PREFIX."templates", $updatedtemplate, "tid='".$template['tid']."'");
$label = sprintf($lang->search_updated, $template['title']);
makelabelcode($label, makelinkcode($lang->search_edit, "templates.php?".SID."&action=edit&tid=".$template['tid']));
}

						}
else
{

						}
else
{

							$label = sprintf($lang->search_found, $template['title']);
makelabelcode($label, makelinkcode($lang->search_edit, "templates.php?".SID."&action=edit&tid=".$template['tid']));










							// Just show that the term was found
if($template['sid'] == -2)
{
$label = sprintf($lang->search_found, $template['title']);
makelabelcode($label, makelinkcode($lang->search_change_original, "templates.php?".SID."&action=add&title=".$template['title']."&sid=1"));
}
else
{
$label = sprintf($lang->search_found, $template['title']);
makelabelcode($label, makelinkcode($lang->search_edit, "templates.php?".SID."&action=edit&tid=".$template['tid']));
}

						}
}

						}
}

				}
}
}
endtable();

				}
}
}
endtable();

		cpfooter();
}
}

		cpfooter();
}
}

Zeile 348Zeile 356
		}
endtable();
cpfooter();

		}
endtable();
cpfooter();

	}

	}

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

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

Zeile 400Zeile 408
	else 
{
makehiddencode("setid", $template['sid']);

	else 
{
makehiddencode("setid", $template['sid']);

	}

	}

	if($mybb->input['continue'])
{
$continue = "yes";

	if($mybb->input['continue'])
{
$continue = "yes";

Zeile 475Zeile 483
	makehiddencode("setid", $mybb->input['setid']);
starttable();
tableheader($lang->delete_template_set, "", 1);

	makehiddencode("setid", $mybb->input['setid']);
starttable();
tableheader($lang->delete_template_set, "", 1);

	$yes = makebuttoncode("deletesubmit", "Yes");
$no = makebuttoncode("no", "No");

	$yes = makebuttoncode("deletesubmit", $lang->yes);
$no = makebuttoncode("no", $lang->no);

	makelabelcode("<div align=\"center\">$lang->delete_set_notice {$templateset['title']}?<br /><br />$yes$no</div>", "");
endtable();
endform();

	makelabelcode("<div align=\"center\">$lang->delete_set_notice {$templateset['title']}?<br /><br />$yes$no</div>", "");
endtable();
endform();