// ####################### SET PHP ENVIRONMENT ########################### error_reporting(E_ALL & ~E_NOTICE); // #################### DEFINE IMPORTANT CONSTANTS ####################### define('THIS_SCRIPT', 'donation_system'); define('CSRF_PROTECTION', false); // change this depending on your filename // ################### PRE-CACHE TEMPLATES AND DATA ###################### // get special phrase groups $phrasegroups = array(); // get special data templates from the datastore $specialtemplates = array(); // pre-cache templates used by all actions $globaltemplates = array('donation_main', ); // pre-cache templates used by specific actions $actiontemplates = array('donation_success', 'donation_fail', 'donation_paypal', 'donation_google', 'donation_nochex', ); // ######################### REQUIRE BACK-END ############################ // if your page is outside of your normal vb forums directory, you should change directories by uncommenting the next line // chdir ('/path/to/your/forums'); require_once('./global.php'); // ####################################################################### // ######################## START MAIN SCRIPT ############################ // ####################################################################### $navbits = construct_navbits(array('' => 'Donation System')); $navbar = render_navbar_template($navbits); // ###### Payment Success ##### if ($_REQUEST['do'] == 'success') { $pagetitle = 'Donate'; $templater = vB_Template::create('donation_success'); $templater->register_page_templates(); $templater->register('navbar', $navbar); $templater->register('pagetitle', $pagetitle); print_output($templater->render()); } // ###### Payment Failed ##### if ($_REQUEST['do'] == 'failed') { $pagetitle = 'Donate'; $templater = vB_Template::create('donation_fail'); $templater->register_page_templates(); $templater->register('navbar', $navbar); $templater->register('pagetitle', $pagetitle); print_output($templater->render()); } // ###### PayPal Template ##### if ($_REQUEST['do'] == 'paypal') { $pagetitle = 'Donate'; $templater = vB_Template::create('donation_paypal'); $templater->register_page_templates(); $templater->register('navbar', $navbar); $templater->register('pagetitle', $pagetitle); print_output($templater->render()); } // ###### Google Template ##### if ($_REQUEST['do'] == 'google') { $pagetitle = 'Donate'; $templater = vB_Template::create('donation_google'); $templater->register_page_templates(); $templater->register('navbar', $navbar); $templater->register('pagetitle', $pagetitle); print_output($templater->render()); } // ###### WorldPay Template ##### if ($_REQUEST['do'] == 'nochex') { $pagetitle = 'Donate'; $templater = vB_Template::create('donation_nochex'); $templater->register_page_templates(); $templater->register('navbar', $navbar); $templater->register('pagetitle', $pagetitle); print_output($templater->render()); } // ###### Main System ##### $pagetitle = 'Donate'; $templater = vB_Template::create('donation_main'); $templater->register_page_templates(); $templater->register('navbar', $navbar); $templater->register('pagetitle', $pagetitle); print_output($templater->render());