Zeile 6 | Zeile 6 |
---|
* Website: http://mybb.com * License: http://mybb.com/about/license *
|
* Website: http://mybb.com * License: http://mybb.com/about/license *
|
* $Id: smilies.php 5380 2011-02-21 12:04:43Z Tomm $
| * $Id$
|
*/
// Disallow direct access to this file for security reasons
| */
// Disallow direct access to this file for security reasons
|
Zeile 43 | Zeile 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 58 | Zeile 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 100 | Zeile 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 147 | Zeile 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 268 | Zeile 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 282 | Zeile 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 303 | Zeile 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 324 | Zeile 346 |
---|
if(count($smilies) == 0) { $errors[] = $lang->error_no_smilies;
|
if(count($smilies) == 0) { $errors[] = $lang->error_no_smilies;
|
}
| }
|
} if(!$errors)
| } if(!$errors)
|
Zeile 405 | Zeile 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 414 | Zeile 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 482 | Zeile 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 491 | Zeile 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}'"); } }
|
Zeile 656 | Zeile 695 |
---|
} $table->construct_cell("<img src=\"{$image}\" alt=\"\" />", array("class" => "align_center"));
|
} $table->construct_cell("<img src=\"{$image}\" alt=\"\" />", array("class" => "align_center"));
|
$table->construct_cell("{$smilie['name']}"); $table->construct_cell($smilie['find']);
| $table->construct_cell(htmlspecialchars_uni($smilie['name'])); $table->construct_cell(htmlspecialchars_uni($smilie['find']));
|
$table->construct_cell("<a href=\"index.php?module=config-smilies&action=edit&sid={$smilie['sid']}\">{$lang->edit}</a>", array("class" => "align_center")); $table->construct_cell("<a href=\"index.php?module=config-smilies&action=delete&sid={$smilie['sid']}&my_post_key={$mybb->post_code}\" onclick=\"return AdminCP.deleteConfirmation(this, '{$lang->confirm_smilie_deletion}')\">{$lang->delete}</a>", array("class" => "align_center"));
| $table->construct_cell("<a href=\"index.php?module=config-smilies&action=edit&sid={$smilie['sid']}\">{$lang->edit}</a>", array("class" => "align_center")); $table->construct_cell("<a href=\"index.php?module=config-smilies&action=delete&sid={$smilie['sid']}&my_post_key={$mybb->post_code}\" onclick=\"return AdminCP.deleteConfirmation(this, '{$lang->confirm_smilie_deletion}')\">{$lang->delete}</a>", array("class" => "align_center"));
|
Zeile 666 | Zeile 705 |
---|
if($table->num_rows() == 0) {
|
if($table->num_rows() == 0) {
|
$table->construct_cell($lang->no_smilies, array('colspan' => 4));
| $table->construct_cell($lang->no_smilies, array('colspan' => 5));
|
$table->construct_row(); }
| $table->construct_row(); }
|