Vergleich admin/modules/user/group_promotions.php - 1.8.0 - 1.8.26

  Keine Änderungen   Hinzugefügt   Modifiziert   Entfernt
Zeile 49Zeile 49
		admin_redirect("index.php?module=user-group_promotions");
}


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


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

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

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

if(!$promotion['pid'])

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

if(!$promotion['pid'])

Zeile 65Zeile 65
		$update_promotion = array(
"enabled" => 0
);

		$update_promotion = array(
"enabled" => 0
);


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

 

$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 = '{$promotion['pid']}'");


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

flash_message($lang->success_promo_disabled, 'success');

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

flash_message($lang->success_promo_disabled, 'success');

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

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

	else
{
$page->output_confirm_action("index.php?module=user-group_promotions&action=disable&pid={$promotion['pid']}", $lang->confirm_promo_disable);

	else
{
$page->output_confirm_action("index.php?module=user-group_promotions&action=disable&pid={$promotion['pid']}", $lang->confirm_promo_disable);

	}
}


	}
}


if($mybb->input['action'] == "delete")
{
if($mybb->input['no'])

if($mybb->input['action'] == "delete")
{
if($mybb->input['no'])

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

if(!trim($mybb->input['pid']))
{
flash_message($lang->error_no_promo_id, 'error');
admin_redirect("index.php?module=user-group_promotions");
}

$query = $db->simple_select("promotions", "*", "pid='".$mybb->get_input('pid', 1)."'");
$promotion = $db->fetch_array($query);

if(!$promotion['pid'])
{
flash_message($lang->error_invalid_promo_id, 'error');
admin_redirect("index.php?module=user-group_promotions");
}

$plugins->run_hooks("admin_user_group_promotions_delete");


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

if(!trim($mybb->input['pid']))
{
flash_message($lang->error_no_promo_id, 'error');
admin_redirect("index.php?module=user-group_promotions");
}

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

if(!$promotion['pid'])
{
flash_message($lang->error_invalid_promo_id, 'error');
admin_redirect("index.php?module=user-group_promotions");
}

$plugins->run_hooks("admin_user_group_promotions_delete");


	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 121Zeile 121
	else
{
$page->output_confirm_action("index.php?module=user-group_promotions&action=delete&pid={$mybb->input['pid']}", $lang->confirm_promo_deletion);

	else
{
$page->output_confirm_action("index.php?module=user-group_promotions&action=delete&pid={$mybb->input['pid']}", $lang->confirm_promo_deletion);

	}

	}

}

}





