Vergleich admin/modules/config/smilies.php - 1.6.7 - 1.6.18

  Keine Änderungen   Hinzugefügt   Modifiziert   Entfernt
Zeile 6Zeile 6
 * Website: http://mybb.com
* License: http://mybb.com/about/license
*

 * Website: http://mybb.com
* License: http://mybb.com/about/license
*

 * $Id: smilies.php 5676 2011-11-29 12:10:19Z Tomm $

 * $Id$

 */

// Disallow direct access to this file for security reasons

 */

// Disallow direct access to this file for security reasons

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 282Zeile 304
			if(!trim($mybb->input['pathfolder']))
{
$errors[] = $lang->error_missing_path_multiple;

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

			}

			}

			
$path = $mybb->input['pathfolder'];
$dir = @opendir(MYBB_ROOT.$path);

			
$path = $mybb->input['pathfolder'];
$dir = @opendir(MYBB_ROOT.$path);

Zeile 303Zeile 325
				while($smilie = $db->fetch_array($query))
{
$asmilies[$smilie['image']] = 1;

				while($smilie = $db->fetch_array($query))
{
$asmilies[$smilie['image']] = 1;

				}

				}

				
while($file = readdir($dir))
{

				
while($file = readdir($dir))
{

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

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