Vergleich admin/modules/config/questions.php - 1.8.21 - 1.8.30

  Keine Änderungen   Hinzugefügt   Modifiziert   Entfernt
Zeile 110Zeile 110
	}

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

	}

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

	$form_container->output_row($lang->question." <em>*</em>", $lang->question_desc, $form->generate_text_area('question', $mybb->input['question'], array('id' => 'question')), 'question');
$form_container->output_row($lang->answers." <em>*</em>", $lang->answers_desc, $form->generate_text_area('answer', $mybb->input['answer'], array('id' => 'answer')), 'answer');

	$form_container->output_row($lang->question." <em>*</em>", $lang->question_desc, $form->generate_text_area('question', $mybb->get_input('question'), array('id' => 'question')), 'question');
$form_container->output_row($lang->answers." <em>*</em>", $lang->answers_desc, $form->generate_text_area('answer', $mybb->get_input('answer'), array('id' => 'answer')), 'answer');

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


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


Zeile 123Zeile 123

$page->output_footer();
}


$page->output_footer();
}





if($mybb->input['action'] == "edit")
{
$query = $db->simple_select("questions", "*", "qid='".$mybb->get_input('qid', MyBB::INPUT_INT)."'");
$question = $db->fetch_array($query);

if(!$question['qid'])

if($mybb->input['action'] == "edit")
{
$query = $db->simple_select("questions", "*", "qid='".$mybb->get_input('qid', MyBB::INPUT_INT)."'");
$question = $db->fetch_array($query);

if(!$question['qid'])

	{

	{

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

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





	$plugins->run_hooks("admin_config_questions_edit");

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

	$plugins->run_hooks("admin_config_questions_edit");

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

Zeile 142Zeile 142
		if(!trim($mybb->input['question']))
{
$errors[] = $lang->error_missing_question;

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

		}

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

		}

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


if(!$errors)
{


if(!$errors)
{

Zeile 184Zeile 184
	);

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

	);

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

	

	

	$form = new Form("index.php?module=config-questions&amp;action=edit&amp;qid={$question['qid']}", "post", "add");

$show_preview = false;

	$form = new Form("index.php?module=config-questions&amp;action=edit&amp;qid={$question['qid']}", "post", "add");

$show_preview = false;

Zeile 246Zeile 246


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



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

{
if($mybb->input['no'])
{
admin_redirect("index.php?module=config-questions");
}

$query = $db->simple_select("questions", "*", "qid='".$mybb->get_input('qid', MyBB::INPUT_INT)."'");
$question = $db->fetch_array($query);

if(!$question['qid'])
{
flash_message($lang->error_invalid_question, 'error');
admin_redirect("index.php?module=config-questions");
}


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

$query = $db->simple_select("questions", "*", "qid='".$mybb->get_input('qid', MyBB::INPUT_INT)."'");
$question = $db->fetch_array($query);

if(!$question['qid'])
{
flash_message($lang->error_invalid_question, 'error');
admin_redirect("index.php?module=config-questions");
}


	$plugins->run_hooks("admin_config_questions_delete");

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

	$plugins->run_hooks("admin_config_questions_delete");

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

Zeile 274Zeile 274
		log_admin_action($question['qid'], $question['question']);

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

		log_admin_action($question['qid'], $question['question']);

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

		admin_redirect("index.php?module=config-questions");

		admin_redirect("index.php?module=config-questions");

	}
else
{
$page->output_confirm_action("index.php?module=config-questions&amp;action=delete&amp;qid={$question['qid']}", $lang->confirm_question_deletion);

	}
else
{
$page->output_confirm_action("index.php?module=config-questions&amp;action=delete&amp;qid={$question['qid']}", $lang->confirm_question_deletion);

	}

	}

}

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

}

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

Zeile 297Zeile 297

$update_question = array(
"active" => 0


$update_question = array(
"active" => 0

	);

	);


$plugins->run_hooks("admin_config_questions_disable_commit");



$plugins->run_hooks("admin_config_questions_disable_commit");


Zeile 355Zeile 355
	);

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

	);

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

 

$query = $db->simple_select("questions", "COUNT(qid) AS questions");
$total_rows = $db->fetch_field($query, "questions");

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


$table = new Table;
$table->construct_header($lang->question);


$table = new Table;
$table->construct_header($lang->question);