if($mybb->input['action'] == "enable")
{
if(!verify_post_check($mybb->input['my_post_key']))

if($mybb->input['action'] == "enable")
{
if(!verify_post_check($mybb->input['my_post_key']))

	{

	{

		flash_message($lang->invalid_post_verify_key2, 'error');

		flash_message($lang->invalid_post_verify_key2, 'error');

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

if(!trim($mybb->input['pid']))
{
flash_message($lang->error_no_promo_id, 'error');
admin_redirect("index.php?module=user-group_promotions");
}

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

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

if(!trim($mybb->input['pid']))
{
flash_message($lang->error_no_promo_id, 'error');
admin_redirect("index.php?module=user-group_promotions");
}

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

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

if(!$promotion['pid'])

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

if(!$promotion['pid'])

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

$plugins->run_hooks("admin_user_group_promotions_enable");

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

$plugins->run_hooks("admin_user_group_promotions_enable");


$update_promotion = array(
"enabled" => 1
);



$update_promotion = array(
"enabled" => 1
);


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

$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 = '{$promotion['pid']}'");


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


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

Zeile 169Zeile 169
	if(!trim($mybb->input['pid']))
{
flash_message($lang->error_no_promo_id, 'error');

	if(!trim($mybb->input['pid']))
{
flash_message($lang->error_no_promo_id, 'error');

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

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


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

$query = $db->simple_select("promotions", "*", "pid='".$mybb->get_input('pid', MyBB::INPUT_INT)."'");
$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;
}

if(!trim($mybb->input['newusergroup']))
{
$errors[] = $lang->error_no_new_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['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']))

			{

			{

				$mybb->input['originalusergroup'] = '*';
}
else

				$mybb->input['originalusergroup'] = '*';
}
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', '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(
"title" => $db->escape_string($mybb->input['title']),
"description" => $db->escape_string($mybb->input['description']),

			}

$update_promotion = array(
"title" => $db->escape_string($mybb->input['title']),
"description" => $db->escape_string($mybb->input['description']),

				"posts" => (int)$mybb->input['postcount'],

				"posts" => $mybb->get_input('postcount', MyBB::INPUT_INT),

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

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

				"threads" => (int)$mybb->input['threadcount'],

				"threads" => $mybb->get_input('threadcount', MyBB::INPUT_INT),

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

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

				"registered" => (int)$mybb->input['timeregistered'],

				"registered" => $mybb->get_input('timeregistered', MyBB::INPUT_INT),

				"registeredtype" => $db->escape_string($mybb->input['timeregisteredtype']),

				"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']),

				"onlinetype" => $db->escape_string($mybb->input['timeonlinetype']),

				"reputations" => (int)$mybb->input['reputationcount'],

				"reputations" => $mybb->get_input('reputationcount', MyBB::INPUT_INT),

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

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

				"referrals" => (int)$mybb->input['referrals'],

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

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

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

				"warnings" => (int)$mybb->input['warnings'],

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

				"warningstype" => $db->escape_string($mybb->input['warningstype']),
"requirements" => $db->escape_string(implode(",", $mybb->input['requirements'])),
"originalusergroup" => $db->escape_string($mybb->input['originalusergroup']),

				"warningstype" => $db->escape_string($mybb->input['warningstype']),
"requirements" => $db->escape_string(implode(",", $mybb->input['requirements'])),
"originalusergroup" => $db->escape_string($mybb->input['originalusergroup']),

				"newusergroup" => (int)$mybb->input['newusergroup'],

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

				"usergrouptype" => $db->escape_string($mybb->input['usergroupchangetype']),

				"usergrouptype" => $db->escape_string($mybb->input['usergroupchangetype']),

				"enabled" => (int)$mybb->input['enabled'],
"logging" => (int)$mybb->input['logging']

				"enabled" => $mybb->get_input('enabled', MyBB::INPUT_INT),
"logging" => $mybb->get_input('logging', MyBB::INPUT_INT)

			);

			);


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

 

$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 = '{$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 330Zeile 352
		"<" => $lang->less_than
);


		"<" => $lang->less_than
);


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

	$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_text_box('threadcount', $mybb->input['threadcount'], array('id' => 'threadcount'))." ".$form->generate_select_box("threadtype", $options_type, $mybb->input['threadtype'], array('id' => 'threadtype')), 'threadcount');

	$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_text_box('reputationcount', $mybb->input['reputationcount'], array('id' => 'reputationcount'))." ".$form->generate_select_box("reputationtype", $options_type, $mybb->input['reputationtype'], array('id' => 'reputationtype')), 'reputationcount');

	$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(
"hours" => $lang->hours,


$options = array(
"hours" => $lang->hours,

Zeile 344Zeile 366
		"years" => $lang->years
);


		"years" => $lang->years
);


	$form_container->output_row($lang->referral_count, $lang->referral_count_desc, $form->generate_text_box('referrals', $mybb->input['referrals'], array('id' => 'referrals'))." ".$form->generate_select_box("referralstype", $options_type, $mybb->input['referralstype'], array('id' => 'referralstype')), 'referrals');

	$form_container->output_row($lang->referral_count, $lang->referral_count_desc, $form->generate_numeric_field('referrals', $mybb->input['referrals'], array('id' => 'referrals', 'min' => 0))." ".$form->generate_select_box("referralstype", $options_type, $mybb->input['referralstype'], array('id' => 'referralstype')), 'referrals');





	$form_container->output_row($lang->warning_points, $lang->warning_points_desc, $form->generate_text_box('warnings', $mybb->input['warnings'], array('id' => 'warnings'))." ".$form->generate_select_box("warningstype", $options_type, $mybb->input['warningstype'], array('id' => 'warningstype')), 'warnings');

	$form_container->output_row($lang->warning_points, $lang->warning_points_desc, $form->generate_numeric_field('warnings', $mybb->input['warnings'], array('id' => 'warnings', 'min' => 0))." ".$form->generate_select_box("warningstype", $options_type, $mybb->input['warningstype'], array('id' => 'warningstype')), 'warnings');





	$form_container->output_row($lang->time_registered, $lang->time_registered_desc, $form->generate_text_box('timeregistered', $mybb->input['timeregistered'], array('id' => 'timeregistered'))." ".$form->generate_select_box("timeregisteredtype", $options, $mybb->input['timeregisteredtype'], array('id' => 'timeregisteredtype')), 'timeregistered');

	$form_container->output_row($lang->time_registered, $lang->time_registered_desc, $form->generate_numeric_field('timeregistered', $mybb->input['timeregistered'], array('id' => 'timeregistered', 'min' => 0))." ".$form->generate_select_box("timeregisteredtype", $options, $mybb->input['timeregisteredtype'], array('id' => 'timeregisteredtype')), 'timeregistered');





	$form_container->output_row($lang->time_online, $lang->time_online_desc, $form->generate_text_box('timeonline', $mybb->input['timeonline'], array('id' => 'timeonline'))." ".$form->generate_select_box("timeonlinetype", $options, $mybb->input['timeonlinetype'], array('id' => 'timeonlinetype')), 'timeonline');

	$form_container->output_row($lang->time_online, $lang->time_online_desc, $form->generate_numeric_field('timeonline', $mybb->input['timeonline'], array('id' => 'timeonline', 'min' => 0))." ".$form->generate_select_box("timeonlinetype", $options, $mybb->input['timeonlinetype'], array('id' => 'timeonlinetype')), 'timeonline');


