Many rewrites to get rid of dublicate modreg inserts while ext-cache is registered
[mailer.git] / surfbar.php
index f6092ad36a3d29eb08fb748ab62be17f01a169ee..306b92190cc011d885a0b4dd523a5d05ff7028e6 100644 (file)
 // Load security stuff here
 require('inc/libs/security_functions.php');
 
-// Init surfbar cache and start time
-$GLOBALS['cache_array']['surfbar'] = array();
+// Init start time
 $GLOBALS['startTime'] = microtime(true);
 
 // Set module
 $GLOBALS['module'] = 'surfbar';
 $GLOBALS['refid']  = 0;
 $GLOBALS['output_mode'] = 0;
+$GLOBALS['header_sent'] = 3;
 $msg = null;
 
 // Load the required file(s)
 require('inc/config-global.php');
 
+// Is a frame active?
+if (REQUEST_ISSET_GET('frame')) {
+       // Then we need to set header_sent to 0
+       $GLOBALS['header_sent'] = 0;
+} // END - if
+
 // Is the script installed?
 if (!isInstalled()) {
        // You have to install first!
@@ -68,6 +74,9 @@ if (!IS_MEMBER()) {
        redirectToUrl('modules.php?module=index');
 } // END - if
 
+// Initialize the surfbar
+SURFBAR_INIT();
+
 // Handle tasks on self-maintenance
 SURFBAR_HANDLE_SELF_MAINTENANCE();
 
@@ -168,7 +177,7 @@ if ((SURFBAR_CHECK_RELOAD_FULL()) || ((REQUEST_ISSET_GET('frame')) && (in_array(
                                'id'          => $nextId,
                                'check'       => SURFBAR_GENERATE_VALIDATION_CODE($nextId),
                                'salt'        => SURFBAR_GET_SALT(),
-                               'reward'      => translateComma(SURFBAR_GET_REWARD($nextId)),
+                               'points'      => translateComma(SURFBAR_GET_REWARD($nextId)),
                                'url'         => SURFBAR_GET_URL($nextId),
                                'curr_reload' => SURFBAR_GET_USER_LOCKS(),
                                'max_urls'    => SURFBAR_GET_TOTAL_URLS(),
@@ -199,6 +208,7 @@ if ((SURFBAR_CHECK_RELOAD_FULL()) || ((REQUEST_ISSET_GET('frame')) && (in_array(
 }
 
 // Load footer
+$GLOBALS['footer_sent'] = 3;
 loadIncludeOnce('inc/footer.php');
 
 // [EOF]