Large code cleanups:
[mailer.git] / inc / libs / surfbar_functions.php
index 7b555fc471c6139910b5d6acb8ae5bd0e8416cce..1636cbc8fbf1e60cfa34ddba12d6500c87b39eb9 100644 (file)
@@ -441,8 +441,23 @@ function SURFBAR_MEMBER_EXECUTE_EDIT_ACTION ($urlData) {
        if (true) {
                //if (($urlData['url_views_allowed'] != $urlData['edit']['limit']) || ($url1 != $url2)) {
                // Run the query
-               SQL_QUERY_ESC("UPDATE `{?_MYSQL_PREFIX?}_surfbar_urls` SET `url`='%s', `url_views_allowed`=%s, `url_views_max`=%s WHERE `url_id`=%s AND `status`='%s' LIMIT 1",
-                       array($urlData['url'], $urlData['edit']['limit'], $urlData['edit']['limit'], $urlData['id'], $urlData['url_status']), __FUNCTION__, __LINE__);
+               SQL_QUERY_ESC("UPDATE
+       `{?_MYSQL_PREFIX?}_surfbar_urls`
+SET
+       `url`='%s',
+       `url_views_allowed`=%s,
+       `url_views_max`=%s
+WHERE
+       `url_id`=%s AND
+       `status`='%s'
+LIMIT 1",
+                       array(
+                               $urlData['url'],
+                               $urlData['edit']['limit'],
+                               $urlData['edit']['limit'],
+                               $urlData['id'],
+                               $urlData['url_status']
+                       ), __FUNCTION__, __LINE__);
 
                // All fine
                $status = true;
@@ -1092,11 +1107,11 @@ function SURFBAR_PAY_POINTS () {
        } // END - if
 
        /* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'userid='.getMemberId().',reward='.SURFBAR_GET_REWARD());
-       // Init referal system here
-       initReferalSystem();
+       // Init referral system here
+       initReferralSystem();
 
        // Book it to the user and ignore return status
-       addPointsThroughReferalSystem(sprintf("surfbar:%s", getSurfbarPaymentModel()), getMemberId(), SURFBAR_GET_REWARD());
+       addPointsThroughReferralSystem(sprintf("surfbar:%s", getSurfbarPaymentModel()), getMemberId(), SURFBAR_GET_REWARD());
        /* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'userid='.SURFBAR_GET_USERID().',costs='.SURFBAR_GET_COSTS() . ' - EXIT!');
 }
 
@@ -1111,7 +1126,7 @@ function SURFBAR_UPDATE_INSERT_STATS_RECORD () {
        // Do we have a limit?
        if ($allowed > 0) {
                // Then count views_max down!
-               $add .= ', `url_views_max`=`url_views_max`-1';
+               $add .= ',`url_views_max`=`url_views_max`-1';
        } // END - if
 
        // Update URL stats