Vergleich admin/modules/user/group_promotions.php - 1.8.4 - 1.8.9

  Keine Änderungen   Hinzugefügt   Modifiziert   Entfernt
Zeile 68Zeile 68

$plugins->run_hooks("admin_user_group_promotions_disable_commit");



$plugins->run_hooks("admin_user_group_promotions_disable_commit");


		$db->update_query("promotions", $update_promotion, "pid = '{$mybb->input['pid']}'");

		$db->update_query("promotions", $update_promotion, "pid = '{$promotion['pid']}'");


// Log admin action
log_admin_action($promotion['pid'], $promotion['title']);


// Log admin action
log_admin_action($promotion['pid'], $promotion['title']);

Zeile 108Zeile 108

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


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

		$db->delete_query("promotions", "pid = '{$mybb->input['pid']}'");

		$db->delete_query("promotions", "pid = '{$promotion['pid']}'");


$plugins->run_hooks("admin_user_group_promotions_delete_commit");



$plugins->run_hooks("admin_user_group_promotions_delete_commit");


Zeile 155Zeile 155

$plugins->run_hooks("admin_user_group_promotions_enable_commit");



$plugins->run_hooks("admin_user_group_promotions_enable_commit");


	$db->update_query("promotions", $update_promotion, "pid = '{$mybb->input['pid']}'");

	$db->update_query("promotions", $update_promotion, "pid = '{$promotion['pid']}'");


// Log admin action
log_admin_action($promotion['pid'], $promotion['title']);


// Log admin action
log_admin_action($promotion['pid'], $promotion['title']);

Zeile 224Zeile 224
			else
{
$mybb->input['originalusergroup'] = implode(',', array_map('intval', $mybb->input['originalusergroup']));

			else
{
$mybb->input['originalusergroup'] = implode(',', array_map('intval', $mybb->input['originalusergroup']));

 
			}

$allowed_operators = array('>', '>=', '=', '<=', '<');
$operator_fields = array('posttype', 'threadtype', 'timeregisteredtype', 'reputationtype', 'referralstype', 'warningstype');

foreach($operator_fields as $field)
{
if(!in_array($mybb->get_input($field), $allowed_operators))
{
$mybb->input[$field] = '=';
}

			}

$update_promotion = array(

			}

$update_promotion = array(

Zeile 235Zeile 246
				"threadtype" => $db->escape_string($mybb->input['threadtype']),
"registered" => $mybb->get_input('timeregistered', MyBB::INPUT_INT),
"registeredtype" => $db->escape_string($mybb->input['timeregisteredtype']),

				"threadtype" => $db->escape_string($mybb->input['threadtype']),
"registered" => $mybb->get_input('timeregistered', MyBB::INPUT_INT),
"registeredtype" => $db->escape_string($mybb->input['timeregisteredtype']),

				"online" => $db->escape_string($mybb->input['timeonline']),

				"online" => $mybb->get_input('timeonline', MyBB::INPUT_INT),

				"onlinetype" => $db->escape_string($mybb->input['timeonlinetype']),
"reputations" => $mybb->get_input('reputationcount', MyBB::INPUT_INT),
"reputationtype" => $db->escape_string($mybb->input['reputationtype']),

				"onlinetype" => $db->escape_string($mybb->input['timeonlinetype']),
"reputations" => $mybb->get_input('reputationcount', MyBB::INPUT_INT),
"reputationtype" => $db->escape_string($mybb->input['reputationtype']),

Zeile 253Zeile 264

$plugins->run_hooks("admin_user_group_promotions_edit_commit");



$plugins->run_hooks("admin_user_group_promotions_edit_commit");


			$db->update_query("promotions", $update_promotion, "pid = '".$mybb->get_input('pid', MyBB::INPUT_INT)."'");


			$db->update_query("promotions", $update_promotion, "pid = '{$promotion['pid']}'");


			// Log admin action
log_admin_action($promotion['pid'], $mybb->input['title']);

			// Log admin action
log_admin_action($promotion['pid'], $mybb->input['title']);





			flash_message($lang->success_promo_updated, 'success');
admin_redirect("index.php?module=user-group_promotions");
}

			flash_message($lang->success_promo_updated, 'success');
admin_redirect("index.php?module=user-group_promotions");
}

Zeile 275Zeile 286

$page->output_nav_tabs($sub_tabs, 'edit_promotion');
$form = new Form("index.php?module=user-group_promotions&amp;action=edit", "post", "edit");


$page->output_nav_tabs($sub_tabs, 'edit_promotion');
$form = new Form("index.php?module=user-group_promotions&amp;action=edit", "post", "edit");

	echo $form->generate_hidden_field("pid", $mybb->input['pid']);

	echo $form->generate_hidden_field("pid", $promotion['pid']);

	if($errors)
{
$page->output_inline_error($errors);

	if($errors)
{
$page->output_inline_error($errors);

	}

	}

	else
{
$mybb->input['title'] = $promotion['title'];

	else
{
$mybb->input['title'] = $promotion['title'];

Zeile 304Zeile 315
		$mybb->input['newusergroup'] = $promotion['newusergroup'];
$mybb->input['enabled'] = $promotion['enabled'];
$mybb->input['logging'] = $promotion['logging'];

		$mybb->input['newusergroup'] = $promotion['newusergroup'];
$mybb->input['enabled'] = $promotion['enabled'];
$mybb->input['logging'] = $promotion['logging'];

	}

	}


