]> git.mxchange.org Git - mailer.git/blobdiff - inc/libs/bonus_functions.php
A lot rewrites from double-quote to single-quote, some fixes for extension handling...
[mailer.git] / inc / libs / bonus_functions.php
index 20b488369ab28a33c3ff8dae9fc64e6e1746bbd8..ff52fbfbe1fd0cca4722954f0ad30c561ed69b81 100644 (file)
@@ -48,18 +48,18 @@ function BONUS_ADD_TURBO_POINTS ($mid, $uid, $type) {
        if (getConfig('bonus_active') != "Y") return false;
 
        // Init variables
-       $sql = ""; $bonys = 0; $mail = 0; $column = "";
+       $sql = ''; $bonys = 0; $mail = 0; $column = '';
 
        // Select SQL command
        switch ($type)
        {
-       case "bonusid":
-               $column = "bonus_id";
+       case 'bonusid':
+               $column = 'bonus_id';
                $bonus = $mid;
                break;
 
-       case "mailid" :
-               $column = "mail_id";
+       case 'mailid' :
+               $column = 'mail_id';
                $mail = $mid;
                break;
 
@@ -93,7 +93,7 @@ function BONUS_ADD_TURBO_POINTS ($mid, $uid, $type) {
                $points = getConfig('turbo_bonus');
        } else {
                // Anything else so let's explode all entered rank points
-               $test = explode(";", getConfig('turbo_rates'));
+               $test = explode(';', getConfig('turbo_rates'));
                if (!empty($test[$rank - 2])) {
                        // Level found
                        $points = $test[$rank - 2];
@@ -111,14 +111,14 @@ function BONUS_ADD_TURBO_POINTS ($mid, $uid, $type) {
        SQL_QUERY_ESC("INSERT INTO `{!_MYSQL_PREFIX!}_bonus_turbo` (userid, mail_id, bonus_id, level, points, timemark) VALUES ('%s', '%s', '%s', '%s', '%s', UNIX_TIMESTAMP())",
                array(bigintval($uid), bigintval($mail), bigintval($bonus), $rank, $points), __FUNCTION__, __LINE__);
 
-       if ((GET_EXT_VERSION("bonus") >= "0.3.5") && (getConfig('bonus_mode') != "ADD") && ($points > 0)) BONUS_POINTS_HANDLER($points);
+       if ((GET_EXT_VERSION('bonus') >= '0.3.5') && (getConfig('bonus_mode') != "ADD") && ($points > 0)) BONUS_POINTS_HANDLER($points);
 }
 //
 function BONUS_MAKE_RANK_ROWS ($data, $type, $uid) {
-       $self = false; $OUT = "";
+       $self = false; $OUT = '';
 
        // How many ranks do we have?
-       $ranks = count(explode(";", getConfig('turbo_rates'))) + 1;
+       $ranks = count(explode(';', getConfig('turbo_rates'))) + 1;
 
        // Load current user's data
        $result = SQL_QUERY_ESC("SELECT level, points, timemark FROM `{!_MYSQL_PREFIX!}_bonus_turbo` WHERE %s=%s AND userid=%s LIMIT 1",
@@ -184,7 +184,7 @@ function BONUS_MAKE_RANK_ROWS ($data, $type, $uid) {
     <div class=\"guest_failed\">".sprintf(getMessage('BONUS_NO_RANKS'), $data)."</div>
   </td>
 </tr>\n";
-               define('__YOUR_RANKING_LINE', "");
+               define('__YOUR_RANKING_LINE', '');
        }
        return $OUT;
 }
@@ -241,7 +241,7 @@ function BONUS_PURGE_EXPIRED_TURBO_BONUS() {
        $result = SQL_QUERY("DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_bonus_turbo` WHERE timemark < (UNIX_TIMESTAMP() - ".getConfig('bonus_timeout').")", __FUNCTION__, __LINE__);
        if (SQL_AFFECTEDROWS() > 0) {
                // Send out email to admin
-               SEND_ADMIN_NOTIFICATION(AUTOPURGE_ADMIN_TURBO_SUBJECT, "admin_autopurge_turbo", SQL_AFFECTEDROWS(), "");
+               SEND_ADMIN_NOTIFICATION(AUTOPURGE_ADMIN_TURBO_SUBJECT, "admin_autopurge_turbo", SQL_AFFECTEDROWS(), '');
        }
 }
 //