Vergleich admin/modules/config/smilies.php - 1.6.13 - 1.6.17

  Keine Änderungen   Hinzugefügt   Modifiziert   Entfernt
Zeile 43Zeile 43
		if(!trim($mybb->input['disporder']))
{
$errors[] = $lang->error_missing_order;

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

 
		}
else
{
$mybb->input['disporder'] = intval($mybb->input['disporder']);
$query = $db->simple_select("smilies", "sid", "disporder='".$mybb->input['disporder']."'");
$duplicate_disporder = $db->fetch_field($query, "sid");

if($duplicate_disporder)
{
$errors[] = $lang->error_duplicate_order;
}

		}

if(!$errors)

		}

if(!$errors)

Zeile 58Zeile 69
			$sid = $db->insert_query("smilies", $new_smilie);

$cache->update_smilies();

			$sid = $db->insert_query("smilies", $new_smilie);

$cache->update_smilies();

			

			

			$plugins->run_hooks("admin_config_smilies_add_commit");

// Log admin action

			$plugins->run_hooks("admin_config_smilies_add_commit");

// Log admin action

Zeile 100Zeile 111
	else
{
$mybb->input['image'] = 'images/smilies/';

	else
{
$mybb->input['image'] = 'images/smilies/';

		$mybb->input['showclickable'] = 1;

		$mybb->input['showclickable'] = 1;

	}

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

	}

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

Zeile 147Zeile 158
		}

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

		}

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

		{

		{

			$errors[] = $lang->error_missing_text_replacement;

			$errors[] = $lang->error_missing_text_replacement;

		}


		}


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

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

		}

if(!isset($mybb->input['disporder']))
{

		}

if(!isset($mybb->input['disporder']))
{

			$errors[] = $lang->error_missing_order;

			$errors[] = $lang->error_missing_order;

 
		}
else
{
$mybb->input['disporder'] = intval($mybb->input['disporder']);
$query = $db->simple_select("smilies", "sid", "disporder='".$mybb->input['disporder']."' AND sid != '".$mybb->input['sid']."'");
$duplicate_disporder = $db->fetch_field($query, "sid");

if($duplicate_disporder)
{
$errors[] = $lang->error_duplicate_order;
}

		}

if(!$errors)

		}

if(!$errors)

Zeile 268Zeile 290
	{
$page->output_confirm_action("index.php?module=config-smilies&action=delete&sid={$smilie['sid']}", $lang->confirm_smilie_deletion);
}}

	{
$page->output_confirm_action("index.php?module=config-smilies&action=delete&sid={$smilie['sid']}", $lang->confirm_smilie_deletion);
}}





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

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

Zeile 288Zeile 310
			$dir = @opendir(MYBB_ROOT.$path);

if(!$dir)

			$dir = @opendir(MYBB_ROOT.$path);

if(!$dir)

			{

			{

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

if($path && !is_array($errors))
{
if(substr($path, -1, 1) !== "/")

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

if($path && !is_array($errors))
{
if(substr($path, -1, 1) !== "/")

				{

				{

					$path .= "/";
}


					$path .= "/";
}


Zeile 324Zeile 346
				if(count($smilies) == 0)
{
$errors[] = $lang->error_no_smilies;

				if(count($smilies) == 0)
{
$errors[] = $lang->error_no_smilies;

				}
}

				}
}

			
if(!$errors)
{

			
if(!$errors)
{

Zeile 339Zeile 361
				$sub_tabs['add_smilie'] = array(
'title' => $lang->add_smilie,
'link' => "index.php?module=config-smilies&action=add"

				$sub_tabs['add_smilie'] = array(
'title' => $lang->add_smilie,
'link' => "index.php?module=config-smilies&action=add"

				);

				);

				$sub_tabs['add_multiple_smilies'] = array(
'title' => $lang->add_multiple_smilies,
'link' => "index.php?module=config-smilies&action=add_multiple",

				$sub_tabs['add_multiple_smilies'] = array(
'title' => $lang->add_multiple_smilies,
'link' => "index.php?module=config-smilies&action=add_multiple",

Zeile 381Zeile 403
				}

$form_container->end();

				}

$form_container->end();

				

				

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

$form->output_submit_wrapper($buttons);

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

$form->output_submit_wrapper($buttons);

Zeile 405Zeile 427
				flash_message($lang->error_none_included, 'error');
admin_redirect("index.php?module=config-smilies&action=add_multiple");
}

				flash_message($lang->error_none_included, 'error');
admin_redirect("index.php?module=config-smilies&action=add_multiple");
}

			





$query = $db->simple_select("smilies", "MAX(disporder) as max_disporder");
$disporder = $db->fetch_field($query, "max_disporder");


			foreach($mybb->input['include'] as $image => $insert)
{
if($insert)

			foreach($mybb->input['include'] as $image => $insert)
{
if($insert)

Zeile 414Zeile 439
						"name" => $db->escape_string($name[$image]),
"find" => $db->escape_string($find[$image]),
"image" => $db->escape_string($path.$image),

						"name" => $db->escape_string($name[$image]),
"find" => $db->escape_string($find[$image]),
"image" => $db->escape_string($path.$image),

 
						"disporder" => ++$disporder,

						"showclickable" => 1
);
$db->insert_query("smilies", $new_smilie);

						"showclickable" => 1
);
$db->insert_query("smilies", $new_smilie);

Zeile 482Zeile 508
	{
foreach($mybb->input['name'] as $sid => $name)
{

	{
foreach($mybb->input['name'] as $sid => $name)
{

 
			$disporder = intval($mybb->input['disporder'][$sid]);


			$sid = intval($sid);
if($mybb->input['delete'][$sid] == 1)

			$sid = intval($sid);
if($mybb->input['delete'][$sid] == 1)

			{




			{
// Dirty hack to get the disporder working. Note: this doesn't work in every case
unset($mybb->input['disporder'][$sid]);


				$db->delete_query("smilies", "sid = '{$sid}'", 1);
}
else

				$db->delete_query("smilies", "sid = '{$sid}'", 1);
}
else

Zeile 492Zeile 523
				$smilie = array(
"name" => $db->escape_string($mybb->input['name'][$sid]),
"find" => $db->escape_string($mybb->input['find'][$sid]),

				$smilie = array(
"name" => $db->escape_string($mybb->input['name'][$sid]),
"find" => $db->escape_string($mybb->input['find'][$sid]),

					"disporder" => intval($mybb->input['disporder'][$sid]),

 
					"showclickable" => $db->escape_string($mybb->input['showclickable'][$sid])
);

					"showclickable" => $db->escape_string($mybb->input['showclickable'][$sid])
);

					










// $test contains all disporders except the actual one so we can check whether we have multiple disporders
$test = $mybb->input['disporder'];
unset($test[$sid]);
if(!in_array($disporder, $test))
{
$smilie['disporder'] = $disporder;
}


				$db->update_query("smilies", $smilie, "sid = '{$sid}'");
}
}

				$db->update_query("smilies", $smilie, "sid = '{$sid}'");
}
}