]> git.mxchange.org Git - mailer.git/blobdiff - surfbar.php
also prevent it in .htacces. You may want to add this to one of your files in /etc...
[mailer.git] / surfbar.php
index 9fce26b80c2c3247ac7ddd3d13625f3f195cae91..d33ab6b78c8577307c8d9d89de4336dcacffabaf 100644 (file)
  * -------------------------------------------------------------------- *
  * Kurzbeschreibung  : Die Surfbar selbst                               *
  * -------------------------------------------------------------------- *
- * $Revision::                                                        $ *
- * $Date::                                                            $ *
- * $Tag:: 0.2.1-FINAL                                                 $ *
- * $Author::                                                          $ *
- * -------------------------------------------------------------------- *
  * Copyright (c) 2003 - 2009 by Roland Haeder                           *
- * Copyright (c) 2009 - 2012 by Mailer Developer Team                   *
+ * Copyright (c) 2009 - 2016 by Mailer Developer Team                   *
  * For more information visit: http://mxchange.org                      *
  *                                                                      *
  * This program is free software; you can redistribute it and/or modify *
 require('inc/libs/security_functions.php');
 
 // Init start time
-$GLOBALS['__start_time'] = microtime(true);
+$GLOBALS['__start_time'] = microtime(TRUE);
 
 // Set module output mode
 $GLOBALS['__module']      = 'surfbar';
 $GLOBALS['__output_mode'] = '0';
 $GLOBALS['__header_sent'] = 3;
 
-// Load the required file(s)
-require('inc/config-global.php');
+// Initialize application
+require('inc/init.php');
 
 // Set content type
 setContentType('text/html');
@@ -74,7 +69,7 @@ if (!isMember()) {
                        redirectToUrl($url);
                } else {
                        // Load header
-                       loadIncludeOnce('inc/header.php');
+                       loadPageHeader();
 
                        // Is there a 'code' provided?
                        if (isGetRequestElementSet('code')) {
@@ -89,7 +84,7 @@ if (!isMember()) {
                        $GLOBALS['__header_sent'] = 2;
 
                        // Load footer
-                       loadIncludeOnce('inc/footer.php');
+                       loadPageFooter();
                }
        } else {
                // Redirect
@@ -107,7 +102,7 @@ doSurfbarSelfMaintenance();
 if ((isSurfbarReloadFull()) || ((!isFullPage()) && (in_array(getRequestElement('frame'), array('stop', 'stop2', 'stats', 'textlinks'))))) {
        // Reload-lock is full, surfbar stopped so...
        // Load header
-       loadIncludeOnce('inc/header.php');
+       loadPageHeader();
 
        // Load template
        if (((!isFullPage()) && (getRequestElement('frame') == 'stop2')) || (isFullPage())) {
@@ -127,7 +122,7 @@ if ((isSurfbarReloadFull()) || ((!isFullPage()) && (in_array(getRequestElement('
                );
 
                // Load template for "stats" page
-               loadTemplate('surfbar_frame_stats', false, $content);
+               loadTemplate('surfbar_frame_stats', FALSE, $content);
        } elseif ((!isFullPage()) && (getRequestElement('frame') == 'textlinks')) {
                // Prepare content
                $content = array(
@@ -135,16 +130,16 @@ if ((isSurfbarReloadFull()) || ((!isFullPage()) && (in_array(getRequestElement('
                );
 
                // Load template for "stats" page
-               loadTemplate('surfbar_frame_textlinks', false, $content);
+               loadTemplate('surfbar_frame_textlinks', FALSE, $content);
        } else {
                // Prepare content
                $content = array(
                        'start'     => str_repeat('X', strlen(getSurfbarRestartTime())),
-                       'autostart' => (isSurfbarAutoStartEnbaled()) ? 'true' : 'false'
+                       'autostart' => (isSurfbarAutoStartEnabled()) ? 'true' : 'false'
                );
 
                // Load template for stopped surfbar
-               loadTemplate('surfbar_stopped', false, $content);
+               loadTemplate('surfbar_stopped', FALSE, $content);
        }
 } elseif ((isGetRequestElementSet('check')) && (isGetRequestElementSet('id')) && (isGetRequestElementSet('salt'))) {
        // Dummy next id get
@@ -165,13 +160,13 @@ if ((isSurfbarReloadFull()) || ((!isFullPage()) && (in_array(getRequestElement('
                } // END - if
 
                // Load header to avoid a bug
-               loadIncludeOnce('inc/header.php');
+               loadPageHeader();
        } else {
                // Reload to stop frame!
                redirectToSurfbarStopPage();
        }
 
-       // All done, so fix notice for footer.php
+       // All done, so fix notice for loadTemplateFooter()
        $GLOBALS['__footer_sent'] = 1;
 } else {
        // Prepare content
@@ -184,11 +179,11 @@ if ((isSurfbarReloadFull()) || ((!isFullPage()) && (in_array(getRequestElement('
                //* DEBUG: */ exit('nextId='.$nextId);
 
                // Is there a valid id?
-               if ($nextId > 0) {
+               if (isValidId($nextId)) {
                        // Then prepare other content
                        $content = array(
                                'url_id' => $nextId,
-                               'xxx'    => str_repeat('X', strlen(gerSurfbarReloadTime($nextId))),
+                               'xxx'    => str_repeat('X', strlen(getSurfbarWaitingTime($nextId))),
                        );
 
                        // Update salt (double-call lock!) and statistics
@@ -203,19 +198,19 @@ if ((isSurfbarReloadFull()) || ((!isFullPage()) && (in_array(getRequestElement('
        }
 
        // Load header
-       loadIncludeOnce('inc/header.php');
+       loadPageHeader();
 
        // Determine template name
        $templateName = determineSurfbarTemplateName();
 
        // Load that template
-       //* DEBUG: */ exit('templateName=' . $templateName . '<br /><strong>content</strong>=<pre>' . print_r($content, true) . '</pre>');
-       loadTemplate($templateName, false, $content);
+       //* DEBUG: */ exit('templateName=' . $templateName . '<br /><strong>content</strong>=<pre>' . print_r($content, TRUE) . '</pre>');
+       loadTemplate($templateName, FALSE, $content);
 }
 
 // Load footer
 $GLOBALS['__footer_sent'] = 3;
-loadIncludeOnce('inc/footer.php');
+loadPageFooter();
 
 // [EOF]
 ?>