Zeile 364Zeile 384
	$table->construct_header($lang->incorrect, array("width" => "5%", "class" => "align_center"));
$table->construct_header($lang->controls, array("class" => "align_center", "width" => 150));


	$table->construct_header($lang->incorrect, array("width" => "5%", "class" => "align_center"));
$table->construct_header($lang->controls, array("class" => "align_center", "width" => 150));


	$query = $db->simple_select("questions", "*", "", array('order_by' => 'question'));

	$query = $db->simple_select("questions", "*", "", array('limit_start' => $start, 'limit' => 20, 'order_by' => 'question'));

	while($questions = $db->fetch_array($query))
{
$questions['question'] = htmlspecialchars_uni($questions['question']);

	while($questions = $db->fetch_array($query))
{
$questions['question'] = htmlspecialchars_uni($questions['question']);

Zeile 373Zeile 393
		$questions['shown'] = my_number_format($questions['shown']);
$questions['correct'] = my_number_format($questions['correct']);
$questions['incorrect'] = my_number_format($questions['incorrect']);

		$questions['shown'] = my_number_format($questions['shown']);
$questions['correct'] = my_number_format($questions['correct']);
$questions['incorrect'] = my_number_format($questions['incorrect']);





		if($questions['active'] == 1)
{
$icon = "<img src=\"styles/{$page->style}/images/icons/bullet_on.png\" alt=\"({$lang->alt_enabled})\" title=\"{$lang->alt_enabled}\" style=\"vertical-align: middle;\" /> ";

		if($questions['active'] == 1)
{
$icon = "<img src=\"styles/{$page->style}/images/icons/bullet_on.png\" alt=\"({$lang->alt_enabled})\" title=\"{$lang->alt_enabled}\" style=\"vertical-align: middle;\" /> ";

		}
else

		}
else

		{
$icon = "<img src=\"styles/{$page->style}/images/icons/bullet_off.png\" alt=\"({$lang->alt_disabled})\" title=\"{$lang->alt_disabled}\" style=\"vertical-align: middle;\" /> ";
}

		{
$icon = "<img src=\"styles/{$page->style}/images/icons/bullet_off.png\" alt=\"({$lang->alt_disabled})\" title=\"{$lang->alt_disabled}\" style=\"vertical-align: middle;\" /> ";
}

Zeile 392Zeile 412
		$popup->add_item($lang->edit_question, "index.php?module=config-questions&amp;action=edit&amp;qid={$questions['qid']}");
$popup->add_item($lang->preview_question, "index.php?module=config-questions&amp;action=edit&amp;qid={$questions['qid']}&amp;preview_list");
if($questions['active'] == 1)

		$popup->add_item($lang->edit_question, "index.php?module=config-questions&amp;action=edit&amp;qid={$questions['qid']}");
$popup->add_item($lang->preview_question, "index.php?module=config-questions&amp;action=edit&amp;qid={$questions['qid']}&amp;preview_list");
if($questions['active'] == 1)

		{

		{

			$popup->add_item($lang->disable_question, "index.php?module=config-questions&amp;action=disable&amp;qid={$questions['qid']}&amp;my_post_key={$mybb->post_code}");
}
else

			$popup->add_item($lang->disable_question, "index.php?module=config-questions&amp;action=disable&amp;qid={$questions['qid']}&amp;my_post_key={$mybb->post_code}");
}
else

Zeile 401Zeile 421
		}
$popup->add_item($lang->delete_question, "index.php?module=config-questions&amp;action=delete&amp;qid={$questions['qid']}&amp;my_post_key={$mybb->post_code}", "return AdminCP.deleteConfirmation(this, '{$lang->confirm_question_deletion}')");
$table->construct_cell($popup->fetch(), array("class" => "align_center"));

		}
$popup->add_item($lang->delete_question, "index.php?module=config-questions&amp;action=delete&amp;qid={$questions['qid']}&amp;my_post_key={$mybb->post_code}", "return AdminCP.deleteConfirmation(this, '{$lang->confirm_question_deletion}')");
$table->construct_cell($popup->fetch(), array("class" => "align_center"));

		$table->construct_row();

		$table->construct_row();

	}

if($table->num_rows() == 0)

	}

if($table->num_rows() == 0)

Zeile 411Zeile 431
	}

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

	}

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

 

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


$page->output_footer();
}


$page->output_footer();
}