$options = array();

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


$options = array();

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

unset($options['*']); // Remove the all usergroups option

	}

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

unset($options['*']); // Remove the all usergroups option

	$form_container->output_row($lang->new_user_group." <em>*</em>", $lang->new_user_group_desc, $form->generate_select_box('newusergroup', $options, $mybb->input['newusergroup'], array('id' => 'newusergroup')), 'newusergroup');

$options = array(
'primary' => $lang->primary_user_group,
'secondary' => $lang->secondary_user_group

	$form_container->output_row($lang->new_user_group." <em>*</em>", $lang->new_user_group_desc, $form->generate_select_box('newusergroup', $options, $mybb->input['newusergroup'], array('id' => 'newusergroup')), 'newusergroup');

$options = array(
'primary' => $lang->primary_user_group,
'secondary' => $lang->secondary_user_group

	);

$form_container->output_row($lang->user_group_change_type." <em>*</em>", $lang->user_group_change_type_desc, $form->generate_select_box('usergroupchangetype', $options, $mybb->input['usergroupchangetype'], array('id' => 'usergroupchangetype')), 'usergroupchangetype');

	);

$form_container->output_row($lang->user_group_change_type." <em>*</em>", $lang->user_group_change_type_desc, $form->generate_select_box('usergroupchangetype', $options, $mybb->input['usergroupchangetype'], array('id' => 'usergroupchangetype')), 'usergroupchangetype');

Zeile 414Zeile 436
		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']))
{

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(
"title" => $db->escape_string($mybb->input['title']),
"description" => $db->escape_string($mybb->input['description']),

			}

$new_promotion = array(
"title" => $db->escape_string($mybb->input['title']),
"description" => $db->escape_string($mybb->input['description']),

				"posts" => (int)$mybb->input['postcount'],

				"posts" => $mybb->get_input('postcount', MyBB::INPUT_INT),

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

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

				"threads" => (int)$mybb->input['threadcount'],

				"threads" => $mybb->get_input('threadcount', MyBB::INPUT_INT),

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

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

				"registered" => (int)$mybb->input['timeregistered'],

				"registered" => $mybb->get_input('timeregistered', MyBB::INPUT_INT),

				"registeredtype" => $db->escape_string($mybb->input['timeregisteredtype']),

				"registeredtype" => $db->escape_string($mybb->input['timeregisteredtype']),

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

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

				"onlinetype" => $db->escape_string($mybb->input['timeonlinetype']),

				"onlinetype" => $db->escape_string($mybb->input['timeonlinetype']),

				"reputations" => (int)$mybb->input['reputationcount'],

				"reputations" => $mybb->get_input('reputationcount', MyBB::INPUT_INT),

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

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

				"referrals" => (int)$mybb->input['referrals'],

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

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

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

				"warnings" => (int)$mybb->input['warnings'],

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

				"warningstype" => $db->escape_string($mybb->input['warningstype']),
"requirements" => $db->escape_string(implode(",", $mybb->input['requirements'])),
"originalusergroup" => $db->escape_string($mybb->input['originalusergroup']),
"usergrouptype" => $db->escape_string($mybb->input['usergroupchangetype']),

				"warningstype" => $db->escape_string($mybb->input['warningstype']),
"requirements" => $db->escape_string(implode(",", $mybb->input['requirements'])),
"originalusergroup" => $db->escape_string($mybb->input['originalusergroup']),
"usergrouptype" => $db->escape_string($mybb->input['usergroupchangetype']),

				"newusergroup" => (int)$mybb->input['newusergroup'],
"enabled" => (int)$mybb->input['enabled'],
"logging" => (int)$mybb->input['logging']

				"newusergroup" => $mybb->get_input('newusergroup', MyBB::INPUT_INT),
"enabled" => $mybb->get_input('enabled', MyBB::INPUT_INT),
"logging" => $mybb->get_input('logging', MyBB::INPUT_INT)

			);

$pid = $db->insert_query("promotions", $new_promotion);

			);

