Sorry to bother you again, but only one more thing i need some help with...
I want to be able to enable/disable all my hacks, especially this one, so i made a table called hack_enabled with the hackname and a tinyint where 0 = off and 1 = on..i copied some code from forum.php and just modded it to my needs, but i dont know how to get PHP to read the value's of the Yes/No and change them into 1 for yes and 0 for no...
Any ideas on this code, or even if you got an easier way of doing it, just like you had the templates..
PHP Code:
if ($_REQUEST['do'] == 'valueposts')
{
globalize($_REQUEST, array());
print_form_header('value', 'dovalueposts');
print_table_header('Hack Enabling');
print_yes_no_row('Enable Value Posts', 'options[enabled]', $forum['warnall']);
print_submit_row($vbphrase['save']);
print_cp_footer();
}
// ###################### Update The Value.. #######################
if ($_POST['do'] == 'dovalueposts')
{
globalize($_POST, array('options'));
$DB_site->query("UPDATE hack_enabled SET enabled='xxx' WHERE hack ='valueposts'");
define('CP_REDIRECT', "index.php?do=home");
print_stop_message('hack_enabled_success);
}