Naming convention applied
authorRoland Häder <roland@mxchange.org>
Wed, 6 Feb 2008 20:32:39 +0000 (20:32 +0000)
committerRoland Häder <roland@mxchange.org>
Wed, 6 Feb 2008 20:32:39 +0000 (20:32 +0000)
13 files changed:
inc/extensions.php
inc/functions.php
inc/install-inc.php
inc/language.php
inc/modules/admin/admin-inc.php
inc/modules/admin/what-list_links.php
inc/modules/admin/what-list_task.php
inc/modules/member/what-order.php
inc/modules/member/what-unconfirmed.php
inc/modules/order.php
inc/mysql-manager.php
mailid.php
mailid_top.php

index dc22eae..e8675c7 100644 (file)
@@ -271,8 +271,8 @@ function EXT_IS_ACTIVE ($ext_name, $ignore_admin=false, $ignore_cache=false)
        if ((!mxchange_installed) || (mxchange_installing) || (empty($ext_name))) return false;
 
        // Extension's file name will also be checked
-       $FILE = PATH."inc/extensions/ext-".$ext_name.".php";
-       if ((!file_exists($FILE)) && (!is_readable($FILE))) return false;
+       $file = PATH."inc/extensions/ext-".$ext_name.".php";
+       if ((!file_exists($file)) && (!is_readable($file))) return false;
        //* DEBUG: */ echo "*".$ext_name."*<BR>";
 
        // Failed is the default
index 3162da2..6a64288 100644 (file)
@@ -662,9 +662,9 @@ function SELECTION_COUNT($array)
        return $ret;
 }
 //
-function IMG_CODE ($code, $TYPE, $DATA, $uid)
+function IMG_CODE ($code, $type, $DATA, $uid)
 {
-       return "<IMG border=\"0\" alt=\"Code\" src=\"".URL."/mailid_top.php?uid=".$uid."&amp;".$TYPE."=".$DATA."&amp;mode=img&amp;code=".$code."\">";
+       return "<IMG border=\"0\" alt=\"Code\" src=\"".URL."/mailid_top.php?uid=".$uid."&amp;".$type."=".$DATA."&amp;mode=img&amp;code=".$code."\">";
 }
 //
 function TRANSLATE_STATUS($status)
@@ -1132,10 +1132,10 @@ function array_pk_sort(&$array, $a_sort, $primary_key = 0, $order = -1, $nums =
        $array = $dummy;
 }
 //