$pid = $db->insert_query("promotions", $new_promotion);

Zeile 533Zeile 577
		"<" => $lang->less_than
);


		"<" => $lang->less_than
);


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

	$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_text_box('threadcount', $mybb->input['threadcount'], array('id' => 'threadcount'))." ".$form->generate_select_box("threadtype", $options_type, $mybb->input['threadtype'], array('id' => 'threadtype')), 'threadcount');

	$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_text_box('reputationcount', $mybb->input['reputationcount'], array('id' => 'reputationcount'))." ".$form->generate_select_box("reputationtype", $options_type, $mybb->input['reputationtype'], array('id' => 'reputationtype')), 'reputationcount');

	$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(
"hours" => $lang->hours,


$options = array(
"hours" => $lang->hours,

Zeile 547Zeile 591
		"years" => $lang->years
);


		"years" => $lang->years
);


	$form_container->output_row($lang->referral_count, $lang->referral_count_desc, $form->generate_text_box('referrals', $mybb->input['referrals'], array('id' => 'referrals'))." ".$form->generate_select_box("referralstype", $options_type, $mybb->input['referralstype'], array('id' => 'referralstype')), 'referrals');

	$form_container->output_row($lang->referral_count, $lang->referral_count_desc, $form->generate_numeric_field('referrals', $mybb->input['referrals'], array('id' => 'referrals', 'min' => 0))." ".$form->generate_select_box("referralstype", $options_type, $mybb->input['referralstype'], array('id' => 'referralstype')), 'referrals');





	$form_container->output_row($lang->warning_points, $lang->warning_points_desc, $form->generate_text_box('warnings', $mybb->input['warnings'], array('id' => 'warnings'))." ".$form->generate_select_box("warningstype", $options_type, $mybb->input['warningstype'], array('id' => 'warningstype')), 'warnings');

	$form_container->output_row($lang->warning_points, $lang->warning_points_desc, $form->generate_numeric_field('warnings', $mybb->input['warnings'], array('id' => 'warnings', 'min' => 0))." ".$form->generate_select_box("warningstype", $options_type, $mybb->input['warningstype'], array('id' => 'warningstype')), 'warnings');





	$form_container->output_row($lang->time_registered, $lang->time_registered_desc, $form->generate_text_box('timeregistered', $mybb->input['timeregistered'], array('id' => 'timeregistered'))." ".$form->generate_select_box("timeregisteredtype", $options, $mybb->input['timeregisteredtype'], array('id' => 'timeregisteredtype')), 'timeregistered');

	$form_container->output_row($lang->time_registered, $lang->time_registered_desc, $form->generate_numeric_field('timeregistered', $mybb->input['timeregistered'], array('id' => 'timeregistered', 'min' => 0))." ".$form->generate_select_box("timeregisteredtype", $options, $mybb->input['timeregisteredtype'], array('id' => 'timeregisteredtype')), 'timeregistered');





	$form_container->output_row($lang->time_online, $lang->time_online_desc, $form->generate_text_box('timeonline', $mybb->input['timeonline'], array('id' => 'timeonline'))." ".$form->generate_select_box("timeonlinetype", $options, $mybb->input['timeonlinetype'], array('id' => 'timeonlinetype')), 'timeonline');

	$form_container->output_row($lang->time_online, $lang->time_online_desc, $form->generate_numeric_field('timeonline', $mybb->input['timeonline'], array('id' => 'timeonline', 'min' => 0))." ".$form->generate_select_box("timeonlinetype", $options, $mybb->input['timeonlinetype'], array('id' => 'timeonlinetype')), 'timeonline');

	$options = array();

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

	$options = array();

