View Single Post
  #571  
Old 06-15-2008, 03:00 AM
TFEX TFEX is offline
 
Join Date: May 2008
Posts: 83
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I am assuming I could alter the admin_quiz.php file in this area somehow:

Code:
// ###################### Do Inferno Quiz Delete Result ########################
if ($_POST['do'] == "do_delete_result") {

	// ----------------------------
	// Assume The Result Exists
	// ----------------------------

	if(!$result = $DB->query_first("select u.username,r.* from ".TABLE_PREFIX."quiz_results r left join ".TABLE_PREFIX."user u on(u.userid=r.r_userid) where r.rid = '".intval($_POST['id'])."'")){
	echo "Result Was Unable To Be Found In Your Database [<a href='javascript:history.go(-1);'>Back</a>]";
	exit;
	}

	// ----------------------------
	// Did we want to delete?
	// ----------------------------

	if($_POST['verify']){

	// ----------------------------
	// Yes we did...
	// ----------------------------

	// Delete Result

	$DB->query("delete from ".TABLE_PREFIX."quiz_results where rid = ".intval($_POST['id'])."");

	$Engine->Redirect(
	"Result Deleted Successfully",
		array(
			array("Moderate Quiz Results","?do=results"),
		)
	);

	} else {

	// ----------------------------
	// No we didn't...
	// ----------------------------

	$Engine->Redirect(
	"Result Not Deleted",
		array(
			array("Moderate This Result","?do=moderate_user_results&id={$_POST['id']}"),
			array("Moderate Quiz Results","?do=results"),
		)
	);

	}



}

using the code from this line:

Code:
	$DB->query("delete from ".TABLE_PREFIX."quiz_results where rid = ".intval($_POST['id'])."");
and adding these variables taken from Amy's mod:

Quote:
$foruminfo['score'] $quiztaken['r_score']
but I have no idea how to put it together, or where to put it after it is together... so as to automatically check and delete at set intervals etc. and, of course, we don't want to be constantly querying the database now, do we? Perhaps even a button added in the code above that performs this function manually, rather than on an automatic timer (ie "hit the button, all results below a certain percentage are deleted").

These reasons are why overwriting the results on each subsequent attempt would be a much more attractive option. I don't care if I have to hard-code it in rather than make it a selectable option, as I only plan to use this mod for the aforementioned purpose anyway.


Any coders out there interested in breezing through this one? If I can get this far with no coding knowledge whatsoever, I imagine you guys could throw something useable up here between lighting up your smoke and putting it out. I'd appreciate any help you could offer. Thanks.
Reply With Quote
 
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01238 seconds
  • Memory Usage 1,769KB
  • Queries Executed 11 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD_SHOWPOST
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (2)bbcode_code
  • (1)bbcode_quote
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_box
  • (1)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (1)post_thanks_postbit_info
  • (1)postbit
  • (1)postbit_onlinestatus
  • (1)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • reputationlevel
  • showthread
Included Files:
  • ./showpost.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_postinfo_query
  • fetch_postinfo
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showpost_start
  • bbcode_fetch_tags
  • bbcode_create
  • postbit_factory
  • showpost_post
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • showpost_complete