]> git.mxchange.org Git - mailer.git/blobdiff - inc/libs/rallye_functions.php
More templates rewritten
[mailer.git] / inc / libs / rallye_functions.php
index cf06f007354efc5738e03a64088a0907d39cde21..700d0ca4d0d14d5cbed3be5f882266c9f615cb18 100644 (file)
@@ -388,9 +388,9 @@ LIMIT 1", array(bigintval($uid)), __FILE__, __LINE__);
                }
        }
 
-       if (($TOTAL < $min_prices) || ($TOTAL == 0))
-       {
+       if (($TOTAL < $min_prices) || ($TOTAL == 0)) {
                // Do not end this rallye!
+               unset($DATA);
                return;
        }
 
@@ -459,6 +459,7 @@ LIMIT 1", array(bigintval($uid)), __FILE__, __LINE__);
        }
 
        // Send mail to admin
+       die("OK!");
        SEND_ADMIN_NOTIFICATION(RALLYE_ADMIN_EXPIRED.": ".$title, $templ, $cnt, 0);
 
        // Add task
@@ -527,7 +528,7 @@ function RALLYE_LOAD_USERS_ARRAY($rallye)
                'cpoints' => array(),
        );
 
-       // Load users                    uid    old   points earned
+       // Load users                          uid    old  points earned
        $result_user = SQL_QUERY_ESC("SELECT userid, refs, curr_points FROM "._MYSQL_PREFIX."_rallye_users WHERE rallye_id=%s ORDER BY userid",
         array(bigintval($rallye)), __FILE__, __LINE__);
        while(list($uid, $refs, $cpoints) = SQL_FETCHROW($result_user))
@@ -650,6 +651,7 @@ function RALLYE_LIST_WINNERS($rallye,$default=0)
 function RALLYE_DELETE_EXPIRED_RALLYES()
 {
        global $DATA, $_CONFIG;
+
        // Check for expired rallyes
        $EXPIRE = $_CONFIG['one_day'] * 3; // @TODO The hard-coded value...
        $result_rallye = SQL_QUERY_ESC("SELECT id, title, start_time, end_time
@@ -738,6 +740,7 @@ function RALLYE_TEMPLATE_SELECTION($name="template", $default="")
 //
 function RALLYE_GET_REFCOUNT($uid, $old=0) {
        global $_CONFIG, $cacheArray;
+
        // Check current refs
        if (GET_EXT_VERSION("cache") >= "0.1.2") {
                // Get refs from cache
@@ -770,7 +773,7 @@ function RALLYE_GET_REFCOUNT($uid, $old=0) {
 
                if ($cnt > 0) {
                        // Count cache hits
-                       $_CONFIG['cache_hits']++;
+                       if (isset($_CONFIG['cache_hits'])) { $_CONFIG['cache_hits']++; } else { $_CONFIG['cache_hits'] = 1; }
 
                        // Remove old refs
                        //* DEBUG: */ echo "+".$cnt."/".$old."+<br />";