$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 591Zeile 635
{
$plugins->run_hooks("admin_user_group_promotions_logs");


{
$plugins->run_hooks("admin_user_group_promotions_logs");


	if($mybb->get_input('page', 1) > 1)




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

if($mybb->get_input('page', MyBB::INPUT_INT) > 1)

	{

	{

		$mybb->input['page'] = $mybb->get_input('page', 1);

		$mybb->input['page'] = $mybb->get_input('page', MyBB::INPUT_INT);

		$start = ($mybb->input['page']*20)-20;

		$start = ($mybb->input['page']*20)-20;

	}







		$pages = ceil($total_rows / 20);
if($mybb->input['page'] > $pages)
{
$mybb->input['page'] = 1;
$start = 0;
}
}

	else
{
$mybb->input['page'] = 1;
$start = 0;

	else
{
$mybb->input['page'] = 1;
$start = 0;

	}


	}


	$page->add_breadcrumb_item($lang->promotion_logs);
$page->output_header($lang->user_group_promotions." - ".$lang->promotion_logs);


	$page->add_breadcrumb_item($lang->promotion_logs);
$page->output_header($lang->user_group_promotions." - ".$lang->promotion_logs);


Zeile 626Zeile 679
		$log['username'] = "<a href=\"index.php?module=user-view&amp;action=edit&amp;uid={$log['uid']}\">".htmlspecialchars_uni($log['username'])."</a>";

if($log['type'] == "secondary" || (!empty($log['oldusergroup']) && strstr(",", $log['oldusergroup'])))

		$log['username'] = "<a href=\"index.php?module=user-view&amp;action=edit&amp;uid={$log['uid']}\">".htmlspecialchars_uni($log['username'])."</a>";

if($log['type'] == "secondary" || (!empty($log['oldusergroup']) && strstr(",", $log['oldusergroup'])))

		{

		{

			$log['oldusergroup'] = "<i>".$lang->multiple_usergroups."</i>";

			$log['oldusergroup'] = "<i>".$lang->multiple_usergroups."</i>";

			$log['newusergroup'] = htmlspecialchars_uni($groupscache[$log['newusergroup']]['title']);
}

			$log['newusergroup'] = htmlspecialchars_uni($groupscache[$log['newusergroup']]['title']);
}

		else
{
$log['oldusergroup'] = htmlspecialchars_uni($groupscache[$log['oldusergroup']]['title']);
$log['newusergroup'] = htmlspecialchars_uni($groupscache[$log['newusergroup']]['title']);

		else
{
$log['oldusergroup'] = htmlspecialchars_uni($groupscache[$log['oldusergroup']]['title']);
$log['newusergroup'] = htmlspecialchars_uni($groupscache[$log['newusergroup']]['title']);

		}

		}


if($log['type'] == "secondary")
{


if($log['type'] == "secondary")
{

Zeile 645Zeile 698
			$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['newusergroup'], array('style' => 'text-align: center;'));
$table->construct_cell($log['dateline'], 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;'));
$table->construct_cell($log['newusergroup'], array('style' => 'text-align: center;'));
$table->construct_cell($log['dateline'], array('style' => 'text-align: center;'));

		$table->construct_row();
}


		$table->construct_row();
}


	if($table->num_rows() == 0)
{
$table->construct_cell($lang->no_promotion_logs, array("colspan" => "5"));
$table->construct_row();
}

	if($table->num_rows() == 0)
{
$table->construct_cell($lang->no_promotion_logs, array("colspan" => "5"));
$table->construct_row();
}





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

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


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

 

echo "<br />".draw_admin_pagination($mybb->input['page'], "20", $total_rows, "index.php?module=user-group_promotions&amp;action=logs&amp;page={page}");



echo "<br />".draw_admin_pagination($mybb->input['page'], "20", $total_rows, "index.php?module=user-group_promotions&amp;action=logs&amp;page={page}");