Vergleich admin/modules/config/smilies.php - 1.8.8 - 1.8.38

  Keine Änderungen   Hinzugefügt   Modifiziert   Entfernt
Zeile 81Zeile 81
			$cache->update_smilies();

// Log admin action

			$cache->update_smilies();

// Log admin action

			log_admin_action($sid, htmlspecialchars_uni($mybb->input['name']));

			log_admin_action($sid, $mybb->input['name']);


flash_message($lang->success_smilie_added, 'success');
admin_redirect("index.php?module=config-smilies");


flash_message($lang->success_smilie_added, 'success');
admin_redirect("index.php?module=config-smilies");

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


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


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

	if(!$mybb->get_input('disporder'))

	{
$query = $db->simple_select("smilies", "max(disporder) as dispordermax");
$mybb->input['disporder'] = $db->fetch_field($query, "dispordermax")+1;
}

$form_container = new FormContainer($lang->add_smilie);

	{
$query = $db->simple_select("smilies", "max(disporder) as dispordermax");
$mybb->input['disporder'] = $db->fetch_field($query, "dispordermax")+1;
}

$form_container = new FormContainer($lang->add_smilie);

	$form_container->output_row($lang->name." <em>*</em>", "", $form->generate_text_box('name', $mybb->input['name'], array('id' => 'name')), 'name');
$form_container->output_row($lang->text_replace." <em>*</em>", $lang->text_replace_desc, $form->generate_text_area('find', $mybb->input['find'], array('id' => 'find')), 'find');
$form_container->output_row($lang->image_path." <em>*</em>", $lang->image_path_desc, $form->generate_text_box('image', $mybb->input['image'], array('id' => 'image')), 'image');
$form_container->output_row($lang->display_order." <em>*</em>", $lang->display_order_desc, $form->generate_numeric_field('disporder', $mybb->input['disporder'], array('id' => 'disporder', 'min' => 0)), 'disporder');
$form_container->output_row($lang->show_clickable." <em>*</em>", $lang->show_clickable_desc, $form->generate_yes_no_radio('showclickable', $mybb->input['showclickable']));

	$form_container->output_row($lang->name." <em>*</em>", "", $form->generate_text_box('name', $mybb->get_input('name'), array('id' => 'name')), 'name');
$form_container->output_row($lang->text_replace." <em>*</em>", $lang->text_replace_desc, $form->generate_text_area('find', $mybb->get_input('find'), array('id' => 'find')), 'find');
$form_container->output_row($lang->image_path." <em>*</em>", $lang->image_path_desc, $form->generate_text_box('image', $mybb->get_input('image'), array('id' => 'image')), 'image');
$form_container->output_row($lang->display_order." <em>*</em>", $lang->display_order_desc, $form->generate_numeric_field('disporder', $mybb->get_input('disporder'), array('id' => 'disporder', 'min' => 0)), 'disporder');
$form_container->output_row($lang->show_clickable." <em>*</em>", $lang->show_clickable_desc, $form->generate_yes_no_radio('showclickable', $mybb->get_input('showclickable')));

	$form_container->end();

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

	$form_container->end();

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

Zeile 150Zeile 150
	$smilie = $db->fetch_array($query);

// Does the smilie not exist?

	$smilie = $db->fetch_array($query);

