A lot rewrites from double-quote to single-quote, some fixes for extension handling...
[mailer.git] / inc / libs / surfbar_functions.php
index 6babc26648a71476ff46913158b757cd07042a6d..cf7bf861f8271e934aa6e5ebb10c61470a6c5b94 100644 (file)
@@ -358,15 +358,15 @@ function SURFBAR_MEMBER_DISPLAY_ACTION_FORM ($action, $urlData) {
        // 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
@@ -523,13 +523,13 @@ function SURFBAR_GET_URL_DATA ($searchTerm, $column="id", $order="id", $sort="AS
        $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
@@ -594,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
@@ -862,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="") {
@@ -876,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)) {
@@ -922,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)) {
@@ -990,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();
@@ -1242,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();
@@ -1278,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);
@@ -1459,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 (";
@@ -1527,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