I added this line:
Code:
echo '<input type="hidden" name="adminhash" value="' . ADMINHASH . '" />';
right under line 846, this line:
Code:
echo "<input type='hidden' name='fast_mod' />";
in admin_quiz.php and now it sort of works, except instead of allowing me to deactivate/activate/delete quizes it only deletes.
Edit: I tried commenting out the piece of code in global.php that checks for Admin Mismatch and then commenting out the line I added but it still only deletes quizes. This is (from what I could see) the related code. Any ideas?
Lines 824 to 863 (in the original, unedited file):
Code:
<script type='text/javascript'>
<!--
function doFastMod(){
if(confirm('Are you sure you want to do this?')){
document.forms['cpform'].getElementsByTagName('input')[0].value = 'quiz_fast_mod'
document.forms['cpform'].getElementsByTagName('input')[1].value = document.getElementById('fm').options[document.getElementById('fm').options.selectedIndex].value
document.forms['cpform'].submit(true)
} else {
return false
}
}
-->
</script>
Lines 918 to 963 (in the original, unedited file):
Code:
print_cells_row(array(
"",
"<b>Option</b>",
),'thead','','',1);
$fastmod[] = array('open','Set State To Open');
$fastmod[] = array('close','Set State To Closed');
$fastmod[] = array('delete','Delete');
$Display = '<input type="button" class="button" tabindex="1" value="Execute Action" accesskey="s" onclick="doFastMod();" />';
Print_My_DDM('With the selected quiz\'s...','fast_mod',$fastmod,-1,'fm');
print_description_row($Display, 0, 2, 'tfoot','center');
print_table_footer();
print_cp_footer();
exit;
}
// ###################### Quiz Quick Moderation ########################
if ($_POST['do'] == "quiz_fast_mod") {
globalize($_POST,
array(
'fastmod',
'fast_mod' => STR,
)
);
if(!is_array($fastmod)){
echo "You did not select any quiz's [<a href='javascript:history.go(-1)'>Back</a>]";
exit;
}
if($fastmod == 'open'){
$DB->query("update ".TABLE_PREFIX."quiz set q_state = 1 where qid IN(".implode(',',$fastmod).")");
$Msg = "Quiz(s) State Set To Open";
} else if($fastmod == 'close'){
$DB->query("update ".TABLE_PREFIX."quiz set q_state = 0 where qid IN(".implode(',',$fastmod).")");
$Msg = "Quiz(s) State Set To Closed";
} else {
$Engine->DeleteQuiz($fastmod);
$Msg = "Quiz(s) Deleted Successfully";
}