]> git.mxchange.org Git - mailer.git/blobdiff - inc/libs/rallye_functions.php
Some global variables rewritten, a lot more language constants rewritten to getMessage()
[mailer.git] / inc / libs / rallye_functions.php
index ff1bee571118bbf0382b157bb177f5cfa5d00f5c..8587a35e5801c2e033ec41d7d1286d4e677d3f72 100644 (file)
@@ -43,11 +43,10 @@ if (!defined('__SECURITY')) {
 }
 
 //
-function RALLYE_AUTOSTART_RALLYES($result)
-{
+function RALLYE_AUTOSTART_RALLYES ($result) {
        // Global data array for LOAD_EMAIL_TEMPLATE()
-       $DATA = array();
        global $DATA;
+       $DATA = array();
 
        // Load all rallyes (usally we have only one rallye active per time!
        list($id, $title, $start, $end, $notify, $min_users, $min_prices) = SQL_FETCHROW($result);
@@ -315,9 +314,9 @@ VALUES ('%s','%s','0')",
                } // END - if
        } // END - if
 }
+
 //
-function RALLYE_EXPIRE_RALLYES($result)
-{
+function RALLYE_EXPIRE_RALLYES ($result) {
        global $DATA;
 
        // Load rallye data
@@ -570,8 +569,7 @@ function RALLYE_LIST_WINNERS ($rallye, $default=0) {
        // Generate table
        $OUT = LOAD_TEMPLATE("guest_rallye_expired_header", true);
        $SW = 2;
-       for ($idx = 0; $idx < $prices; $idx++)
-       {
+       for ($idx = 0; $idx < $prices; $idx++) {
                // Check status
                //   active = 1: account is still confirmed
                //   active = 0: account is deleted or locked
@@ -581,19 +579,16 @@ function RALLYE_LIST_WINNERS ($rallye, $default=0) {
                SQL_FREERESULT($result_active);
 
                if (empty($DATA['uid'][$idx])) $DATA['uid'][$idx] = "---";
-               if ((empty($DATA['ref'][$idx])) || ($DATA['ref'][$idx] == 0) || ($active == 0) || ("".round($DATA['cpoints'][$idx])."" == "0") || (empty($DATA['cpoints'][$idx])))
-               {
+               if ((empty($DATA['ref'][$idx])) || ($DATA['ref'][$idx] == 0) || ($active == 0) || ("".round($DATA['cpoints'][$idx])."" == "0") || (empty($DATA['cpoints'][$idx]))) {
                        // Allow valid and active users with at least one ref to get points
                        $DATA['ref'][$idx]   = "---";
                        $DATA['uid'][$idx]   = "---";
                }
-               if (!empty($DATA['info'][$idx]))
-               {
+
+               if (!empty($DATA['info'][$idx])) {
                        // Take direct infos
                        $DATA['infos'][$idx] = $DATA['info'][$idx];
-               }
-                else
-               {
+               } else {
                        // Take ppints
                        $DATA['infos'][$idx] = $DATA['points'][$idx]." {!POINTS!}";
                }
@@ -620,6 +615,7 @@ function RALLYE_LIST_WINNERS ($rallye, $default=0) {
 </tr>\n";
                $SW = 3 - $SW;
        }
+
        // Add footer
        $OUT .= LOAD_TEMPLATE("guest_rallye_expired_footer", true);
 
@@ -675,9 +671,9 @@ VALUES ('NEW','RALLYE_PURGED','{--RALLYE_ADMIN_PURGED--}: %s','{--RALLYE_ADMIN_P
        // Free memory
        SQL_FREERESULT($result_rallye);
 }
+
 //
-function RALLYE_TEMPLATE_SELECTION($name="template", $default="")
-{
+function RALLYE_TEMPLATE_SELECTION ($name="template", $default="") {
        // Check templates directory
        $OUT = ""; $ral = array();
        $BASE = sprintf("%stemplates/%s/html/rallye/", constant('PATH'), GET_LANGUAGE());
@@ -716,6 +712,7 @@ function RALLYE_TEMPLATE_SELECTION($name="template", $default="")
        // Return selection
        return $OUT;
 }
+
 //
 function RALLYE_GET_REFCOUNT ($uid, $old=0) {
        // Check current refs
@@ -755,7 +752,7 @@ function RALLYE_GET_REFCOUNT ($uid, $old=0) {
                        // Remove old refs
                        //* DEBUG: */ echo "+".$cnt."/".$old."+<br />";
                        $cnt -= $old;
-               }
+               } // END - if
        } else {
                // Load current refs from database
                $result_ref = SQL_QUERY_ESC("SELECT DISTINCT SUM(s.counter) AS cnt