// Does the smilie not exist?

	if(!$smilie['sid'])

	if(!$smilie)

	{
flash_message($lang->error_invalid_smilie, 'error');
admin_redirect("index.php?module=config-smilies");

	{
flash_message($lang->error_invalid_smilie, 'error');
admin_redirect("index.php?module=config-smilies");

Zeile 217Zeile 217
			$cache->update_smilies();

// Log admin action

			$cache->update_smilies();

// Log admin action

			log_admin_action($smilie['sid'], htmlspecialchars_uni($mybb->input['name']));

			log_admin_action($smilie['sid'], $mybb->input['name']);


flash_message($lang->success_smilie_updated, 'success');
admin_redirect("index.php?module=config-smilies");


flash_message($lang->success_smilie_updated, 'success');
admin_redirect("index.php?module=config-smilies");

Zeile 274Zeile 274
	$smilie = $db->fetch_array($query);

// Does the smilie not exist?

	$smilie = $db->fetch_array($query);

// Does the smilie not exist?

	if(!$smilie['sid'])

	if(!$smilie)

	{
flash_message($lang->error_invalid_smilie, 'error');
admin_redirect("index.php?module=config-smilies");
}

// User clicked no

	{
flash_message($lang->error_invalid_smilie, 'error');
admin_redirect("index.php?module=config-smilies");
}

// User clicked no

	if($mybb->input['no'])

	if($mybb->get_input('no'))

	{
admin_redirect("index.php?module=config-smilies");
}

$plugins->run_hooks("admin_config_smilies_delete");

	{
admin_redirect("index.php?module=config-smilies");
}

$plugins->run_hooks("admin_config_smilies_delete");


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


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

		// Delete the smilie
$db->delete_query("smilies", "sid='{$smilie['sid']}'");


		// Delete the smilie
$db->delete_query("smilies", "sid='{$smilie['sid']}'");


Zeile 298Zeile 298
		$cache->update_smilies();

// Log admin action

		$cache->update_smilies();

// Log admin action

		log_admin_action($smilie['sid'], htmlspecialchars_uni($smilie['name']));

		log_admin_action($smilie['sid'], $smilie['name']);


flash_message($lang->success_smilie_updated, 'success');
admin_redirect("index.php?module=config-smilies");


flash_message($lang->success_smilie_updated, 'success');
admin_redirect("index.php?module=config-smilies");

Zeile 319Zeile 319
			$plugins->run_hooks("admin_config_smilies_add_multiple_step1");

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

			$plugins->run_hooks("admin_config_smilies_add_multiple_step1");

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

			{

			{

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


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


Zeile 336Zeile 336
				if(substr($path, -1, 1) !== "/")
{
$path .= "/";

				if(substr($path, -1, 1) !== "/")
{
$path .= "/";

				}

$query = $db->simple_select("smilies");

				}

$query = $db->simple_select("smilies");


$asmilies = array();
while($smilie = $db->fetch_array($query))


$asmilies = array();
while($smilie = $db->fetch_array($query))

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

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

				}

				}

			}

if(!$errors)

			}

if(!$errors)

Zeile 409Zeile 409
					$find = str_replace(".".$ext, "", $file);
$name = ucfirst($find);


					$find = str_replace(".".$ext, "", $file);
$name = ucfirst($find);


					$form_container->output_cell("<img src=\"../".$path.$file."\" alt=\"\" /><br /><small>{$file}</small>", array("class" => "align_center", "width" => 1));
$form_container->output_cell($form->generate_text_box("name[{$file}]", $name, array('id' => 'name', 'style' => 'width: 98%')));



					$file = htmlspecialchars_uni($file);

$form_container->output_cell("<img src=\"../".htmlspecialchars_uni($path).$file."\" alt=\"\" /><br /><small>{$file}</small>", array("class" => "align_center", "width" => 1));
$form_container->output_cell($form->generate_text_box("name[{$file}]", htmlspecialchars_uni($name), array('id' => 'name', 'style' => 'width: 98%')));

					$form_container->output_cell($form->generate_text_box("find[{$file}]", ":".$find.":", array('id' => 'find', 'style' => 'width: 95%')));
$form_container->output_cell($form->generate_check_box("include[{$file}]", 1, "", array('checked' => 1)), array("class" => "align_center"));
$form_container->construct_row();

					$form_container->output_cell($form->generate_text_box("find[{$file}]", ":".$find.":", array('id' => 'find', 'style' => 'width: 95%')));
$form_container->output_cell($form->generate_check_box("include[{$file}]", 1, "", array('checked' => 1)), array("class" => "align_center"));
$form_container->construct_row();

				}

				}