-function ADD_SELECTION($TYPE, $DEFAULT, $PREFIX="", $id="0")
+function ADD_SELECTION($type, $DEFAULT, $PREFIX="", $id="0")
 {
        global $MONTH_DESCR; $OUT = "";
-       if ($TYPE == "yn")
+       if ($type == "yn")
        {
                // This is a yes/no selection only!
                if ($id > 0) $PREFIX .= "[".$id."]";
@@ -1145,11 +1145,11 @@ function ADD_SELECTION($TYPE, $DEFAULT, $PREFIX="", $id="0")
        {
                // Begin with regular selection box here
                if (!empty($PREFIX)) $PREFIX .= "_";
-               $TYPE2 = $TYPE;
-               if ($id > 0) $TYPE2 .= "[".$id."]";
-               $OUT .= "    <SELECT name=\"".strtolower($PREFIX.$TYPE2)."\" class=\"register_select\" size=\"1\">\n";
+               $type2 = $type;
+               if ($id > 0) $type2 .= "[".$id."]";
+               $OUT .= "    <SELECT name=\"".strtolower($PREFIX.$type2)."\" class=\"register_select\" size=\"1\">\n";
        }
-       switch ($TYPE)
+       switch ($type)
        {
        case "day": // Day
                for ($idx = 1; $idx < 32; $idx++)
index 0b0cfb1..f4146a7 100644 (file)
@@ -43,23 +43,23 @@ if (ereg(basename(__FILE__), $_SERVER['PHP_SELF']))
 }
 
 //
-function install_WriteData ($FILE, $COMMENT, $PREFIX, $SUFFIX, $DATA, $SNEAK=0)
+function install_WriteData ($file, $COMMENT, $PREFIX, $SUFFIX, $DATA, $SNEAK=0)
 {
        $DONE = false;  $SNEAK++;
-       if (file_exists($FILE))
+       if (file_exists($file))
        {
-               $SEARCH = "CFG: ".$COMMENT;
-               $TMP = $FILE.".tmp";
-               $fp = fopen($FILE, 'r') or OUTPUT_HTML ("<STRONG>READ:</STRONG> ".$FILE."<BR>");
-               if ($fp)
+               $search = "CFG: ".$COMMENT;
+               $tmp = $file.".tmp";
+               $fp = @fopen($file, 'r') or OUTPUT_HTML ("<STRONG>READ:</STRONG> ".$file."<BR>");
+               if (is_resource($fp))
                {
-                       $fp_tmp = fopen($TMP, 'w') or OUTPUT_HTML ("<STRONG>WRITE:</STRONG> ".$TMP."<BR>");
-                       if ($fp_tmp)
+                       $fp_tmp = @fopen($tmp, 'w') or OUTPUT_HTML ("<STRONG>WRITE:</STRONG> ".$tmp."<BR>");
+                       if (is_resource($fp_tmp))
                        {
                                while (! feof($fp))
                                {
                                        $line = fgets ($fp, 10240);
-                                       if (strpos($line, $SEARCH) > -1) $next = 0;
+                                       if (strpos($line, $search) > -1) $next = 0;
                                        if ($next > -1)
                                        {
                                                if ($next == $SNEAK)
@@ -78,12 +78,15 @@ function install_WriteData ($FILE, $COMMENT, $PREFIX, $SUFFIX, $DATA, $SNEAK=0)
                                // Finished writing tmp file
                                $DONE = true;
                        }
+
+                       // Close source directory
                        fclose($fp);
-                       if ($DONE)
+
+                       if (($DONE) && (is_writeable($file)))
                        {
                                // Copy back tmp file and delete tmp :-)
-                               @copy($TMP, $FILE);
-                               @unlink($TMP);
+                               @copy($tmp, $file);
+                               @unlink($tmp);
                        }
                         else
                        {
@@ -93,7 +96,7 @@ function install_WriteData ($FILE, $COMMENT, $PREFIX, $SUFFIX, $DATA, $SNEAK=0)
        }
         else
        {
-               OUTPUT_HTML ("<STRONG>404:</STRONG> ".$FILE."<BR>");
+               OUTPUT_HTML ("<STRONG>404:</STRONG> ".$file."<BR>");
        }
 }
 
index beced61..4790793 100644 (file)
@@ -41,18 +41,18 @@ if (ereg(basename(__FILE__), $_SERVER['PHP_SELF']))
 if (empty($mx_lang)) $mx_lang = DEFAULT_LANG;
 
 // Look for file
-$FILE = sprintf(PATH."inc/language/%s.php", $mx_lang);
-if (!file_exists($FILE))
+$file = sprintf(PATH."inc/language/%s.php", $mx_lang);
+if (!file_exists($file))
 {
        // Switch to default (DO NOT CHANGE!!!)
        @setcookie("mx_lang", "de", (time() + $CONFIG['online_timeout']), COOKIE_PATH);
        $mx_lang = "de";
-       $FILE = sprintf(PATH."inc/language/%s.php", $mx_lang);
+       $file = sprintf(PATH."inc/language/%s.php", $mx_lang);
 }
 
 // Load language file
-require($FILE);
-unset($FILE);
+require($file);
+unset($file);
 
 // Check for installation mode
 if (!mxchange_installed)
index 258c265..be8b8c1 100644 (file)
@@ -162,23 +162,23 @@ function CHECK_ADMIN_COOKIES ($admin_login, $password)
        return $ret;
 }
 //
-function admin_WriteData ($FILE, $COMMENT, $PREFIX, $SUFFIX, $DATA, $SEEK=0)
+function admin_WriteData ($file, $COMMENT, $PREFIX, $SUFFIX, $DATA, $SEEK=0)
 {
        $DONE = false;  $SEEK++; $found = false;
-       if (file_exists($FILE))
+       if (file_exists($file))
        {
-               $SEARCH = "CFG: ".$COMMENT;
-               $TMP = $FILE.".tmp";
-               $fp = fopen($FILE, 'r') or OUTPUT_HTML ("<STRONG>READ:</STRONG> ".$FILE."<BR>");
+               $search = "CFG: ".$COMMENT;
+               $tmp = $file.".tmp";
+               $fp = fopen($file, 'r') or OUTPUT_HTML ("<STRONG>READ:</STRONG> ".$file."<BR>");
                if ($fp)
                {
-                       $fp_tmp = fopen($TMP, 'w') or OUTPUT_HTML ("<STRONG>WRITE:</STRONG> ".$TMP."<BR>");
+                       $fp_tmp = fopen($tmp, 'w') or OUTPUT_HTML ("<STRONG>WRITE:</STRONG> ".$tmp."<BR>");
                        if ($fp_tmp)
                        {
                                while (! feof($fp))
                                {
                                        $line = fgets ($fp, 1024);
-                                       if (strpos($line, $SEARCH) > -1) { $next = 0; $found = true; }
+                                       if (strpos($line, $search) > -1) { $next = 0; $found = true; }
                                        if ($next > -1)
                                        {
                                                if ($next == $SEEK)
@@ -201,8 +201,8 @@ function admin_WriteData ($FILE, $COMMENT, $PREFIX, $SUFFIX, $DATA, $SEEK=0)
                        if (($DONE) && ($found))
                        {
                                // Copy back tmp file and delete tmp :-)
-                               @copy($TMP, $FILE);
-                               @unlink($TMP);
+                               @copy($tmp, $file);
+                               @unlink($tmp);
                                define ('_FATAL', false);
                        }
                         elseif (!$found)
@@ -219,7 +219,7 @@ function admin_WriteData ($FILE, $COMMENT, $PREFIX, $SUFFIX, $DATA, $SEEK=0)
        }
         else
        {
-               OUTPUT_HTML ("<STRONG>404:</STRONG> ".$FILE."<BR>");
+               OUTPUT_HTML ("<STRONG>404:</STRONG> ".$file."<BR>");
        }
 }
 //
index 1cb8786..5d7a1b0 100644 (file)
@@ -94,14 +94,14 @@ if (!empty($_GET['u_id'])) {
                                        case "NORMAL":
                                                $result_data = SQL_QUERY_ESC("SELECT subject, timestamp_ordered, cat_id FROM "._MYSQL_PREFIX."_user_stats WHERE id=%d LIMIT 1",
                                                 array(bigintval($id)), __FILE__, __LINE__);
-                                               $TYPE = "mailid"; $DATA = $id; $PROBLEM = NORMAL_MAIL_PROBLEM;
+                                               $type = "mailid"; $DATA = $id; $PROBLEM = NORMAL_MAIL_PROBLEM;
                                                $LINK = "<A href=\"".URL."/mailid.php?uid=".$_GET['u_id']."&amp;mailid=".$id."\" target=\"_blank\">".$id."</A>";
                                                break;
 
                                        case "BONUS":
                                                $result_data = SQL_QUERY_ESC("SELECT subject, timestamp, cat_id FROM "._MYSQL_PREFIX."_bonus WHERE id=%d LIMIT 1",
                                                 array(bigintval($id2)), __FILE__, __LINE__);
-                                               $TYPE = "bonusid"; $DATA = $id2; $PROBLEM = BONUS_MAIL_PROBLEM;
+                                               $type = "bonusid"; $DATA = $id2; $PROBLEM = BONUS_MAIL_PROBLEM;
                                                $LINK = "<A href=\"".URL."/mailid.php?uid=".$_GET['u_id']."&amp;bonusid=".$id2."\" target=\"_blank\">".$id2."</A>";
                                                break;
                                        }
index 20c2b1b..3a4fccd 100644 (file)
@@ -129,10 +129,10 @@ ORDER BY userid DESC, task_type DESC, subject, task_created DESC", __FILE__, __L
                }
 
                // There are uncompleted jobs!
-               $eval = "\$TYPE = ADMIN_OVERVIEW_TASK_".strtoupper($_GET['type'])."_TYPE;";
+               $eval = "\$type = ADMIN_OVERVIEW_TASK_".strtoupper($_GET['type'])."_TYPE;";
                eval($eval);
                LOAD_TEMPLATE("admin_overview_header_task", false, array(
-                       'message' => $TYPE,
+                       'message' => $type,
                        'type'    => $_GET['type']
                ));
                $SW = 2;
index 205ef6a..fd306af 100644 (file)
@@ -544,7 +544,7 @@ LIMIT 1", array(bigintval($ucat)), __FILE__, __LINE__);
                        // Now we need to load the mail types...
                        $result = SQL_QUERY("SELECT id, price, payment, mail_title FROM "._MYSQL_PREFIX."_payments ORDER BY payment", __FILE__, __LINE__);
 
-                       $TYPES = array();
+                       $typeS = array();
                        if (SQL_NUMROWS($result) > 0)
                        {
                                // Check for message ID in URL
@@ -636,7 +636,7 @@ LIMIT 1", array(bigintval($ucat)), __FILE__, __LINE__);
                                }
 
                                // Load all email types...
-                               while ($TYPES[] = SQL_FETCHROW($result))
+                               while ($typeS[] = SQL_FETCHROW($result))
                                {
                                        // Nothing to do here... ;-)
                                }
@@ -699,22 +699,22 @@ LIMIT 1", array(bigintval($ucat)), __FILE__, __LINE__);
                                                $CAT .= ">".$CATS['name'][$key]." (".$CATS['uids'][$key]." ".USER_IN_CAT.")</OPTION>\n";
                                        }
                                        // Mail type
-                                       $TYPE = "";
-                                       foreach ($TYPES as $key=>$value)
+                                       $type = "";
+                                       foreach ($typeS as $key=>$value)
                                        {
-                                               $P = TRANSLATE_COMMA($TYPES[$key][1]);
+                                               $P = TRANSLATE_COMMA($typeS[$key][1]);
                                                if (is_array($value))
                                                {
                                                        // Output option line
-                                                       $TYPE .= "      <OPTION value=\"".$TYPES[$key][0]."\"";
-                                                       if (($OLD_ORDER) && ($payment == $TYPES[$key][0])) $TYPE .= " selected=\"selected\"";
-                                                       $TYPE .= ">".$P." ".PER_MAIL." - ".$TYPES[$key][3]." - ".round($TYPES[$key][2])." ".PAYMENT."</OPTION>\n";
+                                                       $type .= "      <OPTION value=\"".$typeS[$key][0]."\"";
+                                                       if (($OLD_ORDER) && ($payment == $typeS[$key][0])) $type .= " selected=\"selected\"";
+                                                       $type .= ">".$P." ".PER_MAIL." - ".$typeS[$key][3]." - ".round($typeS[$key][2])." ".PAYMENT."</OPTION>\n";
                                                }
                                        }
 
                                        // Put all in constants for the template
                                        define('CATEGORY_SELECTION', $CAT);
-                                       define('TYPE_SELECTION', $TYPE);
+                                       define('TYPE_SELECTION', $type);
                                        define('TARGET', $target);
                                        define('SUBJECT', $subject);
                                        define('TEXT', COMPILE_CODE($text));
index bf21124..4f97b68 100644 (file)
@@ -72,13 +72,13 @@ if (SQL_NUMROWS($result) > 0)
                case "NORMAL":
                        $result_data = SQL_QUERY_ESC("SELECT subject, subject, timestamp_ordered, cat_id, payment_id, pool_id FROM "._MYSQL_PREFIX."_user_stats WHERE id=%d LIMIT 1",
                         array(bigintval($id)), __FILE__, __LINE__);
-                       $TYPE = "mailid"; $DATA = $id; $PROBLEM = NORMAL_MAIL_PROBLEM;
+                       $type = "mailid"; $DATA = $id; $PROBLEM = NORMAL_MAIL_PROBLEM;
                        break;
 
                case "BONUS":
                        $result_data = SQL_QUERY_ESC("SELECT subject, text, timestamp, cat_id, points, id FROM "._MYSQL_PREFIX."_bonus WHERE id=%d LIMIT 1",
                         array(bigintval($id2)), __FILE__, __LINE__);
-                       $TYPE = "bonusid"; $DATA = $id2; $PROBLEM = BONUS_MAIL_PROBLEM;
+                       $type = "bonusid"; $DATA = $id2; $PROBLEM = BONUS_MAIL_PROBLEM;
                        break;
                }
 
@@ -104,7 +104,7 @@ if (SQL_NUMROWS($result) > 0)
                                'sw'     => $SW,
                                'uid'    => $GLOBALS['userid'],
                                'data'   => $DATA,
-                               'type'   => $TYPE,
+                               'type'   => $type,
                                'subj'   => $subject,
                                'text'   => COMPILE_CODE($text),
                                'stamp'  => MAKE_DATETIME($timestamp, "0"),
index f8c5585..5d17312 100644 (file)
@@ -63,19 +63,19 @@ if (empty($URL))
                // Auto-send is active
                define('ADMIN_AUTOSEND',  COMPILE_CODE(ADMIN_AUTOSEND_ACTIVE));
                define('MEMBER_AUTOSEND', COMPILE_CODE(MEMBER_AUTOSEND_ACTIVE));
-               $TYPE = "NEW";
+               $type = "NEW";
        }
         else
        {
                // Auto-send is inactive
                define('ADMIN_AUTOSEND',  COMPILE_CODE(ADMIN_AUTOSEND_INACTIVE));
                define('MEMBER_AUTOSEND', COMPILE_CODE(MEMBER_AUTOSEND_INACTIVE));
-               $TYPE = "ADMIN";
+               $type = "ADMIN";
        }
 
        // Update sending pool
        $result = SQL_QUERY_ESC("UPDATE "._MYSQL_PREFIX."_pool SET data_type='%s' WHERE id=%d AND sender=%d AND data_type='TEMP' LIMIT 1",
-        array($TYPE, bigintval($_GET['order']), $GLOBALS['userid']), __FILE__, __LINE__);
+        array($type, bigintval($_GET['order']), $GLOBALS['userid']), __FILE__, __LINE__);
 
        // Finally is the entry valid?
        if (SQL_AFFECTEDROWS($link) == 1)
index 00f4109..ea9bff0 100644 (file)
@@ -213,16 +213,16 @@ function CHECK_MODULE($mod)
        return $ret;
 }
 //
-function ADD_DESCR($ACC_LVL, $FILE, $return = false, $output = true)
+function ADD_DESCR($ACC_LVL, $file, $return = false, $output = true)
 {
-       global $_GET, $DEPTH, $CONFIG;
+       global $DEPTH, $CONFIG;
        $LINK_ADD = ""; $OUT = ""; $AND = "";
        // First we have to do some analysis...
-       if (ereg("action-", $FILE))
+       if (ereg("action-", $file))
        {
                // This is an action file!
-               $TYPE = "action";
-               $SEARCH = substr($FILE, 7);
+               $type = "action";
+               $search = substr($file, 7);
                switch ($ACC_LVL)
                {
                case "admin":
@@ -237,11 +237,11 @@ function ADD_DESCR($ACC_LVL, $FILE, $return = false, $output = true)
                }
                $AND = " AND what=''";
        }
-        elseif (ereg("what-", $FILE))
+        elseif (ereg("what-", $file))
        {
                // This is an admin what file!
-               $TYPE = "what";
-               $SEARCH = substr($FILE, 5);
+               $type = "what";
+               $search = substr($file, 5);
                $AND = "";
                switch ($ACC_LVL)
                {
@@ -258,22 +258,22 @@ function ADD_DESCR($ACC_LVL, $FILE, $return = false, $output = true)
                        }
                        break;
                }
-               $DUMMY = substr($SEARCH, 0, -4);
+               $DUMMY = substr($search, 0, -4);
                $AND .= " AND action='".GET_ACTION($ACC_LVL, $DUMMY)."'";
        }
         elseif (($ACC_LVL == "sponsor") || ($ACC_LVL == "engine"))
        {
                // Sponsor / engine menu
-               $TYPE = "what";
-               $SEARCH = $FILE;
+               $type = "what";
+               $search = $file;
                $MOD_CHECK = $GLOBALS['module'];
                $AND = "";
        }
         else
        {
                // Other
-               $TYPE = "menu";
-               $SEARCH = $FILE;
+               $type = "menu";
+               $search = $file;
                $MOD_CHECK = $GLOBALS['module'];
                $AND = "";
        }
@@ -288,12 +288,12 @@ function ADD_DESCR($ACC_LVL, $FILE, $return = false, $output = true)
                $PREFIX = "";
        }
        $PREFIX .= "&nbsp;-&gt;&nbsp;";
-       if (ereg(".php", $SEARCH))
+       if (ereg(".php", $search))
        {
-               $SEARCH = substr($SEARCH, 0, strpos($SEARCH, ".php"));
+               $search = substr($search, 0, strpos($search, ".php"));
        }
        $result = SQL_QUERY_ESC("SELECT title FROM "._MYSQL_PREFIX."_%s_menu WHERE %s='%s' ".$AND." LIMIT 1",
-        array($ACC_LVL, $TYPE, $SEARCH), __FILE__, __LINE__);
+        array($ACC_LVL, $type, $search), __FILE__, __LINE__);
        if (SQL_NUMROWS($result) == 1)
        {
                list($ret) = SQL_FETCHROW($result);
@@ -306,10 +306,10 @@ function ADD_DESCR($ACC_LVL, $FILE, $return = false, $output = true)
                 elseif (((GET_EXT_VERSION("sql_patches") >= "0.2.3") && ($CONFIG['youre_here'] == 'Y')) || ((IS_ADMIN()) && ($MOD_CHECK == "admin")))
                {
                        // Output HTML code
-                       $OUT = $PREFIX."<STRONG><A class=\"you_are_here\" href=\"".URL."/modules.php?module=".$MOD_CHECK."&amp;".$TYPE."=".$SEARCH.$LINK_ADD."\">".$ret."</A></STRONG>\n";
-                       //* DEBUG: */ echo __LINE__."*".$TYPE."/".$GLOBALS['what']."*<br />\n";
-                       if (($TYPE == "what") || (($TYPE == "action") && (!isset($_GET['what'])) && ($GLOBALS['what'] != "welcome"))) {
-                               //* DEBUG: */ echo __LINE__."+".$TYPE."+<br />\n";
+                       $OUT = $PREFIX."<STRONG><A class=\"you_are_here\" href=\"".URL."/modules.php?module=".$MOD_CHECK."&amp;".$type."=".$search.$LINK_ADD."\">".$ret."</A></STRONG>\n";
+                       //* DEBUG: */ echo __LINE__."*".$type."/".$GLOBALS['what']."*<br />\n";
+                       if (($type == "what") || (($type == "action") && (!isset($_GET['what'])) && ($GLOBALS['what'] != "welcome"))) {
+                               //* DEBUG: */ echo __LINE__."+".$type."+<br />\n";
                                $OUT .= "</DIV><BR>\n";
                        }
                }
@@ -582,7 +582,7 @@ function SEARCH_EMAIL_USERTAB($email)
        return $ret;
 }
 //
-function WHAT_IS_VALID($act, $wht, $TYPE="guest")
+function WHAT_IS_VALID($act, $wht, $type="guest")
 {
        if (IS_ADMIN())
        {
@@ -592,7 +592,7 @@ function WHAT_IS_VALID($act, $wht, $TYPE="guest")
         else
        {
                $ret = false;
-               $result = SQL_QUERY_ESC("SELECT id FROM "._MYSQL_PREFIX."_%s_menu WHERE action='%s' AND what='%s' AND locked='N' LIMIT 1", array($TYPE, $act, $wht), __FILE__, __LINE__);
+               $result = SQL_QUERY_ESC("SELECT id FROM "._MYSQL_PREFIX."_%s_menu WHERE action='%s' AND what='%s' AND locked='N' LIMIT 1", array($type, $act, $wht), __FILE__, __LINE__);
                // Is "what" valid?
                if (SQL_NUMROWS($result) == 1) $ret = true;
                SQL_FREERESULT($result);
@@ -1059,15 +1059,15 @@ function REMOVE_RECEIVER(&$ARRAY, $key, $uid, $pool_id, $stats_id="", $bonus=fal
                if ($stats_id > 0)
                {
                        // Only when we got a real stats ID continue searching for the entry
-                       $TYPE = "NORMAL"; $ROW = "stats_id";
-                       if ($bonus) { $TYPE = "BONUS"; $ROW = "bonus_id"; }
+                       $type = "NORMAL"; $ROW = "stats_id";
+                       if ($bonus) { $type = "BONUS"; $ROW = "bonus_id"; }
                        $result = SQL_QUERY_ESC("SELECT id FROM "._MYSQL_PREFIX."_user_links WHERE %s='%s' AND userid=%d AND link_type='%s' LIMIT 1",
-                        array($ROW, $stats_id, bigintval($uid), $TYPE), __FILE__, __LINE__);
+                        array($ROW, $stats_id, bigintval($uid), $type), __FILE__, __LINE__);
                        if (SQL_NUMROWS($result) == 0)
                        {
                                // No, so we add one!
                                $result = SQL_QUERY_ESC("INSERT INTO "._MYSQL_PREFIX."_user_links (%s, userid, link_type) VALUES ('%s', '%s', '%s')",
-                                array($ROW, $stats_id, bigintval($uid), $TYPE), __FILE__, __LINE__);
+                                array($ROW, $stats_id, bigintval($uid), $type), __FILE__, __LINE__);
                                $ret = "done";
                        }
                         else
@@ -1084,24 +1084,24 @@ function REMOVE_RECEIVER(&$ARRAY, $key, $uid, $pool_id, $stats_id="", $bonus=fal
        return $ret;
 }
 //
-function GET_TOTAL_DATA($SEARCH, $TABLE, $DATA, $WHERE="userid", $ONLY_ROWS=false)
+function GET_TOTAL_DATA($search, $TABLE, $DATA, $WHERE="userid", $ONLY_ROWS=false)
 {
        $ret = "0";
        if ($ONLY_ROWS)
        {
                // Count rows
                $result = SQL_QUERY_ESC("SELECT COUNT(%s) FROM "._MYSQL_PREFIX."_%s WHERE %s='%s'",
-                array($DATA, $TABLE, $WHERE, $SEARCH), __FILE__, __LINE__);
+                array($DATA, $TABLE, $WHERE, $search), __FILE__, __LINE__);
        }
         else
        {
                // Add all rows
                $result = SQL_QUERY_ESC("SELECT SUM(%s) FROM "._MYSQL_PREFIX."_%s WHERE %s='%s'",
-                array($DATA, $TABLE, $WHERE, $SEARCH), __FILE__, __LINE__);
+                array($DATA, $TABLE, $WHERE, $search), __FILE__, __LINE__);
        }
        // Load row
        list($ret) = SQL_FETCHROW($result);
-       //* DEBUG: */ echo __LINE__."*".$DATA."/".$SEARCH."/".$TABLE."/".$ret."*<br />\n";
+       //* DEBUG: */ echo __LINE__."*".$DATA."/".$search."/".$TABLE."/".$ret."*<br />\n";
        SQL_FREERESULT($result);
        if (empty($ret)) {
                if (($DATA == "counter") || ($DATA == "id")) {
index b268fa8..babf54f 100644 (file)
@@ -76,14 +76,14 @@ if (defined('mxchange_installed') && (mxchange_installed))
                        // Normal-Mails
                        $result = SQL_QUERY_ESC("SELECT link_type FROM "._MYSQL_PREFIX."_user_links WHERE stats_id=%d AND userid=%d LIMIT 1",
                         array($url_mid, $url_uid), __FILE__, __LINE__);
-                       $TYPE = "mailid"; $DATA = $url_mid;
+                       $type = "mailid"; $DATA = $url_mid;
                }
                 elseif ($url_bid > 0)
                {
                        // Bonus-Mail
                        $result = SQL_QUERY_ESC("SELECT link_type FROM "._MYSQL_PREFIX."_user_links WHERE bonus_id=%d AND userid=%d LIMIT 1",
                         array($url_bid, $url_uid), __FILE__, __LINE__);
-                       $TYPE = "bonusid"; $DATA = $url_bid;
+                       $type = "bonusid"; $DATA = $url_bid;
                }
                 else
                {
@@ -92,7 +92,10 @@ if (defined('mxchange_installed') && (mxchange_installed))
                }
                if (SQL_NUMROWS($result) == 1)
                {
+                       // Load the entry
                        list($ltype) = SQL_FETCHROW($result);
+
+                       // Clean result
                        SQL_FREERESULT($result);
                        switch ($ltype)
                        {
@@ -165,7 +168,7 @@ if (defined('mxchange_installed') && (mxchange_installed))
                                                                // He can confirm this mail!
                                                                // Export data into constants for the template
                                                                define('_UID_VALUE' , $url_uid);
-                                                               define('_TYPE_VALUE', $TYPE);
+                                                               define('_TYPE_VALUE', $type);
                                                                define('_DATA_VALUE', $DATA);
                                                                define('_URL_VALUE' , DEREFERER($URL));
 
index efeb5ec..a3f52f3 100644 (file)
@@ -72,13 +72,13 @@ if (defined('mxchange_installed') && (mxchange_installed))
                {
                        $result = SQL_QUERY_ESC("SELECT id, link_type FROM "._MYSQL_PREFIX."_user_links WHERE stats_id=%d AND userid=%d LIMIT 1",
                         array($url_mid, $url_uid), __FILE__, __LINE__);
-                       $TYPE = "mailid"; $DATA = $url_mid;
+                       $type = "mailid"; $DATA = $url_mid;
                }
                 elseif ($url_bid > 0)
                {
                        $result = SQL_QUERY_ESC("SELECT id, link_type FROM "._MYSQL_PREFIX."_user_links WHERE bonus_id=%d AND userid=%d LIMIT 1",
                         array($url_bid, $url_uid), __FILE__, __LINE__);
-                       $TYPE = "bonusid"; $DATA = $url_bid;
+                       $type = "bonusid"; $DATA = $url_bid;
                }
                if (SQL_NUMROWS($result) == 1)
                {
@@ -244,13 +244,13 @@ if (defined('mxchange_installed') && (mxchange_installed))
                                                                                                if (((($CONFIG['bonus_uid'] == $url_uid) && ($CONFIG['bonus_include_own'] == 'Y')) || ($CONFIG['bonus_uid'] != $url_uid)) && ($CONFIG['def_refid'] != $url_uid))
                                                                                                {
                                                                                                        // Add points and remember ranking are done in this function....
-                                                                                                       BONUS_ADD_TURBO_POINTS($DATA, $url_uid, $TYPE);
+                                                                                                       BONUS_ADD_TURBO_POINTS($DATA, $url_uid, $type);
 
                                                                                                        // Set template to mailid_points_done2 which contains a link to the ranking list
                                                                                                        $template = "mailid_points_done2";
                                                                                                        if ($locked) $template = "mailid_points_locked2";
                                                                                                        define('_UID_VALUE' , $url_uid);
-                                                                                                       define('_TYPE_VALUE', $TYPE);
+                                                                                                       define('_TYPE_VALUE', $type);
                                                                                                        define('_DATA_VALUE', TRANSLATE_COMMA($DATA));
                                                                                                }
                                                                                        }
@@ -293,13 +293,13 @@ if (defined('mxchange_installed') && (mxchange_installed))
                                                                                // Export data into constants for the template
                                                                                define('_CODE_VALUE', $code);
                                                                                define('_UID_VALUE' , $url_uid );
-                                                                               define('_TYPE_VALUE', $TYPE);
+                                                                               define('_TYPE_VALUE', $type);
                                                                                define('_DATA_VALUE', $DATA);
                                                                                define('_TEMPLATE_BANNER', LOAD_TEMPLATE("mailid_banner", true));
                                                                                if ($CONFIG['code_length'] > 0)
                                                                                {
                                                                                        // Generate Code
-                                                                                       define('_IMAGE_CODE', IMG_CODE($code, $TYPE, $DATA, $url_uid));
+                                                                                       define('_IMAGE_CODE', IMG_CODE($code, $type, $DATA, $url_uid));
                                                                                        $templ = "mailid_enter_code";
                                                                                }
                                                                                 else
@@ -320,7 +320,7 @@ if (defined('mxchange_installed') && (mxchange_installed))
                                                                        define('_TIME_VALUE', $time);
                                                                        define('_TIM2_VALUE', strlen($time));
                                                                        define('_UID_VALUE' , $url_uid );
-                                                                       define('_TYPE_VALUE', $TYPE);
+                                                                       define('_TYPE_VALUE', $type);
                                                                        define('_DATA_VALUE', $DATA);
                                                                        define('_RAND_VALUE', rand(0, 99999));
                                                                        define('_TEMPLATE_BANNER', LOAD_TEMPLATE("mailid_banner", true));