]> git.mxchange.org Git - mailer.git/blobdiff - inc/libs/surfbar_functions.php
Introduced new image output mode #2
[mailer.git] / inc / libs / surfbar_functions.php
index d28a0ab1baed4eb9bae7079d43c1804c3fbb3d78..1636cbc8fbf1e60cfa34ddba12d6500c87b39eb9 100644 (file)
@@ -17,7 +17,7 @@
  * -------------------------------------------------------------------- *
  * Copyright (c) 2003 - 2009 by Roland Haeder                           *
  * Copyright (c) 2009 - 2011 by Mailer Developer Team                   *
- * For more information visit: http://www.mxchange.org                  *
+ * For more information visit: http://mxchange.org                      *
  *                                                                      *
  * This program is free software; you can redistribute it and/or modify *
  * it under the terms of the GNU General Public License as published by *
@@ -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;
@@ -861,10 +876,10 @@ function SURFBAR_DETERMINE_TEMPLATE_NAME() {
        $templateName = 'surfbar_frameset';
 
        // Any frame set? ;-)
-       if (isGetRequestParameterSet('frame')) {
+       if (isGetRequestElementSet('frame')) {
                // Use the frame as a template name part... ;-)
                $templateName = sprintf("surfbar_frame_%s",
-                       getRequestParameter('frame')
+                       getRequestElement('frame')
                );
        } // END - if
 
@@ -934,7 +949,7 @@ LIMIT 1",
 }
 
 // Get total amount of URLs of given status for current user or of ACTIVE URLs by default
-function SURFBAR_GET_TOTAL_URLS ($status = 'ACTIVE', $excludeUserId = '0') {
+function SURFBAR_GET_TOTAL_URLS ($status = 'ACTIVE', $excludeUserId = NULL) {
        // Determine depleted user account
        $userids = SURFBAR_DETERMINE_DEPLETED_USERIDS();
 
@@ -978,16 +993,16 @@ LIMIT 1",
 // Check wether the user is allowed to book more URLs
 function SURFBAR_IF_USER_BOOK_MORE_URLS ($userid = NULL) {
        // Is this admin and userid is zero or does the user has some URLs left to book?
-       return ((($userid == '0') && (isAdmin())) || (SURFBAR_GET_TOTAL_USER_URLS($userid, '', array('REJECTED')) < getSurfbarMaxOrder()));
+       return (((is_null($userid)) && (isAdmin())) || (SURFBAR_GET_TOTAL_USER_URLS($userid, '', array('REJECTED')) < getSurfbarMaxOrder()));
 }
 
 // Get total amount of URLs of given status for current user
 function SURFBAR_GET_TOTAL_USER_URLS ($userid = NULL, $status = '', $exclude = '') {
        // Is the user 0 and user is logged in?
-       if (($userid == '0') && (isMember())) {
+       if ((is_null($userid)) && (isMember())) {
                // Then use this userid
                $userid = getMemberId();
-       } elseif ($userid == '0') {
+       } elseif (is_null($userid)) {
                // Error!
                return (getSurfbarMaxOrder() + 1);
        }
@@ -1032,7 +1047,7 @@ function SURFBAR_GENERATE_VALIDATION_CODE ($urlId, $salt = '') {
        }
 
        // Hash it with md5() and salt it with the random string
-       $hashedCode = generateHash(md5($urlId . getEncryptSeperator() . getMemberId()), SURFBAR_GET_SALT());
+       $hashedCode = generateHash(md5($urlId . getEncryptSeparator() . getMemberId()), SURFBAR_GET_SALT());
 
        // Finally encrypt it PGP-like and return it
        $valHashedCode = encodeHashForCookie($hashedCode);
@@ -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
@@ -1649,14 +1664,14 @@ function SURFBAR_RELOAD_TO_STOP_PAGE ($page = 'stop') {
 
 // Determine next id for surfbar or get data for given id, always call this before you call other
 // getters below this function!
-function SURFBAR_DETERMINE_NEXT_ID ($urlId = '0') {
+function SURFBAR_DETERMINE_NEXT_ID ($urlId = NULL) {
        /* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'urlId=' . $urlId . ' - ENTERED!');
        // Default is no id and no random number
        $nextId = '0';
        $randNum = '0';
 
        // Is the id set?
-       if ($urlId == '0') {
+       if (is_null($urlId)) {
                // Get array with lock ids
                $USE = SURFBAR_GET_LOCK_IDS();