Vergleich admin/modules/user/group_promotions.php - 1.8.5 - 1.8.17

  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 172Zeile 172
		admin_redirect("index.php?module=user-group_promotions");
}


		admin_redirect("index.php?module=user-group_promotions");
}


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

	$query = $db->simple_select("promotions", "*", "pid='".$mybb->get_input('pid', MyBB::INPUT_INT)."'");

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

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





	if(!$promotion)

	if(!$promotion)

	{

	{

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

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

	}

$plugins->run_hooks("admin_user_group_promotions_edit");

if($mybb->request_method == "post")
{
if(!trim($mybb->input['title']))
{
$errors[] = $lang->error_no_title;
}

if(!trim($mybb->input['description']))
{
$errors[] = $lang->error_no_desc;
}

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

if(empty($mybb->input['originalusergroup']))
{
$errors[] = $lang->error_no_orig_usergroup;
}


	}

$plugins->run_hooks("admin_user_group_promotions_edit");

if($mybb->request_method == "post")
{
if(!trim($mybb->input['title']))
{
$errors[] = $lang->error_no_title;
}

if(!trim($mybb->input['description']))
{
$errors[] = $lang->error_no_desc;
}

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

if(empty($mybb->input['originalusergroup']))
{
$errors[] = $lang->error_no_orig_usergroup;
}


		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']))
{
$errors[] = $lang->error_no_usergroup_change_type;
}

		if(!trim($mybb->input['usergroupchangetype']))
{
$errors[] = $lang->error_no_usergroup_change_type;
}





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

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

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', 'reputationtype', 'referralstype', 'warningstype');

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

$allowed_times = array('hours', 'days', 'weeks', 'months', 'years');
$time_fields = array('timeregisteredtype', 'timeonlinetype');

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

			}

$update_promotion = array(

			}

$update_promotion = array(

Zeile 253Zeile 275

$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']);

Zeile 275Zeile 297

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

Zeile 333Zeile 355
	$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');





	$form_container->output_row($lang->reputation_count, $lang->reputation_count_desc, $form->generate_numeric_field('reputationcount', $mybb->input['reputationcount'], array('id' => 'reputationcount', 'min' => 0))." ".$form->generate_select_box("reputationtype", $options_type, $mybb->input['reputationtype'], array('id' => 'reputationtype')), 'reputationcount');

$options = array(

	$form_container->output_row($lang->reputation_count, $lang->reputation_count_desc, $form->generate_numeric_field('reputationcount', $mybb->input['reputationcount'], array('id' => 'reputationcount', 'min' => 0))." ".$form->generate_select_box("reputationtype", $options_type, $mybb->input['reputationtype'], array('id' => 'reputationtype')), 'reputationcount');

$options = array(

Zeile 357Zeile 379
	$query = $db->simple_select("usergroups", "gid, title", "gid != '1'", array('order_by' => 'title'));
while($usergroup = $db->fetch_array($query))
{

	$query = $db->simple_select("usergroups", "gid, title", "gid != '1'", array('order_by' => 'title'));
while($usergroup = $db->fetch_array($query))
{

		$options[(int)$usergroup['gid']] = $usergroup['title'];

		$options[(int)$usergroup['gid']] = htmlspecialchars_uni($usergroup['title']);

	}

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

	}

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

Zeile 430Zeile 452
			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', 'reputationtype', 'referralstype', 'warningstype');

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

$allowed_times = array('hours', 'days', 'weeks', 'months', 'years');
$time_fields = array('timeregisteredtype', 'timeonlinetype');

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

			}

$new_promotion = array(

			}

$new_promotion = array(

Zeile 559Zeile 603
	$query = $db->simple_select("usergroups", "gid, title", "gid != '1'", array('order_by' => 'title'));
while($usergroup = $db->fetch_array($query))
{

	$query = $db->simple_select("usergroups", "gid, title", "gid != '1'", array('order_by' => 'title'));
while($usergroup = $db->fetch_array($query))
{

		$options[(int)$usergroup['gid']] = $usergroup['title'];

		$options[(int)$usergroup['gid']] = htmlspecialchars_uni($usergroup['title']);

	}

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

	}

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

Zeile 645Zeile 689
			$log['type'] = $lang->primary;
}


			$log['type'] = $lang->primary;
}


		$log['dateline'] = date($mybb->settings['dateformat'], $log['dateline']).", ".date($mybb->settings['timeformat'], $log['dateline']);

		$log['dateline'] = my_date('relative', $log['dateline']);

		$table->construct_cell($log['username']);
$table->construct_cell($log['type'], array('style' => 'text-align: center;'));
$table->construct_cell($log['oldusergroup'], array('style' => 'text-align: center;'));

		$table->construct_cell($log['username']);
$table->construct_cell($log['type'], array('style' => 'text-align: center;'));
$table->construct_cell($log['oldusergroup'], array('style' => 'text-align: center;'));