$form_container = new FormContainer($lang->edit_promotion);
$form_container->output_row($lang->title." <em>*</em>", "", $form->generate_text_box('title', $mybb->input['title'], array('id' => 'title')), 'title');
$form_container->output_row($lang->short_desc." <em>*</em>", "", $form->generate_text_box('description', $mybb->input['description'], array('id' => 'description')), 'description');


$form_container = new FormContainer($lang->edit_promotion);
$form_container->output_row($lang->title." <em>*</em>", "", $form->generate_text_box('title', $mybb->input['title'], array('id' => 'title')), 'title');
$form_container->output_row($lang->short_desc." <em>*</em>", "", $form->generate_text_box('description', $mybb->input['description'], array('id' => 'description')), 'description');





	$options = array(
"postcount" => $lang->post_count,
"threadcount" => $lang->thread_count,

	$options = array(
"postcount" => $lang->post_count,
"threadcount" => $lang->thread_count,

Zeile 318Zeile 329
		"warnings" => $lang->warning_points,
"timeregistered" => $lang->time_registered,
"timeonline" => $lang->time_online

		"warnings" => $lang->warning_points,
"timeregistered" => $lang->time_registered,
"timeonline" => $lang->time_online

	);

	);


$form_container->output_row($lang->promo_requirements." <em>*</em>", $lang->promo_requirements_desc, $form->generate_select_box('requirements[]', $options, $mybb->input['requirements'], array('id' => 'requirements', 'multiple' => true, 'size' => 5)), 'requirements');



$form_container->output_row($lang->promo_requirements." <em>*</em>", $lang->promo_requirements_desc, $form->generate_select_box('requirements[]', $options, $mybb->input['requirements'], array('id' => 'requirements', 'multiple' => true, 'size' => 5)), 'requirements');


Zeile 328Zeile 339
		"=" => $lang->equal_to,
"<=" => $lang->less_than_or_equal_to,
"<" => $lang->less_than

		"=" => $lang->equal_to,
"<=" => $lang->less_than_or_equal_to,
"<" => $lang->less_than

	);


	);


	$form_container->output_row($lang->post_count, $lang->post_count_desc, $form->generate_numeric_field('postcount', $mybb->input['postcount'], array('id' => 'postcount', 'min' => 0))." ".$form->generate_select_box("posttype", $options_type, $mybb->input['posttype'], array('id' => 'posttype')), 'postcount');

$form_container->output_row($lang->thread_count, $lang->thread_count_desc, $form->generate_numeric_field('threadcount', $mybb->input['threadcount'], array('id' => 'threadcount', 'min' => 0))." ".$form->generate_select_box("threadtype", $options_type, $mybb->input['threadtype'], array('id' => 'threadtype')), 'threadcount');

	$form_container->output_row($lang->post_count, $lang->post_count_desc, $form->generate_numeric_field('postcount', $mybb->input['postcount'], array('id' => 'postcount', 'min' => 0))." ".$form->generate_select_box("posttype", $options_type, $mybb->input['posttype'], array('id' => 'posttype')), 'postcount');

$form_container->output_row($lang->thread_count, $lang->thread_count_desc, $form->generate_numeric_field('threadcount', $mybb->input['threadcount'], array('id' => 'threadcount', 'min' => 0))." ".$form->generate_select_box("threadtype", $options_type, $mybb->input['threadtype'], array('id' => 'threadtype')), 'threadcount');

Zeile 404Zeile 415
		if(empty($mybb->input['requirements']))
{
$errors[] = $lang->error_no_requirements;

		if(empty($mybb->input['requirements']))
{
$errors[] = $lang->error_no_requirements;

		}

		}


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


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

Zeile 414Zeile 425
		if(!trim($mybb->input['newusergroup']))
{
$errors[] = $lang->error_no_new_usergroup;

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

		}

		}


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


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

		{

		{

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

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





		if(!$errors)
{
if(in_array('*', $mybb->input['originalusergroup']))
{
$mybb->input['originalusergroup'] = '*';

		if(!$errors)
{
if(in_array('*', $mybb->input['originalusergroup']))
{
$mybb->input['originalusergroup'] = '*';

			}

			}

			else

			else

			{

			{

				$mybb->input['originalusergroup'] = implode(',', array_map('intval', $mybb->input['originalusergroup']));

				$mybb->input['originalusergroup'] = implode(',', array_map('intval', $mybb->input['originalusergroup']));

 
			}

$allowed_operators = array('>', '>=', '=', '<=', '<');
$operator_fields = array('posttype', 'threadtype', 'timeregisteredtype', 'reputationtype', 'referralstype', 'warningstype');

foreach($operator_fields as $field)
{
if(!in_array($mybb->get_input($field), $allowed_operators))
{
$mybb->input[$field] = '=';
}

			}

$new_promotion = array(

			}

$new_promotion = array(