Vergleich admin/modules/user/group_promotions.php - 1.8.21 - 1.8.38

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

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


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

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

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

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

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

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


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

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

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

$plugins->run_hooks("admin_user_group_promotions_disable");

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

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

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





		$plugins->run_hooks("admin_user_group_promotions_disable_commit");

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

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

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

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

		$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'])
{
admin_redirect("index.php?module=user-group_promotions");

{
if($mybb->get_input('no'))
{
admin_redirect("index.php?module=user-group_promotions");

	}

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

	}

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

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


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


	if(!$promotion['pid'])

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

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($mybb->input['action'] == "enable")
{

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

	if(!verify_post_check($mybb->get_input('my_post_key')))

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


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


	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)
{
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(

	$plugins->run_hooks("admin_user_group_promotions_enable");

$update_promotion = array(

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


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

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

	}

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


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


Zeile 208Zeile 208
		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;

Zeile 234Zeile 234
				if(!in_array($mybb->get_input($field), $allowed_operators))
{
$mybb->input[$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');


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

Zeile 249Zeile 249
			}

$update_promotion = array(

			}

$update_promotion = array(

				"title" => $db->escape_string($mybb->input['title']),
"description" => $db->escape_string($mybb->input['description']),
"posts" => $mybb->get_input('postcount', MyBB::INPUT_INT),
"posttype" => $db->escape_string($mybb->input['posttype']),
"threads" => $mybb->get_input('threadcount', MyBB::INPUT_INT),
"threadtype" => $db->escape_string($mybb->input['threadtype']),
"registered" => $mybb->get_input('timeregistered', MyBB::INPUT_INT),
"registeredtype" => $db->escape_string($mybb->input['timeregisteredtype']),
"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']),

				"title" => $db->escape_string($mybb->input['title']),
"description" => $db->escape_string($mybb->input['description']),
"posts" => $mybb->get_input('postcount', MyBB::INPUT_INT),
"posttype" => $db->escape_string($mybb->input['posttype']),
"threads" => $mybb->get_input('threadcount', MyBB::INPUT_INT),
"threadtype" => $db->escape_string($mybb->input['threadtype']),
"registered" => $mybb->get_input('timeregistered', MyBB::INPUT_INT),
"registeredtype" => $db->escape_string($mybb->input['timeregisteredtype']),
"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']),

				"referrals" => $mybb->get_input('referrals', MyBB::INPUT_INT),
"referralstype" => $db->escape_string($mybb->input['referralstype']),
"warnings" => $mybb->get_input('warnings', MyBB::INPUT_INT),

				"referrals" => $mybb->get_input('referrals', MyBB::INPUT_INT),
"referralstype" => $db->escape_string($mybb->input['referralstype']),
"warnings" => $mybb->get_input('warnings', MyBB::INPUT_INT),

Zeile 329Zeile 329
	}

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

	}

$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->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(

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

$options = array(

Zeile 340Zeile 340
		"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');


$options_type = array(
">" => $lang->greater_than,


$options_type = array(
">" => $lang->greater_than,

Zeile 385Zeile 385
	$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->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->enabled." <em>*</em>", "", $form->generate_yes_no_radio("enabled", $mybb->input['enabled'], true));

$form_container->output_row($lang->enable_logging." <em>*</em>", "", $form->generate_yes_no_radio("logging", $mybb->input['logging'], true));
$form_container->end();


	$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->enabled." <em>*</em>", "", $form->generate_yes_no_radio("enabled", $mybb->input['enabled'], true));

$form_container->output_row($lang->enable_logging." <em>*</em>", "", $form->generate_yes_no_radio("logging", $mybb->input['logging'], true));
$form_container->end();


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

$form->output_submit_wrapper($buttons);

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

$form->output_submit_wrapper($buttons);

Zeile 416Zeile 416
		if(!trim($mybb->input['title']))
{
$errors[] = $lang->error_no_title;

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

		}


		}


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

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

		{

		{

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

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

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

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

		{

		{

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


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


Zeile 442Zeile 442
		{
$errors[] = $lang->error_no_usergroup_change_type;
}

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


Zeile 466Zeile 466
			}

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

			}

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

			$time_fields = array('timeregisteredtype', 'timeonlinetype');


			$time_fields = array('timeregisteredtype', 'timeonlinetype');


			foreach($time_fields as $field)
{
if(!in_array($mybb->get_input($field), $allowed_times))

			foreach($time_fields as $field)
{
if(!in_array($mybb->get_input($field), $allowed_times))

Zeile 502Zeile 502
			);

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

			);

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





			$plugins->run_hooks("admin_user_group_promotions_add_commit");

// Log admin action

			$plugins->run_hooks("admin_user_group_promotions_add_commit");

// Log admin action

Zeile 518Zeile 518
	$sub_tabs['usergroup_promotions'] = array(
'title' => $lang->user_group_promotions,
'link' => "index.php?module=user-group_promotions"

	$sub_tabs['usergroup_promotions'] = array(
'title' => $lang->user_group_promotions,
'link' => "index.php?module=user-group_promotions"

	);


	);


	$sub_tabs['add_promotion'] = array(
'title' => $lang->add_new_promotion,
'link' => "index.php?module=user-group_promotions&amp;action=add",

	$sub_tabs['add_promotion'] = array(
'title' => $lang->add_new_promotion,
'link' => "index.php?module=user-group_promotions&amp;action=add",

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

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

	}

	}

	else
{
$mybb->input['reputationcount'] = '0';

	else
{
$mybb->input['reputationcount'] = '0';

Zeile 554Zeile 554
		$mybb->input['logging'] = '1';
}
$form_container = new FormContainer($lang->add_new_promotion);

		$mybb->input['logging'] = '1';
}
$form_container = new FormContainer($lang->add_new_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->output_row($lang->title." <em>*</em>", "", $form->generate_text_box('title', $mybb->get_input('title'), array('id' => 'title')), 'title');
$form_container->output_row($lang->short_desc." <em>*</em>", "", $form->generate_text_box('description', $mybb->get_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 567Zeile 567
		"timeonline" => $lang->time_online
);


		"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->get_input('requirements', MyBB::INPUT_ARRAY), array('id' => 'requirements', 'multiple' => true, 'size' => 5)), 'requirements');


$options_type = array(
">" => $lang->greater_than,


$options_type = array(
">" => $lang->greater_than,

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


		"<" => $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->post_count, $lang->post_count_desc, $form->generate_numeric_field('postcount', $mybb->get_input('postcount'), array('id' => 'postcount', 'min' => 0))." ".$form->generate_select_box("posttype", $options_type, $mybb->get_input('posttype'), array('id' => 'posttype')), 'postcount');

$form_container->output_row($lang->thread_count, $lang->thread_count_desc, $form->generate_numeric_field('threadcount', $mybb->get_input('threadcount'), array('id' => 'threadcount', 'min' => 0))." ".$form->generate_select_box("threadtype", $options_type, $mybb->get_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_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');

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




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


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

Zeile 589Zeile 589
		"weeks" => $lang->weeks,
"months" => $lang->months,
"years" => $lang->years

		"weeks" => $lang->weeks,
"months" => $lang->months,
"years" => $lang->years

	);

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


	);

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

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

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

$form_container->output_row($lang->time_online, $lang->time_online_desc, $form->generate_numeric_field('timeonline', $mybb->get_input('timeonline'), array('id' => 'timeonline', 'min' => 0))." ".$form->generate_select_box("timeonlinetype", $options, $mybb->get_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[(int)$usergroup['gid']] = htmlspecialchars_uni($usergroup['title']);
}


	$query = $db->simple_select("usergroups", "gid, title", "gid != '1'", array('order_by' => 'title'));
while($usergroup = $db->fetch_array($query))
{
$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->get_input('originalusergroup', MyBB::INPUT_ARRAY), array('id' => 'originalusergroup', 'multiple' => true, 'size' => 5)), 'originalusergroup');


unset($options['*']);


unset($options['*']);

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


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


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


	$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->enabled." <em>*</em>", "", $form->generate_yes_no_radio("enabled", $mybb->input['enabled'], true));

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

$form_container->output_row($lang->enabled." <em>*</em>", "", $form->generate_yes_no_radio("enabled", $mybb->get_input('enabled'), true));





	$form_container->output_row($lang->enable_logging." <em>*</em>", "", $form->generate_yes_no_radio("logging", $mybb->input['logging'], true));

	$form_container->output_row($lang->enable_logging." <em>*</em>", "", $form->generate_yes_no_radio("logging", $mybb->get_input('logging'), true));

	$form_container->end();

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

	$form_container->end();

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