]> git.mxchange.org Git - mailer.git/blobdiff - inc/libs/surfbar_functions.php
More double- to single-quotes rewritten
[mailer.git] / inc / libs / surfbar_functions.php
index 5280fc06a1fc1d14ce5c9130619e52c0b31564f9..131ab3b23ff406362b3c76f3c64eed0cb6e87c28 100644 (file)
@@ -38,7 +38,7 @@
 
 // Some security stuff...
 if (!defined('__SECURITY')) {
-       $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
+       $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), '/inc') + 4) . '/security.php';
        require($INC);
 }
 
@@ -352,21 +352,21 @@ function SURFBAR_MEMBER_DISPLAY_ACTION_FORM ($action, $urlData) {
        // Is the lock reason empty?
        if (empty($urlData['lock_reason'])) {
                // Fix it to three dashes
-               $urlData['lock_reason'] = "---";
+               $urlData['lock_reason'] = '---';
        } // END - if
 
        // Include fields only for action 'edit'
        if ($action == "edit") {
                // Default is not limited
-               $urlData['limited_yes'] = "";
-               $urlData['limited_no']  = " checked=\"checked\"";
+               $urlData['limited_yes'] = '';
+               $urlData['limited_no']  = ' chkecked="checked"';
                $urlData['limited']     = "false";
 
                // Is this URL limited?
                if ($urlData['views_max'] > 0) {
                        // Then rewrite form data
-                       $urlData['limited_yes'] = " checked=\"checked\"";
-                       $urlData['limited_no']  = "";
+                       $urlData['limited_yes'] = ' chkecked="checked"';
+                       $urlData['limited_no']  = '';
                        $urlData['limited']     = "true";
                } // END - if
        } // END - if
@@ -383,7 +383,7 @@ function SURFBAR_MEMBER_EXECUTE_ACTION ($action, $urlData) {
        $executed = false;
 
        // Is limitation "no" and "limit" is > 0?
-       if ((isset($urlData[$action]['limited'])) && ($urlData[$action]['limited'] == "N") && ((isset($urlData[$action]['limit'])) && ($urlData[$action]['limit'] > 0)) || (!isset($urlData[$action]['limit']))) {
+       if ((isset($urlData[$action]['limited'])) && ($urlData[$action]['limited'] == 'N') && ((isset($urlData[$action]['limit'])) && ($urlData[$action]['limit'] > 0)) || (!isset($urlData[$action]['limit']))) {
                // Set it to unlimited
                $urlData[$action]['limit'] = 0;
        } // END - if
@@ -519,19 +519,17 @@ function SURFBAR_LOOKUP_BY_URL ($url, $uid) {
 
 // Load URL data by given search term and column
 function SURFBAR_GET_URL_DATA ($searchTerm, $column="id", $order="id", $sort="ASC", $group="id", $add="") {
-       global $lastUrlData;
-
        // By default nothing is found
-       $lastUrlData = array();
+       $GLOBALS['last_url_data'] = array();
 
        // Is the column an id number?
-       if (($column == "id") || ($column == "userid")) {
+       if (($column == "id") || ($column == 'userid')) {
                // Extra secure input
                $searchTerm = bigintval($searchTerm);
        } // END - if
 
        // If the column is "id" there can be only one entry
-       $limit = "";
+       $limit = '';
        if ($column == "id") {
                $limit = "LIMIT 1";
        } // END - if
@@ -551,10 +549,10 @@ ORDER BY %s %s
                        // Shall we group these results?
                        if ($group == "id") {
                                // Add the row by id as index
-                               $lastUrlData[$dataRow['id']] = $dataRow;
+                               $GLOBALS['last_url_data'][$dataRow['id']] = $dataRow;
                        } else {
                                // Group entries
-                               $lastUrlData[$dataRow[$group]][$dataRow['id']] = $dataRow;
+                               $GLOBALS['last_url_data'][$dataRow[$group]][$dataRow['id']] = $dataRow;
                        }
                } // END - while
        } // END - if
@@ -563,7 +561,7 @@ ORDER BY %s %s
        SQL_FREERESULT($result);
 
        // Return the result
-       return $lastUrlData;
+       return $GLOBALS['last_url_data'];
 }
 
 // Registers an URL with the surfbar. You should have called SURFBAR_LOOKUP_BY_URL() first!
@@ -596,7 +594,7 @@ function SURFBAR_REGISTER_URL ($url, $uid, $status="PENDING", $addMode="reg", $e
        $content['limit'] = SURFBAR_TRANSLATE_LIMIT($content['limit']);
 
        // If in reg-mode we notify admin
-       if (($addMode == "reg") || (getConfig('surfbar_notify_admin_unlock') == "Y")) {
+       if (($addMode == "reg") || (getConfig('surfbar_notify_admin_unlock') == 'Y')) {
                // Notify admin even when he as unlocked an email
                SURFBAR_NOTIFY_ADMIN("url_{$addMode}", $content);
        } // END - if
@@ -864,7 +862,7 @@ WHERE userid NOT IN (".implode(",", $UIDs['uid']).") AND `status`='%s'",
 // Check wether the user is allowed to book more URLs
 function SURFBAR_IF_USER_BOOK_MORE_URLS ($uid=0) {
        // Is this admin and userid is zero or does the user has some URLs left to book?
-       return ((($uid == 0) && (IS_ADMIN())) || (SURFBAR_GET_TOTAL_USER_URLS($uid, "", array("REJECTED")) < getConfig('surfbar_max_order')));
+       return ((($uid == 0) && (IS_ADMIN())) || (SURFBAR_GET_TOTAL_USER_URLS($uid, '', array("REJECTED")) < getConfig('surfbar_max_order')));
 }
 // Get total amount of URLs of given status for current user
 function SURFBAR_GET_TOTAL_USER_URLS ($uid=0, $status="",$exclude="") {
@@ -878,7 +876,7 @@ function SURFBAR_GET_TOTAL_USER_URLS ($uid=0, $status="",$exclude="") {
        }
 
        // Default is all URLs
-       $add = "";
+       $add = '';
 
        // Is the status set?
        if (is_array($status)) {
@@ -924,7 +922,7 @@ function SURFBAR_GENERATE_VALIDATION_CODE ($urlId, $salt="") {
        if ($length == 0) $length = 10;
 
        // Generate a code until the length matches
-       $valCode = "";
+       $valCode = '';
        while (strlen($valCode) != $length) {
                // Is the salt set?
                if (empty($salt)) {
@@ -961,7 +959,7 @@ function SURFBAR_CHECK_VALIDATION_CODE ($urlId, $check, $salt) {
        $code = SURFBAR_GENERATE_VALIDATION_CODE($urlId, $salt);
 
        // Return result of checking hashes and salts
-       //* DEBUG: */ DEBUG_LOG(__FUNCTION__, __LINE__, "---".$code."|".$check."---", false);
+       //* DEBUG: */ DEBUG_LOG(__FUNCTION__, __LINE__, '---'.$code."|".$check.'---', false);
        //* DEBUG: */ DEBUG_LOG(__FUNCTION__, __LINE__, "+++".$salt."|".SURFBAR_GET_DATA('last_salt')."+++", false);
        return (($code == $check) && ($salt == SURFBAR_GET_DATA('last_salt')));
 }
@@ -992,7 +990,7 @@ function SURFBAR_PAY_POINTS () {
 // Updates the statistics of current URL/userid
 function SURFBAR_UPDATE_INSERT_STATS_RECORD () {
        // Init add
-       $add = "";
+       $add = '';
 
        // Get allowed views
        $allowed = SURFBAR_GET_VIEWS_ALLOWED();
@@ -1244,7 +1242,7 @@ function SURFBAR_CALCULATE_DYNAMIC_MIN_VALUE () {
        $percent = abs(log(getConfig('surfbar_dynamic_percent') / 100 + 1));
 
        // Get total users
-       $totalUsers = GET_TOTAL_DATA("CONFIRMED", "user_data", "userid", "status", true);
+       $totalUsers = GET_TOTAL_DATA("CONFIRMED", "user_data", 'userid', "status", true);
 
        // Get online users
        $onlineUsers = SURFBAR_DETERMINE_TOTAL_ONLINE();
@@ -1280,7 +1278,7 @@ function SURFBAR_CALCULATE_DYNAMIC_MAX_VALUE () {
        $percent = abs(log(getConfig('surfbar_dynamic_percent') / 100 + 1));
 
        // Get total users
-       $totalUsers = GET_TOTAL_DATA("CONFIRMED", "user_data", "userid", "status", true);
+       $totalUsers = GET_TOTAL_DATA("CONFIRMED", "user_data", 'userid', "status", true);
 
        // Calculate addon
        $addon += abs($max * $percent * $totalUsers);
@@ -1461,7 +1459,7 @@ function SURFBAR_DETERMINE_NEXT_ID ($urlId = 0) {
                $USE = SURFBAR_GET_LOCK_IDS();
 
                // Shall we add some URL ids to ignore?
-               $add = "";
+               $add = '';
                if (count($USE) > 0) {
                        // Ignore some!
                        $add = " AND sbu.id NOT IN (";
@@ -1529,7 +1527,7 @@ LIMIT 1",
                if (is_null($GLOBALS['cache_array']['surfbar']['last_salt'])) {
                        // Then repair it wit the static!
                        //* DEBUG: */ DEBUG_LOG(__FUNCTION__, __LINE__, "last_salt - FIXED!", false);
-                       $GLOBALS['cache_array']['surfbar']['last_salt'] = "";
+                       $GLOBALS['cache_array']['surfbar']['last_salt'] = '';
                } // END - if
 
                // Fix missing last_surfed