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

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