Vergleich admin/modules/config/questions.php - 1.8.0 - 1.8.12

  Keine Änderungen   Hinzugefügt   Modifiziert   Entfernt
Zeile 41Zeile 41
			$new_question = array(
"question" => $db->escape_string($mybb->input['question']),
"answer" => $db->escape_string($answer),

			$new_question = array(
"question" => $db->escape_string($mybb->input['question']),
"answer" => $db->escape_string($answer),

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

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

			);
$qid = $db->insert_query("questions", $new_question);


			);
$qid = $db->insert_query("questions", $new_question);


Zeile 98Zeile 98

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


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

	$query = $db->simple_select("questions", "*", "qid='".(int)$mybb->input['qid']."'");

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

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

if(!$question['qid'])

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

if(!$question['qid'])

Zeile 128Zeile 128
			$updated_question = array(
"question" => $db->escape_string($mybb->input['question']),
"answer" => $db->escape_string($answer),

			$updated_question = array(
"question" => $db->escape_string($mybb->input['question']),
"answer" => $db->escape_string($answer),

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

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

			);

			);

			$db->update_query("questions", $updated_question, "qid='{$question['qid']}'");





			$plugins->run_hooks("admin_config_questions_edit_commit");

			$plugins->run_hooks("admin_config_questions_edit_commit");

 

$db->update_query("questions", $updated_question, "qid='{$question['qid']}'");


// Log admin action
log_admin_action($question['qid'], $mybb->input['question']);


// Log admin action
log_admin_action($question['qid'], $mybb->input['question']);

Zeile 176Zeile 177
	$form->end();

$page->output_footer();

	$form->end();

$page->output_footer();

}


}


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

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

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

$query = $db->simple_select("questions", "*", "qid='".(int)$mybb->input['qid']."'");
$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");

	{
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")
{
$db->delete_query("questions", "qid='{$question['qid']}'");
$db->delete_query("questionsessions", "qid='{$question['qid']}'");



if($mybb->request_method == "post")
{
$db->delete_query("questions", "qid='{$question['qid']}'");
$db->delete_query("questionsessions", "qid='{$question['qid']}'");


		$plugins->run_hooks("admin_config_questions_delete_commit");


		$plugins->run_hooks("admin_config_questions_delete_commit");


		// Log admin action
log_admin_action($question['qid'], $question['question']);


		// Log admin action
log_admin_action($question['qid'], $question['question']);


Zeile 210Zeile 211
		admin_redirect("index.php?module=config-questions");
}
else

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

	{

	{

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

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

	}

	}

}

}





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

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

{
$query = $db->simple_select("questions", "*", "qid='".(int)$mybb->input['qid']."'");
$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_disable");


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


	$update_question = array(
"active" => 0
);

	$update_question = array(
"active" => 0
);

	$db->update_query("questions", $update_question, "qid = '{$question['qid']}'");





	$plugins->run_hooks("admin_config_questions_disable_commit");

	$plugins->run_hooks("admin_config_questions_disable_commit");

 

$db->update_query("questions", $update_question, "qid = '{$question['qid']}'");


// Log admin action
log_admin_action($question['qid'], $question['question']);


// Log admin action
log_admin_action($question['qid'], $question['question']);

Zeile 244Zeile 246

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


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

	$query = $db->simple_select("questions", "*", "qid='".(int)$mybb->input['qid']."'");

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

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

if(!$question['qid'])

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

if(!$question['qid'])

Zeile 258Zeile 260
	$update_question = array(
"active" => 1
);

	$update_question = array(
"active" => 1
);

	$db->update_query("questions", $update_question, "qid = '{$question['qid']}'");





	$plugins->run_hooks("admin_config_questions_enable_commit");

	$plugins->run_hooks("admin_config_questions_enable_commit");

 

$db->update_query("questions", $update_question, "qid = '{$question['qid']}'");


// Log admin action
log_admin_action($question['qid'], $question['question']);


// Log admin action
log_admin_action($question['qid'], $question['question']);

Zeile 290Zeile 293
	$table = new Table;
$table->construct_header($lang->question);
$table->construct_header($lang->answers, array("width" => "35%"));

	$table = new Table;
$table->construct_header($lang->question);
$table->construct_header($lang->answers, array("width" => "35%"));

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

	$table->construct_header($lang->correct, array("width" => "5%", "class" => "align_center"));
$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->correct, array("width" => "5%", "class" => "align_center"));
$table->construct_header($lang->incorrect, array("width" => "5%", "class" => "align_center"));
$table->construct_header($lang->controls, array("class" => "align_center", "width" => 150));

Zeile 300Zeile 304
		$questions['question'] = htmlspecialchars_uni($questions['question']);
$questions['answer'] = htmlspecialchars_uni($questions['answer']);
$questions['answer'] = preg_replace("#(\n)#s", "<br />", trim($questions['answer']));

		$questions['question'] = htmlspecialchars_uni($questions['question']);
$questions['answer'] = htmlspecialchars_uni($questions['answer']);
$questions['answer'] = preg_replace("#(\n)#s", "<br />", trim($questions['answer']));

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

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


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


Zeile 314Zeile 319

$table->construct_cell("<div>{$icon}{$questions['question']}</div>");
$table->construct_cell($questions['answer']);


$table->construct_cell("<div>{$icon}{$questions['question']}</div>");
$table->construct_cell($questions['answer']);

 
		$table->construct_cell($questions['shown'], array("class" => "align_center"));

		$table->construct_cell($questions['correct'], array("class" => "align_center"));
$table->construct_cell($questions['incorrect'], array("class" => "align_center"));
$popup = new PopupMenu("questions_{$questions['qid']}", $lang->options);

		$table->construct_cell($questions['correct'], array("class" => "align_center"));
$table->construct_cell($questions['incorrect'], array("class" => "align_center"));
$popup = new PopupMenu("questions_{$questions['qid']}", $lang->options);

Zeile 333Zeile 339

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


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

		$table->construct_cell($lang->no_security_questions, array('colspan' => 5));

		$table->construct_cell($lang->no_security_questions, array('colspan' => 6));

		$table->construct_row();
}


		$table->construct_row();
}