if($form_container->num_rows() == 0)
{


if($form_container->num_rows() == 0)
{

Zeile 443Zeile 445
			$name = $mybb->input['name'];

if(empty($mybb->input['include']))

			$name = $mybb->input['name'];

if(empty($mybb->input['include']))

			{

			{

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

Zeile 461Zeile 463
					unset($find[$image][$key]);
}
$find[$image] = implode("\n", $find[$image]);

					unset($find[$image][$key]);
}
$find[$image] = implode("\n", $find[$image]);





				if($insert)
{
$new_smilie = array(

				if($insert)
{
$new_smilie = array(

Zeile 471Zeile 473
						"disporder" => ++$disporder,
"showclickable" => 1
);

						"disporder" => ++$disporder,
"showclickable" => 1
);





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

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

Zeile 490Zeile 492

$page->add_breadcrumb_item($lang->add_multiple_smilies);
$page->output_header($lang->smilies." - ".$lang->add_multiple_smilies);


$page->add_breadcrumb_item($lang->add_multiple_smilies);
$page->output_header($lang->smilies." - ".$lang->add_multiple_smilies);





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

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

Zeile 519Zeile 521
	}

$form_container = new FormContainer($lang->add_multiple_smilies);

	}

$form_container = new FormContainer($lang->add_multiple_smilies);

	$form_container->output_row($lang->path_to_images, $lang->path_to_images_desc, $form->generate_text_box('pathfolder', $mybb->input['pathfolder'], array('id' => 'pathfolder')), 'pathfolder');
$form_container->end();

	$form_container->output_row($lang->path_to_images, $lang->path_to_images_desc, $form->generate_text_box('pathfolder', $mybb->get_input('pathfolder'), array('id' => 'pathfolder')), 'pathfolder');
$form_container->end();


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



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


Zeile 541Zeile 543
			$disporder = (int)$mybb->input['disporder'][$sid];

$sid = (int)$sid;

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

$sid = (int)$sid;

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

			if(!empty($mybb->input['delete'][$sid]))

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

			{
// 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
{
$mybb->input['find'][$sid] = str_replace("\r\n", "\n", $mybb->input['find'][$sid]);

			else
{
$mybb->input['find'][$sid] = str_replace("\r\n", "\n", $mybb->input['find'][$sid]);

Zeile 556Zeile 558
				foreach(array_merge(array_keys($mybb->input['find'][$sid], ""), array_keys($mybb->input['find'][$sid], " ")) as $key)
{
unset($mybb->input['find'][$sid][$key]);

				foreach(array_merge(array_keys($mybb->input['find'][$sid], ""), array_keys($mybb->input['find'][$sid], " ")) as $key)
{
unset($mybb->input['find'][$sid][$key]);

				}

				}

				$mybb->input['find'][$sid] = implode("\n", $mybb->input['find'][$sid]);				

$smilie = array(

				$mybb->input['find'][$sid] = implode("\n", $mybb->input['find'][$sid]);				

$smilie = array(

Zeile 592Zeile 594

$page->add_breadcrumb_item($lang->mass_edit);
$page->output_header($lang->smilies." - ".$lang->mass_edit);


$page->add_breadcrumb_item($lang->mass_edit);
$page->output_header($lang->smilies." - ".$lang->mass_edit);


$sub_tabs['manage_smilies'] = array(
'title' => $lang->manage_smilies,
'link' => "index.php?module=config-smilies",
);
$sub_tabs['add_smilie'] = array(


$sub_tabs['manage_smilies'] = array(
'title' => $lang->manage_smilies,
'link' => "index.php?module=config-smilies",
);
$sub_tabs['add_smilie'] = array(

		'title' => $lang->add_smilie,
'link' => "index.php?module=config-smilies&amp;action=add",
);

		'title' => $lang->add_smilie,
'link' => "index.php?module=config-smilies&amp;action=add",
);

Zeile 616Zeile 618
	$form = new Form("index.php?module=config-smilies&amp;action=mass_edit", "post", "mass_edit");

if($errors)

	$form = new Form("index.php?module=config-smilies&amp;action=mass_edit", "post", "mass_edit");

if($errors)

	{

	{

		$page->output_inline_error($errors);
}
else

		$page->output_inline_error($errors);
}
else

Zeile 625Zeile 627
		$mybb->input['showclickable'] = 1;
}


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


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

	if(!$mybb->get_input('disporder'))

	{
$query = $db->simple_select("smilies", "max(disporder) as dispordermax");
$mybb->input['disporder'] = $db->fetch_field($query, "dispordermax")+1;

	{
$query = $db->simple_select("smilies", "max(disporder) as dispordermax");
$mybb->input['disporder'] = $db->fetch_field($query, "dispordermax")+1;

Zeile 645Zeile 647
		$smilie['image'] = str_replace("{theme}", "images", $smilie['image']);
if(my_validate_url($smilie['image'], true))
{

		$smilie['image'] = str_replace("{theme}", "images", $smilie['image']);
if(my_validate_url($smilie['image'], true))
{

			$image = $smilie['image'];

			$image = htmlspecialchars_uni($smilie['image']);

		}
else
{

		}
else
{

			$image = "../".$smilie['image'];

			$image = "../".htmlspecialchars_uni($smilie['image']);

		}

$form_container->output_cell("<img src=\"{$image}\" alt=\"\" />", array("class" => "align_center", "width" => 1));

		}

$form_container->output_cell("<img src=\"{$image}\" alt=\"\" />", array("class" => "align_center", "width" => 1));

Zeile 657Zeile 659
		$form_container->output_cell($form->generate_text_area("find[{$smilie['sid']}]", $smilie['find'], array('id' => 'find', 'style' => 'width: 95%')));
$form_container->output_cell($form->generate_numeric_field("disporder[{$smilie['sid']}]", $smilie['disporder'], array('id' => 'disporder', 'style' => 'width: 80%', 'min' => 0)));
$form_container->output_cell($form->generate_yes_no_radio("showclickable[{$smilie['sid']}]", $smilie['showclickable']), array("class" => "align_center"));

		$form_container->output_cell($form->generate_text_area("find[{$smilie['sid']}]", $smilie['find'], array('id' => 'find', 'style' => 'width: 95%')));
$form_container->output_cell($form->generate_numeric_field("disporder[{$smilie['sid']}]", $smilie['disporder'], array('id' => 'disporder', 'style' => 'width: 80%', 'min' => 0)));
$form_container->output_cell($form->generate_yes_no_radio("showclickable[{$smilie['sid']}]", $smilie['showclickable']), array("class" => "align_center"));

		$form_container->output_cell($form->generate_check_box("delete[{$smilie['sid']}]", 1, $mybb->input['delete']), array("class" => "align_center"));
$form_container->construct_row();
}


		$form_container->output_cell($form->generate_check_box("delete[{$smilie['sid']}]", 1, $mybb->get_input('delete')), array("class" => "align_center"));
$form_container->construct_row();
}


	if($form_container->num_rows() == 0)
{
$form_container->output_cell($lang->no_smilies, array('colspan' => 6));
$form_container->construct_row();
}

	if($form_container->num_rows() == 0)
{
$form_container->output_cell($lang->no_smilies, array('colspan' => 6));
$form_container->construct_row();
}





	$form_container->end();

	$form_container->end();





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

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





	$form->output_submit_wrapper($buttons);
$form->end();

	$form->output_submit_wrapper($buttons);
$form->end();





	$page->output_footer();
}

	$page->output_footer();
}





if(!$mybb->input['action'])
{
$plugins->run_hooks("admin_config_smilies_start");

if(!$mybb->input['action'])
{
$plugins->run_hooks("admin_config_smilies_start");

Zeile 703Zeile 705
	);

$page->output_nav_tabs($sub_tabs, 'manage_smilies');

	);

$page->output_nav_tabs($sub_tabs, 'manage_smilies');

 

$query = $db->simple_select("smilies", "COUNT(sid) as smilies");
$total_rows = $db->fetch_field($query, "smilies");


$pagenum = $mybb->get_input('page', MyBB::INPUT_INT);
if($pagenum)
{
$start = ($pagenum-1) * 20;


$pagenum = $mybb->get_input('page', MyBB::INPUT_INT);
if($pagenum)
{
$start = ($pagenum-1) * 20;

 
		$pages = ceil($total_rows / 20);
if($pagenum > $pages)
{
$start = 0;
$pagenum = 1;
}

	}
else
{
$start = 0;
$pagenum = 1;

	}
else
{
$start = 0;
$pagenum = 1;

	}


	}



$table = new Table;
$table->construct_header($lang->image, array("class" => "align_center", "width" => 1));


$table = new Table;
$table->construct_header($lang->image, array("class" => "align_center", "width" => 1));

Zeile 728Zeile 739
		$smilie['image'] = str_replace("{theme}", "images", $smilie['image']);
if(my_validate_url($smilie['image'], true))
{

		$smilie['image'] = str_replace("{theme}", "images", $smilie['image']);
if(my_validate_url($smilie['image'], true))
{

			$image = $smilie['image'];

			$image = htmlspecialchars_uni($smilie['image']);

		}
else
{

		}
else
{

			$image = "../".$smilie['image'];

			$image = "../".htmlspecialchars_uni($smilie['image']);

		}

$table->construct_cell("<img src=\"{$image}\" alt=\"\" class=\"smilie smilie_{$smilie['sid']}\" />", array("class" => "align_center"));

		}

$table->construct_cell("<img src=\"{$image}\" alt=\"\" class=\"smilie smilie_{$smilie['sid']}\" />", array("class" => "align_center"));

Zeile 751Zeile 762
	}

$table->output($lang->manage_smilies);

	}

$table->output($lang->manage_smilies);


$query = $db->simple_select("smilies", "COUNT(sid) as smilies");
$total_rows = $db->fetch_field($query, "smilies");

 

echo "<br />".draw_admin_pagination($pagenum, "20", $total_rows, "index.php?module=config-smilies&amp;page={page}");



echo "<br />".draw_admin_pagination($pagenum, "20", $total_rows, "index.php?module=config-smilies&amp;page={page}");