Fixes for a lot bug tickets. (Sorry for lame comment)
authorRoland Häder <roland@mxchange.org>
Fri, 6 Feb 2009 01:02:50 +0000 (01:02 +0000)
committerRoland Häder <roland@mxchange.org>
Fri, 6 Feb 2009 01:02:50 +0000 (01:02 +0000)
20 files changed:
doubler.php
inc/databases.php
inc/functions.php
inc/language/de.php
inc/libs/doubler_functions.php
inc/libs/rallye_functions.php
inc/libs/theme_functions.php
inc/modules/admin/overview-inc.php
inc/modules/admin/what-admins_mails.php
inc/modules/admin/what-config_payouts.php
inc/modules/admin/what-config_points.php
inc/modules/admin/what-guest_add.php
inc/modules/admin/what-list_country.php
inc/modules/admin/what-list_links.php
inc/modules/admin/what-logs.php
inc/modules/admin/what-theme_check.php
inc/modules/guest/what-register.php
inc/modules/member/what-doubler.php
inc/modules/member/what-reflinks.php
inc/mysql-manager.php

index d002ed7c2869c2637f5ccb4cc0ad84a2c14a7a28..09d00fba02e5c7bab6c2772547509a44fb2a52e2 100644 (file)
@@ -133,8 +133,7 @@ if (isBooleanConstantAndTrue('mxchange_installed')) {
                                $points = GET_TOTAL_DATA($uid, "user_points", "points") - GET_TOTAL_DATA($uid, "user_data", "used_points");
 
                                // So let's continue with probing his points amount
-                               if (($points - getConfig('doubler_left') - $_POST['points'] * getConfig('doubler_charge')) >= 0)
-                               {
+                               if (($points - getConfig('doubler_left') - $_POST['points'] * getConfig('doubler_charge')) >= 0) 
                                        // Enough points are left so let's continue with the doubling process
                                        // Create doubling "account" width *DOUBLED* points
                                        SQL_QUERY_ESC("INSERT INTO "._MYSQL_PREFIX."_doubler (userid, refid, points, remote_ip, timemark, completed, is_ref) VALUES ('%s','%s','%s','".GET_REMOTE_ADDR()."', UNIX_TIMESTAMP(), 'N','N')",
@@ -146,15 +145,18 @@ if (isBooleanConstantAndTrue('mxchange_installed')) {
                                        // Add points to "total payed" including charge
                                        $points = $_POST['points'] - $_POST['points'] * getConfig('doubler_charge');
                                        UPDATE_CONFIG("doubler_points", $points, "+");
-                                       getConfig('doubler_points') += $points;
+                                       incrementConfigEntry('doubler_points', $points);
 
                                        // Add second line for the referal but only when uid != refid
                                        if (($GLOBALS['refid'] > 0) && ($GLOBALS['refid'] != $uid)) {
                                                // Okay add a refid line and apply refid percents
-                                               SQL_QUERY_ESC("INSERT INTO "._MYSQL_PREFIX."_doubler (userid,refid,points,remote_ip,timemark,completed,is_ref) VALUES ('%s',0,'%s','".GET_REMOTE_ADDR()."',UNIX_TIMESTAMP(),'N','Y')",
-                                                       array(bigintval($GLOBALS['refid']), bigintval($_POST['points'] * 2 * getConfig('doubler_ref'))), __FILE__, __LINE__);
+                                               SQL_QUERY_ESC("INSERT INTO "._MYSQL_PREFIX."_doubler (userid, refid, points, remote_ip, timemark, completed, is_ref) VALUES ('%s',0,'%s','".GET_REMOTE_ADDR()."',UNIX_TIMESTAMP(),'N','Y')",
+                                                       array(
+                                                               bigintval($GLOBALS['refid']),
+                                                               bigintval($_POST['points'] * 2 * getConfig('doubler_ref'))
+                                                       ), __FILE__, __LINE__);
 
-                                               // And that's why we dont't want to you more than one referal level of doubler-points. ^^^
+                                               // And that's why we don't want to you more than one referal level of doubler-points. ^^^
                                        } // END - if
 
                                        // Update usage counter
index 102ac3ed94e0b6446d0ef8a0d212a91bc514bc29..946addc2bd561cbc213843ea043595add431df5a 100644 (file)
@@ -115,7 +115,7 @@ define('USAGE_BASE', "usage");
 define('SERVER_URL', "http://www.mxchange.org");
 
 // Current SVN revision
-define('CURR_SVN_REVISION', "708");
+define('CURR_SVN_REVISION', "709");
 
 // Take a prime number which is long (if you know a longer one please try it out!)
 define('_PRIME', 591623);
index d47a72123e24a3c1da5190d1b5be9f351e006c39..fd8b2c5a9074c4fd388e3bb1999e6ed4f35ade1c 100644 (file)
@@ -2593,6 +2593,7 @@ function REVERT_COMMA ($str) {
        // Return float
        return $float;
 }
+
 // Handle menu-depending failed logins and return the rendered content
 function HANDLE_LOGIN_FAILTURES ($accessLevel) {
        // Default output is empty ;-)
@@ -2621,6 +2622,7 @@ function HANDLE_LOGIN_FAILTURES ($accessLevel) {
        // Return rendered content
        return $OUT;
 }
+
 // Rebuild cache
 function REBUILD_CACHE ($cache, $inc="") {
        global $cacheInstance, $CSS;
@@ -2650,6 +2652,7 @@ function REBUILD_CACHE ($cache, $inc="") {
                } // END - if
        } // END - if
 }
+
 // Purge admin menu cache
 function CACHE_PURGE_ADMIN_MENU ($id=0, $action="", $what="", $str="") {
        global $cacheInstance;
@@ -2668,8 +2671,9 @@ function CACHE_PURGE_ADMIN_MENU ($id=0, $action="", $what="", $str="") {
        }
 
        // Experiemental feature!
-       trigger_error("You have to delete the admin_*.cache files by yourself at this point.");
+       trigger_error("<strong>Experimental feature:</strong> You have to delete the admin_*.cache files by yourself at this point.");
 }
+
 // Translates the "pool type" into human-readable
 function TRANSLATE_POOL_TYPE ($type) {
        // Default type is unknown
@@ -2687,6 +2691,7 @@ function TRANSLATE_POOL_TYPE ($type) {
        // Return "translation"
        return $translated;
 }
+
 // "Getter" for remote IP number
 function GET_REMOTE_ADDR () {
        // Get remote ip from environment
@@ -2973,12 +2978,16 @@ function THEME_GET_ID ($name) {
        return $id;
 }
 
-// Increment or init with 1 the given config entry
-function incrementConfigEntry ($configEntry) {
+// Increment or init with given value or 1 as default the given config entry
+function incrementConfigEntry ($configEntry, $value=1) {
        global $_CONFIG;
 
        // Increment it if set or init it with 1
-       if (getConfig($configEntry) > 0) { $_CONFIG[$configEntry]++; } else { $_CONFIG[$configEntry] = 1; }
+       if (getConfig($configEntry) > 0) {
+               $_CONFIG[$configEntry] += $value;
+       } else {
+               $_CONFIG[$configEntry] = $value;
+       }
 }
 
 //////////////////////////////////////////////////
index 27bd47a004edc5113f747c4bf2b89c4158503716..1ad3693be51abae639a5c237014a5a397cfb2b02 100644 (file)
@@ -583,6 +583,7 @@ define('MEMBER_COOKIES_DISABLED', "Kann nicht einloggen, da Cookies bei Ihnen de
 define('ADMIN_DEL_COMPLETED', "Account wurde gel&ouml;scht! Die {!POINTS!} werden immer in den Jackpot transferiert!");
 define('NORMAL_MAIL_PROBLEM', "Mail vom Mitgliedern bereits gel&ouml;scht");
 define('BONUS_MAIL_PROBLEM', "Bonus-Mail bereits gel&ouml;scht");
+define('GENERAL_MAIL_PROBLEM', "BUG! BUG! Bitte reporten auf <a href=\"http://bugs.mxchange.org/\" target=\"_blank\" title=\"Link zum MXChange Bug-Tracker\">bugs.mxchange.org</a>.");
 define('MEMBER_BACK_JACKPOT', "{!POINTS!}-Rueckgutschrift");
 define('ADMIN_BACK_JACKPOT', "{!POINTS!}-Aufbuchung fuer Jackpot");
 define('MEDIA_DATA', "Mediendaten");
@@ -697,10 +698,11 @@ define('_ALL2', "Alle");
 define('WE_HAVE', "Wir haben");
 define('MEMBER_TEST_URL', "Zur beworbenen Seite");
 define('ADMIN_LOGS_DIR_404_1', "Das Verzeichnis mit den Zugriffslogb&uuml;chern konnte nicht gefunden werden! (<strong>");
-define('ADMIN_LOGS_DIR_404_2', "</strong>)");
+define('ADMIN_LOGS_DIR_404_2', "</strong>) Vermutlich unterst&uuml;tzt Ihr Server dieses nicht.");
 define('ADMIN_USAGE_DIR_404_1', "Das Verzeichnis mit den Webalizer-Statistiken konnte nicht gefunden werden! (<strong>");
-define('ADMIN_USAGE_DIR_404_2', "</strong>)");
+define('ADMIN_USAGE_DIR_404_2', "</strong>) Vermutlich unterst&uuml;tzt Ihr Server dieses nicht.");
 define('ADMIN_ENTER_REDIRECT_URL', "URL eingeben, wenn abgelehnt werden soll");
+define('MEMBER_NO_REFBANNER_FOUND', "Es sind noch keine Werbebanner eingerichtet worden. Bitte verwende solange deinen Referal-Link.");
 define('ADMIN_ID_404_1', "ID <strong>");
 define('ADMIN_ID_404_2', "</strong> nicht gefunden!");
 define('ADMIN_ASSIGNED_ADMIN', "Zugewiesener Admin-Login");
@@ -1247,5 +1249,10 @@ define('FILTER_FAILED_NO_FILTER_FOUND', "Die Filterkette <u>%s</u> konnte nicht
 define('FILTER_FAILED_NOT_REMOVED', "Die Filterfunktion <u>%s</u> konnte nicht aus der Filterkette <u>%s</u> entfernt werden, da sie nicht existiert.");
 define('FILTER_FLUSH_FAILED_NO_DATABASE', "Kann die Filterketten nicht speichern. Datenbank fehlt!");
 
+// Status changes
+define('ADMIN_STATUS_CHANGED_1', "Es wurden <u>");
+define('ADMIN_STATUS_CHANGED_2', "</u> von <u>");
+define('ADMIN_STATUS_CHANGED_3', "</u> Eintr&auml;gen ge&auml;ndert.");
+
 //
 ?>
index d2476e79274c27abc73ad63d27353c6221cd16fd..a5379614c2c39ebaec4b69ac0a8b0107a7a05767 100644 (file)
@@ -37,8 +37,9 @@ if (!defined('__SECURITY')) {
        require($INC);
 }
 
-//
-function DOUBLER_GENERATE_TABLE($uid="0", $done='N', $ref='N', $sort="ASC") {
+// Generates a HTML table baded on given data
+// @TODO Lame description!
+function DOUBLER_GENERATE_TABLE ($uid="0", $done='N', $ref='N', $sort="ASC") {
        global $_CONFIG;
        if (empty($cnt)) $cnt = 0;
        $ADD = ""; $DT_MODE = 0;
index ac949d0a89c00c066eaf14cc0960fad83b363fa7..08e8cf341bb85762b7863687eec7111e746e4256 100644 (file)
@@ -511,9 +511,9 @@ function RALLYE_LOAD_PRICES_ARRAY($rallye)
        // Return array
        return $prices;
 }
+
 //
-function RALLYE_LOAD_USERS_ARRAY($rallye)
-{
+function RALLYE_LOAD_USERS_ARRAY ($rallye) {
        global $_CONFIG;
 
        // Fix zero points to 0.00000
@@ -528,9 +528,8 @@ function RALLYE_LOAD_USERS_ARRAY($rallye)
 
        // 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))
-       {
+               array(bigintval($rallye)), __FILE__, __LINE__);
+       while (list($uid, $refs, $cpoints) = SQL_FETCHROW($result_user)) {
                // Load current ref count
                $cnt = RALLYE_GET_REFCOUNT($uid, $refs);
 
@@ -562,21 +561,23 @@ WHERE d.status='CONFIRMED' AND d.max_mails > 0 AND d.mails_confirmed >= %s AND p
        $prices = RALLYE_LOAD_PRICES_ARRAY($rallye);
 
        // Merge users into prices
-       foreach ($prices['level'] as $k => $lvl)
-       {
-               $prices['uid'][$k]  = $users['uid'][$k];
-               if (empty($prices['uid'][$k])) $prices['uid'][$k]  = "---";
-               $prices['ref'][$k] = $users['ref'][$k];
-               if (empty($prices['ref'][$k])) $prices['ref'][$k] = "---";
-               $prices['cpoints'][$k] = $users['cpoints'][$k];
-       }
+       foreach ($prices['level'] as $k => $lvl) {
+               // We only need to check one element in $users, see above while() block
+               if (isset($users['uid'][$k])) {
+                       $prices['uid'][$k]  = $users['uid'][$k];
+                       if (empty($prices['uid'][$k])) $prices['uid'][$k]  = "---";
+                       $prices['ref'][$k] = $users['ref'][$k];
+                       if (empty($prices['ref'][$k])) $prices['ref'][$k] = "---";
+                       $prices['cpoints'][$k] = $users['cpoints'][$k];
+               } // END - if
+       } // END - foreach
 
        // Return completed array
        return $prices;
 }
+
 //
-function RALLYE_LIST_WINNERS($rallye,$default=0)
-{
+function RALLYE_LIST_WINNERS ($rallye, $default=0) {
        // First check how many prices are set
        $result_prices = SQL_QUERY_ESC("SELECT id FROM "._MYSQL_PREFIX."_rallye_prices WHERE rallye_id=%s ORDER BY price_level",
         array(bigintval($rallye)), __FILE__, __LINE__);
index 0169427c732fbd194ce85e069fa677035cfd0a5d..31ec274cca32e60bd48b8738b12f12416b06f066 100644 (file)
@@ -86,11 +86,11 @@ function THEME_GET_VERSION ($name) {
        // Is the extension "theme" installed?
        if (!EXT_IS_ACTIVE("theme")) {
                // Then abort here
-               return "0.0";
+               return "!.!";
        } // END - if
 
        // Default version "number"
-       $cver = "-.-";
+       $cver = "?.?";
 
        // Is the cache entry there?
        if (isset($cacheArray['themes']['theme_ver'][$name])) {
index 65432430c4508356a5dc07e2826e8330ef56ddf0..ee772bbdb7c975523e348fe13cadaf4eac3bce22 100644 (file)
@@ -117,13 +117,13 @@ ORDER BY userid DESC, task_type DESC, subject, task_created DESC",
        return $JOBS_DONE;
 }
 
-//
-function OUTPUT_SELECTED_TASKS($_POST, $result_tasks) {
+// Outputs selected tasks
+function OUTPUT_SELECTED_TASKS ($POST, $result_tasks) {
        global $_CONFIG, $NOTES;
-       if ((isset($_POST['assign'])) && (count($_POST['task']) > 0)) {
+       if ((isset($POST['assign'])) && (count($POST['task']) > 0)) {
                // Assign / do tasks
                $OUT = ""; $SW = 2;
-               foreach ($_POST['task'] as $id => $sel) {
+               foreach ($POST['task'] as $id => $sel) {
                        $result_task = SQL_QUERY_ESC("SELECT id, userid, task_type, subject, text, task_created, status, assigned_admin FROM "._MYSQL_PREFIX."_task_system WHERE id=%s AND (assigned_admin='%s' OR (assigned_admin='0' AND status='NEW')) LIMIT 1",
                                array(bigintval($id), GET_CURRENT_ADMIN_ID()), __FILE__, __LINE__);
                        if (SQL_NUMROWS($result_task) == 1) {
@@ -244,12 +244,13 @@ function OUTPUT_SELECTED_TASKS($_POST, $result_tasks) {
 
                                                // Close task but not already closes or deleted or update tasks
                                                if (($status != "CLOSED") && ($status != "DELETED") && ($type != "EXTENSION_UPDATE")) {
+                                                       // Solve the task
                                                        RUN_FILTER('solve_task', $tid);
                                                } // END - if
                                        }
                                        break;
 
-                               case "EXTENSION_UPDATE":
+                               case "EXTENSION_UPDATE": // Extension update
                                        // Extension updates are installed automatically
                                        $OUT .= "<FONT class=\"admin_failed medium\">".ADMIN_EXTENSION_UPDATED."</FONT>\n";
 
@@ -274,7 +275,7 @@ function OUTPUT_SELECTED_TASKS($_POST, $result_tasks) {
                                        if (EXT_IS_ACTIVE("payout")) {
                                                // Extension is installed so let him send a notification to the user
                                                $result_pay = SQL_QUERY_ESC("SELECT id FROM "._MYSQL_PREFIX."_user_payouts WHERE userid=%s AND payout_timestamp=%s LIMIT 1",
-                                                array(bigintval($uid), bigintval($created)), __FILE__, __LINE__);
+                                                       array(bigintval($uid), bigintval($created)), __FILE__, __LINE__);
                                                list($pid) = SQL_FETCHROW($result_pay);
                                                SQL_FREERESULT($result_pay);
 
@@ -359,17 +360,17 @@ function OUTPUT_SELECTED_TASKS($_POST, $result_tasks) {
                // Load final template
                LOAD_TEMPLATE("admin_overview_list");
        } else {
-               if ((isset($_POST['task'])) && ((sizeof($_POST['task']) > 0) || ($_POST['task'][0] == "1"))) {
+               if ((isset($POST['task'])) && ((sizeof($POST['task']) > 0) || ($POST['task'][0] == "1"))) {
                        // Only unassign / delete tasks when there are selected tasks posted
-                       if (!empty($_POST['unassign'])) {
+                       if (!empty($POST['unassign'])) {
                                // Unassign from tasks
-                               foreach ($_POST['task'] as $id => $sel) {
+                               foreach ($POST['task'] as $id => $sel) {
                                        SQL_QUERY_ESC("UPDATE "._MYSQL_PREFIX."_task_system SET assigned_admin=0 WHERE id=%s AND assigned_admin=%s LIMIT 1",
                                                array(bigintval($id), GET_CURRENT_ADMIN_ID()), __FILE__, __LINE__);
                                }
-                       } elseif (isset($_POST['del'])) {
+                       } elseif (isset($POST['del'])) {
                                // Delete tasks
-                               foreach ($_POST['task'] as $id => $sel) {
+                               foreach ($POST['task'] as $id => $sel) {
                                        SQL_QUERY_ESC("DELETE LOW_PRIORITY FROM "._MYSQL_PREFIX."_task_system WHERE id=%s AND assigned_admin IN (%s,0) LIMIT 1",
                                                array(bigintval($id), GET_CURRENT_ADMIN_ID()), __FILE__, __LINE__);
                                }
index 6c985fccc3fe9312e35a8c02ad979e62de2c6b5c..f1402e741057b86eaef6e53deeb5c20528e93346 100644 (file)
@@ -171,6 +171,7 @@ ORDER BY m.admin_id, m.mail_template", __FILE__, __LINE__);
                        }
                        $content = array(
                                'sw'   => $SW,
+                               'id'   => $id,
                                'tpl'  => $templ,
                                'alnk' => $admin_link
                        );
index 98ca6cb4e367d9fcd5e13d9dde71facce052694a..83ffcc92265422bbaabbd54887070153749c9750 100644 (file)
@@ -42,13 +42,11 @@ ADD_DESCR("admin", __FILE__);
 
 if (!empty($_POST['rate'])) $_POST['rate'] = REVERT_COMMA($_POST['rate']);
 
-if ((isset($_POST['add'])) && (!empty($_POST['title'])) && ($_POST['rate'] > 0))
-{
+if ((isset($_POST['add'])) && (!empty($_POST['title'])) && ($_POST['rate'] > 0)) {
        // Add new payout type
        $result = SQL_QUERY_ESC("SELECT id FROM "._MYSQL_PREFIX."_payout_types WHERE type='%s' LIMIT 1",
-        array($_POST['title']), __FILE__, __LINE__);
-       if (SQL_NUMROWS($result) == 0)
-       {
+               array($_POST['title']), __FILE__, __LINE__);
+       if (SQL_NUMROWS($result) == 0) {
                // Add now
                SQL_QUERY_ESC("INSERT INTO "._MYSQL_PREFIX."_payout_types
 (type, rate, min_points, from_account, from_pass, engine_url, engine_ret_ok, engine_ret_failed, pass_enc, allow_url)
@@ -65,15 +63,13 @@ VALUES ('%s', %d, %d,'%s','%s','%s','%s','%s','%s','%s')",
        $_POST['ytrans'],
        $_POST['allow_url'],
 ), __FILE__, __LINE__);
-               $msg = "<FONT class=\"admin_done\">".ADMIN_PAYOUT_TYPE_ADDED."</FONT>";
-       }
-        else
-       {
+               $msg = "<div class=\"admin_done\">".ADMIN_PAYOUT_TYPE_ADDED."</div>";
+       } else {
                // Free memory
                SQL_FREERESULT($result);
 
                // Does already exist
-               $msg = "<FONT class=\"admin_failed\">".ADMIN_PAYOUT_TYPE_ALREADY."</FONT>";
+               $msg = "<div class=\"admin_failed\">".ADMIN_PAYOUT_TYPE_ALREADY."</div>";
        }
 }
 
@@ -81,20 +77,16 @@ VALUES ('%s', %d, %d,'%s','%s','%s','%s','%s','%s','%s')",
 $result_mem = SQL_QUERY("SELECT id FROM "._MYSQL_PREFIX."_user_payouts WHERE status='NEW' ORDER BY payout_timestamp DESC", __FILE__, __LINE__);
 
 $display = true;
-if ((isset($_POST['edit'])) && (SELECTION_COUNT($_POST['sel']) > 0))
-{
+if ((isset($_POST['edit'])) && (SELECTION_COUNT($_POST['sel']) > 0)) {
        // Edit payout types
-       if ((isset($_GET['ok'])) && ($_GET['ok'] == "ok"))
-       {
+       if ((isset($_GET['ok'])) && ($_GET['ok'] == "ok")) {
                // Edit entries
-               foreach ($_POST['sel'] as $id => $sel)
-               {
+               foreach ($_POST['sel'] as $id => $sel) {
                        // Secure ID
                        $id = bigintval($id);
 
                        // Edit only if something is entered
-                       if ((!empty($_POST['title'][$id])) && ($_POST['rate'][$id] > 0))
-                       {
+                       if ((!empty($_POST['title'][$id])) && ($_POST['rate'][$id] > 0)) {
                                // Update entry
                                SQL_QUERY_ESC("UPDATE "._MYSQL_PREFIX."_payout_types SET
 type='%s',
@@ -111,13 +103,10 @@ WHERE id='".$id."' LIMIT 1",
                        }
                }
                $msg = ADMIN_PAYOUT_ENTRIES_CHANGED;
-       }
-        else
-       {
+       } else {
                $display = false; //Suppress any other outputs
                $SW = 2; $OUT = "";
-               foreach ($_POST['sel'] as $id => $sel)
-               {
+               foreach ($_POST['sel'] as $id => $sel) {
                        // Load data
                        $result = SQL_QUERY_ESC("SELECT type, rate, min_points, allow_url FROM "._MYSQL_PREFIX."_payout_types WHERE id=%s LIMIT 1",
                         array(bigintval($id)), __FILE__, __LINE__);
@@ -143,26 +132,19 @@ WHERE id='".$id."' LIMIT 1",
                // Load main template
                LOAD_TEMPLATE("admin_config_payouts_edit");
        }
-}
- elseif ((isset($_POST['del'])) && (SELECTION_COUNT($_POST['sel']) > 0))
-{
+} elseif ((isset($_POST['del'])) && (SELECTION_COUNT($_POST['sel']) > 0)) {
        // Delete payout types
-       if ($_GET['ok'] == "ok")
-       {
+       if ((isset($_GET['ok'])) && ($_GET['ok'] == "ok")) {
                // Delete entries
-               foreach ($_POST['sel'] as $id => $sel)
-               {
+               foreach ($_POST['sel'] as $id => $sel) {
                        SQL_QUERY_ESC("DELETE LOW_PRIORITY FROM "._MYSQL_PREFIX."_payout_types WHERE id=%s LIMIT 1",
                                array(bigintval($id)), __FILE__, __LINE__);
                }
                $msg = ADMIN_PAYOUT_ENTRIES_DELETED;
-       }
-        else
-       {
+       } else {
                $display = false; //Suppress any other outputs
                $SW = 2; $OUT = "";
-               foreach ($_POST['sel'] as $id => $sel)
-               {
+               foreach ($_POST['sel'] as $id => $sel) {
                        // Secure ID number
                        $id = bigintval($id);
 
@@ -192,8 +174,7 @@ WHERE id='".$id."' LIMIT 1",
        }
 }
 
-if (!empty($msg))
-{
+if (!empty($msg)) {
        // Output message
        LOAD_TEMPLATE("admin_settings_saved", false, $msg);
 }
@@ -201,12 +182,10 @@ if (!empty($msg))
 // Payout types
 $result_type = SQL_QUERY("SELECT id, type, rate, min_points, from_account FROM "._MYSQL_PREFIX."_payout_types ORDER BY type", __FILE__, __LINE__);
 
-if ((SQL_NUMROWS($result_type) > 0) && ($display))
-{
+if ((SQL_NUMROWS($result_type) > 0) && ($display)) {
        // List all payout types
        $SW = 2; $OUT = "";
-       while (list($id, $type, $rate, $mpoi, $from) = SQL_FETCHROW($result_type))
-       {
+       while (list($id, $type, $rate, $mpoi, $from) = SQL_FETCHROW($result_type)) {
                // Prepare data for the row template
                $content = array(
                        'sw'    => $SW,
@@ -231,17 +210,15 @@ if ((SQL_NUMROWS($result_type) > 0) && ($display))
 }
 
 // Does your members request payouts?
-if ((SQL_NUMROWS($result_mem) > 0) && ($display))
-{
+if ((SQL_NUMROWS($result_mem) > 0) && ($display)) {
        // Members has requested payouts
        SQL_FREERESULT($result_mem);
        OUTPUT_HTML("<P><A href=\"".URL."/modules.php?module=admin&amp;what=list_payouts\">".ADMIN_PAYOUT_LIST_REQUESTS."</A></P>");
-}
- elseif ($display)
-{
+} elseif ($display) {
        // No member requests so far
        OUTPUT_HTML("<P><STRONG>".ADMIN_PAYOUT_NO_MEMBER_REQUESTS."</STRONG></P>");
 }
+
 // Add new paypout type
 if ($display) LOAD_TEMPLATE("admin_payout_add_new");
 
index 9af8f84fb0f098d961f4e996ea61f65bf870f721..f874710e81e8ac7a640a4d53d57c6abec2c86223 100644 (file)
@@ -184,7 +184,7 @@ WHERE mails_confirmed < %s", $REF, $REF);
        // Load template
        LOAD_TEMPLATE("admin_config_point_settings");
 } elseif ($_GET['sub'] == "ref") {
-       if ((isset($_POST['del'])) && ((SELECTION_COUNT($_POST['sel']) > 0) || (isset($_POST['sel'][0])))) {
+       if ((isset($_POST['del'])) && (isset($_POST['sel'])) && ((SELECTION_COUNT($_POST['sel']) > 0) || (isset($_POST['sel'][0])))) {
                // Delete entries
                $SW = 2; $OUT = "";
                foreach ($_POST['sel'] as $id => $value) {
@@ -209,7 +209,7 @@ WHERE mails_confirmed < %s", $REF, $REF);
 
                // Load main template
                LOAD_TEMPLATE("admin_points_del");
-       } elseif ((isset($_POST['edit'])) && ((SELECTION_COUNT($_POST['sel']) > 0) || (isset($_POST['sel'][0])))) {
+       } elseif ((isset($_POST['edit'])) && (isset($_POST['sel'])) && ((SELECTION_COUNT($_POST['sel']) > 0) || (isset($_POST['sel'][0])))) {
                // Edit entries
                $SW = 2; $OUT = "";
                foreach ($_POST['sel'] as $id => $value) {
index f4c75d15abee9ec5d875c6f6e247dec381f0fcac..0cc22e2bb3d3ec930cf14dd190db8470235b5ced 100644 (file)
@@ -41,23 +41,19 @@ if ((!defined('__SECURITY')) || (!IS_ADMIN())) {
 ADD_DESCR("admin", __FILE__);
 
 // Check if the admin has entered title and what-php file name...
-if (((empty($_POST['title'])) || (empty($_POST['menu']))) && (isset($_POST['ok'])))
-{
+if (((empty($_POST['title'])) || (empty($_POST['menu']))) && (isset($_POST['ok'])) {
        unset($_POST['ok']);
 }
 
-if (!isset($_POST['ok']))
-{
+if (!isset($_POST['ok'])) {
        // Create arrays
        $menus = array(); $titles = array(); $below = array();
 
        // Get all available main menus
        $result = SQL_QUERY("SELECT action, title, sort FROM `"._MYSQL_PREFIX."_guest_menu` WHERE (what='' OR what IS NULL) ORDER BY sort", __FILE__, __LINE__);
-       if (SQL_NUMROWS($result) > 0)
-       {
+       if (SQL_NUMROWS($result) > 0) {
                // Read menu structure
-               while (list($act, $title, $sort) = SQL_FETCHROW($result))
-               {
+               while (list($act, $title, $sort) = SQL_FETCHROW($result)) {
                        // Menu actions
                        $menus[] = $act;
 
@@ -73,27 +69,24 @@ if (!isset($_POST['ok']))
 
                // Remove double eintries
                $prev = ""; $dmy = $menus; $dmy2 = $titles; $dmy3 = $below;
-               foreach ($menus as $key => $value)
-               {
-                       if ($value == $prev)
-                       {
+               foreach ($menus as $key => $value) {
+                       if ($value == $prev) {
                                unset($dmy[$key]);
                                unset($dmy2[$key]);
                                unset($dmy3[$key]);
-                       }
-                        else
-                       {
+                       } else {
                                $prev = $value;
                        }
                }
+
                $menus = $dmy; $titles = $dmy2; $below = $dmy3;
+
                // Load sub menus :)
-               foreach ($menus as $key_main => $value_main)
-               {
+               foreach ($menus as $key_main => $value_main) {
                        $result = SQL_QUERY_ESC("SELECT what, title, sort
 FROM "._MYSQL_PREFIX."_guest_menu
 WHERE action='%s' AND what != '' AND what IS NOT NULL ORDER BY sort",
- array(bigintval($value_main)), __FILE__, __LINE__);
+ array($value_main), __FILE__, __LINE__);
                        if (SQL_NUMROWS($result) > 0)
                        {
                                // Initialize arrays
index 70ea85152ecca172d897b47a6783deb8f6c9782f..776b59948df438839d6a06e0080ee8f4ef698c4f 100644 (file)
@@ -41,22 +41,18 @@ if ((!defined('__SECURITY')) || (!IS_ADMIN())) {
 ADD_DESCR("admin", __FILE__);
 
 // Add new code?
-if ((isset($_POST['add'])) && (!empty($_POST['code'])) && (!empty($_POST['descr'])))
-{
+if ((isset($_POST['add'])) && (!empty($_POST['code'])) && (!empty($_POST['descr']))) {
        // Check if country code does already exist
        $result = SQL_QUERY_ESC("SELECT id FROM "._MYSQL_PREFIX."_countries WHERE code='%s' LIMIT 1",
         array(strtoupper($_POST['code'])), __FILE__, __LINE__);
-       if (SQL_NUMROWS($result) == 0)
-       {
+       if (SQL_NUMROWS($result) == 0) {
                // Save entry
                SQL_QUERY_ESC("INSERT INTO "._MYSQL_PREFIX."_countries (code, descr, is_active) VALUES ('%s','%s','%s')",
  array(strtoupper(substr($_POST['code'], 0, 2)), $_POST['descr'], $_POST['is_active']), __FILE__, __LINE__);
 
                // Country added
                $MSG = ADMIN_COUNTRY_ADDED_1.strtoupper($_POST['descr']).ADMIN_COUNTRY_ADDED_2;
-       }
-        else
-       {
+       } else {
                // Free memory
                SQL_FREERESULT($result);
 
@@ -67,20 +63,12 @@ if ((isset($_POST['add'])) && (!empty($_POST['code'])) && (!empty($_POST['descr'
        // Display message
        LOAD_TEMPLATE("admin_settings_saved", false, $MSG);
        OUTPUT_HTML("<br />");
-}
-// Change status?
- elseif ((isset($_POST['change'])) && (!empty($_POST['id'])))
-{
+} elseif ((isset($_POST['change'])) && (!empty($_POST['id']))) {
        // Change all status
        ADMIN_CHANGE_ACTIVATION_STATUS($_POST['id'], "countries", "is_active");
-}
-// Edit / delete entries?
- elseif (((isset($_POST['edit'])) || (isset($_POST['delete']))) && (!empty($_POST['id'])))
-{
-       if (count($_POST['id']) > 0)
-       {
-               if (isset($_POST['edit']))
-               {
+} elseif (((isset($_POST['edit'])) || (isset($_POST['delete']))) && (!empty($_POST['id']))) {
+       if (count($_POST['id']) > 0) {
+               if (isset($_POST['edit'])) {
                        // Edit template
                        $row    = "admin_list_country_edit_row";
                        $post   = "modify";
@@ -88,9 +76,7 @@ if ((isset($_POST['add'])) && (!empty($_POST['code'])) && (!empty($_POST['descr'
                        $submit = ADMIN_COUNTRY_EDIT_NOW;
                        $title  = ADMIN_COUNTRY_EDIT_TITLE;
                        $reset  = "<INPUT type=\"reset\" class=\"admin_reset\" value=\"".UNDO_SELECTIONS."\">&nbsp;*\n";
-               }
-                else
-               {
+               } else {
                        // Delete template
                        $row    = "admin_list_country_del_row";
                        $post   = "remove";
@@ -102,13 +88,11 @@ if ((isset($_POST['add'])) && (!empty($_POST['code'])) && (!empty($_POST['descr'
 
                // Edit all selected country codes
                $OUT = ""; $SW = 2;
-               foreach ($_POST['id'] as $id => $status)
-               {
+               foreach ($_POST['id'] as $id => $status) {
                        // Load data from DB
                        $result = SQL_QUERY_ESC("SELECT code, descr FROM "._MYSQL_PREFIX."_countries WHERE id=%s LIMIT 1",
-                        array(bigintval($id)), __FILE__, __LINE__);
-                       if (SQL_NUMROWS($result) == 1)
-                       {
+                               array(bigintval($id)), __FILE__, __LINE__);
+                       if (SQL_NUMROWS($result) == 1) {
                                // Load data
                                list($code, $descr) = SQL_FETCHROW($result);
                                SQL_FREERESULT($result);
@@ -120,16 +104,16 @@ if ((isset($_POST['add'])) && (!empty($_POST['code'])) && (!empty($_POST['descr'
                                        'descr' => $descr,
                                        'sw'    => $SW,
                                );
-                               if ($post == "modify")
-                               {
+
+                               if ($post == "modify") {
                                        // Generate default selection in edit-mode
                                        $content['status'] = ADD_OPTION_LINES("/ARRAY/", array("Y","N"), array(YES, NO ), $status);
-                               }
-                                else
-                               {
+                               } else {
                                        // Only display status when in delete-mode
                                        $content['status'] = TRANSLATE_YESNO($status);
                                }
+
+                               // Insert row template and switch color
                                $OUT .= LOAD_TEMPLATE($row, true, $content);
                                $SW = 3 - $SW;
                        }
@@ -144,37 +128,29 @@ if ((isset($_POST['add'])) && (!empty($_POST['code'])) && (!empty($_POST['descr'
                // Load main template
                LOAD_TEMPLATE("admin_list_country_form");
        }
-}
- else
-{
+} else {
        // Shall we modify / remove entries now?
        $MSG = ""; $SQLs = array();
-       if ((isset($_POST['modify'])) && (!empty($_POST['id'])))
-       {
+       if ((isset($_POST['modify'])) && (!empty($_POST['id']))) {
                // Modify
-               foreach ($_POST['id'] as $id => $sel)
-               {
+               foreach ($_POST['id'] as $id => $sel) {
                        $SQLs[] = "UPDATE "._MYSQL_PREFIX."_countries SET code='".$_POST['code'][$id]."', descr='".$_POST['descr'][$id]."', is_active='".$_POST['is_active'][$id]."' WHERE id='".$id."' LIMIT 1";
                }
 
                // Create message
                $MSG = ADMIN_COUNTRIES_MODIFIED;
-       }
-        elseif ((isset($_POST['remove'])) && (!empty($_POST['id'])))
-       {
+       } elseif ((isset($_POST['remove'])) && (!empty($_POST['id']))) {
                // Remove
-               $IDs = implode(", ", bigintval($_POST['id']));
+               $IDs = implode(", ", $_POST['id']);
                $SQLs[] = "DELETE LOW_PRIORITY FROM "._MYSQL_PREFIX."_countries WHERE id IN (".$IDs.") LIMIT ".count($_POST['id'])."";
 
                // Create message
                $MSG = ADMIN_COUNTRIES_REMOVED;
        }
 
-       if ((!empty($MSG)) && (count($SQLs) > 0))
-       {
+       if ((!empty($MSG)) && (count($SQLs) > 0)) {
                // Run SQL commands
-               foreach ($SQLs as $sql)
-               {
+               foreach ($SQLs as $sql) {
                        $result = SQL_QUERY($sql, __FILE__, __LINE__);
                }
 
@@ -185,12 +161,10 @@ if ((isset($_POST['add'])) && (!empty($_POST['code'])) && (!empty($_POST['descr'
 
        // Load currenty setup country codes to list
        $result = SQL_QUERY("SELECT id, code, descr, is_active FROM "._MYSQL_PREFIX."_countries ORDER BY code", __FILE__, __LINE__);
-       if (SQL_NUMROWS($result) > 0)
-       {
+       if (SQL_NUMROWS($result) > 0) {
                // List all countries
                $OUT = ""; $SW = 2;
-               while(list($id, $code, $descr, $active) = SQL_FETCHROW($result))
-               {
+               while(list($id, $code, $descr, $active) = SQL_FETCHROW($result)) {
                        // Prepare array for the template
                        $content = array(
                                'id'     => $id,
@@ -208,9 +182,7 @@ if ((isset($_POST['add'])) && (!empty($_POST['code'])) && (!empty($_POST['descr'
 
                // Free memory
                SQL_FREERESULT($result);
-       }
-        else
-       {
+       } else {
                // No code setup so far (not possible by this software! 'DE' for 'Deutschland' is default
                $OUT = LOAD_TEMPLATE("admin_list_country_no_row", true);
        }
index 1ea98ba5483c98563c6d563bfe19d90bc98b8edd..18848922d90c9bc32a64f4bc639ae786b32ca2a9 100644 (file)
@@ -87,23 +87,33 @@ if (!empty($_GET['u_id'])) {
                                // List all unconfirmed mails
                                $SW = 2; $OUT = "";
                                while (list($id, $id2, $type) = SQL_FETCHROW($result)) {
-                                       // Load data from stats table...
+                                       // Initializes some variables
                                        $cat = "";
+                                       $DATA = "";
+                                       $PROBLEM = GENERAL_MAIL_PROBLEM;
+                                       $result_data = false; // Closes Bug #58
+
+                                       // Load data from stats table...
                                        switch ($type)
                                        {
                                        case "NORMAL":
                                                $result_data = SQL_QUERY_ESC("SELECT subject, timestamp_ordered, cat_id FROM "._MYSQL_PREFIX."_user_stats WHERE id=%s LIMIT 1",
-                                                array(bigintval($id)), __FILE__, __LINE__);
+                                                       array(bigintval($id)), __FILE__, __LINE__);
                                                $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=%s LIMIT 1",
-                                                array(bigintval($id2)), __FILE__, __LINE__);
+                                                       array(bigintval($id2)), __FILE__, __LINE__);
                                                $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;
+
+                                       default: // Problem in application detected!
+                                               // Log the error
+                                               DEBUG_LOG(__FILE__, __LINE__, sprintf("Invalid email type %s detected.", $type));
+                                               break;
                                        }
 
                                        if (SQL_NUMROWS($result_data) == 1) {
index 14ab44f1151343e44e64cff93e56d3b5ebbec1e0..c229c552f28c4b83152ff08644d799773959f1b6 100644 (file)
@@ -86,9 +86,7 @@ if (!empty($_GET['access'])) {
                }
                @closedir($handle);
                OUTPUT_HTML("</OL>");
-       }
-        else
-       {
+       } else {
                // logs directory does not exist
                LOAD_TEMPLATE("admin_settings_saved", false, ADMIN_LOGS_DIR_404_1.LOGS_BASE.ADMIN_LOGS_DIR_404_2);
        }
index 53ef7809ca23f50bc7c6e975c54b043d3ef47c1a..e29ae53c256ba77e9725dbad4bcd165312e95101 100644 (file)
@@ -50,8 +50,7 @@ $SEL = 0;
 $response = GET_URL("check-themes.php");
 
 // Are theme_check found?
-if (($response[sizeof($response) - 1] == "[EOF]") && ($response[0] != "[EOF]"))
-{
+if (($response[sizeof($response) - 1] == "[EOF]") && ($response[0] != "[EOF]")) {
        // Ok, mark found and create the array
        $THEMES = array(
                'fname'  => array(), // File names
@@ -77,7 +76,7 @@ if (($response[sizeof($response) - 1] == "[EOF]") && ($response[0] != "[EOF]"))
                        $cver = THEME_GET_VERSION($name);
 
                        // Is the extension already installed or not?
-                       if (((SQL_NUMROWS($result) == 0) && (!FILE_READABLE($file))) || ($ver != $cver)) {
+                       if (($ver != $cver) && ($cver != "?") && ($cver != "!")) {
                                // No, it isn't. So let's add this one!
                                $THEMES['fname'][]  = $name;
                                $THEMES['fsize'][]  = $response[$idx + 1];
@@ -85,6 +84,7 @@ if (($response[sizeof($response) - 1] == "[EOF]") && ($response[0] != "[EOF]"))
                                $THEMES['ver'][]    = $ver;
                                $THEMES['cver'][]   = $cver;
 
+                               // Extract language strings from reponse
                                $LANG_DUMMY = explode("[nl]", $response[$idx + 4]);
                                $LANG = array();
                                $INFO = ADMIN_EXT_NO_INFO_FOUND;
index c44257b4be2a217c92da0ebf02c9804bf51f976e..b7f3948965e48d6e6833a17299ef113ba4950193 100644 (file)
@@ -455,11 +455,11 @@ VALUES ('%s','%s','%s','%s','%s',%s,'%s','%s',%s, %s,%s,'%s',%s, %s,'%s','UNCONF
        // Shall I add a counrty selection box or the old input box?
        if (EXT_IS_ACTIVE("country")) {
                // New variant, good!
-               $OUT  = "<SELECT name=\"country_code\" class=\"guest_select\" size=\"1\">\n";
+               $OUT  = "<select name=\"country_code\" class=\"guest_select\" size=\"1\">\n";
                $whereStatement = "WHERE is_active='Y'";
                if (IS_ADMIN()) $whereStatement = "";
                $OUT .= ADD_OPTION_LINES("countries", "id", "descr", $_POST['country_code'], "code", $whereStatement);
-               $OUT .= "</SELECT>";
+               $OUT .= "</select>";
                define('__COUNTRY_CONTENT', $OUT);
        } else {
                // Old out-dated variant
index 631f8420f875d8a829b22e51a1bb5541a6b60379..a57b9ea8fa20e322b76cbcb65658127833261ec0 100644 (file)
@@ -76,11 +76,10 @@ if (EXT_IS_ACTIVE("nickname"))
 }
 
 // Usage counter
-define('__DOUBLER_COUNTER', getConfig('doubler_counter'));
+define('__DOUBLER_COUNTER', TRANSLATE_COMMA(getConfig('doubler_counter')));
 
 // Which mail-send-mode did the admin setup?
-switch (getConfig('doubler_send_mode'))
-{
+switch (getConfig('doubler_send_mode')) {
 case "DIRECT":
        define('DOUBLER_PAYOUT_TIME', DOUBLER_PAYOUT_TIME_DIRECT);
        break;
@@ -103,7 +102,7 @@ define('__DOUBLER_PAYOUT_REF', DOUBLER_GENERATE_TABLE($GLOBALS['userid'], "N", "
 define('__TIMEOUT_MARK', CREATE_FANCY_TIME(getConfig('doubler_timeout')));
 
 // Points left to double
-define('__LEFT_VALUE', DOUBLER_GET_TOTAL_POINTS_LEFT());
+define('__LEFT_VALUE', TRANSLATE_COMMA(DOUBLER_GET_TOTAL_POINTS_LEFT()));
 
 // Load template
 LOAD_TEMPLATE("member_doubler");
index 2ce512e0601c90c8e9530207576874c776353b84..eaf8e39298c4b7c44950c1fc14c7097a06ec6850 100644 (file)
@@ -44,8 +44,7 @@ ADD_DESCR("member", __FILE__);
 
 // Load current referal clicks
 $result = SQL_QUERY_ESC("SELECT ref_clicks FROM `"._MYSQL_PREFIX."_user_data` WHERE userid=%s LIMIT 1",
- array($GLOBALS['userid']), __FILE__, __LINE__);
-
+       array($GLOBALS['userid']), __FILE__, __LINE__);
 list($c) = SQL_FETCHROW($result);
 SQL_FREERESULT($result);
 
@@ -53,20 +52,16 @@ OUTPUT_HTML("<FONT class=\"tiny\">".YOUR_PERSONAL_REFLINK.":<br />
 <STRONG><A href=\"".URL."/ref.php?refid=".$GLOBALS['userid']."\" target=\"_blank\">".URL."/ref.php?ref=".$GLOBALS['userid']."</A></STRONG><br />
 <br />");
 
-if (EXT_IS_ACTIVE("nickname"))
-{
+if (EXT_IS_ACTIVE("nickname")) {
        // Add nickname link when nickname is entered
        $nick = NICKNAME_GET_NICK($GLOBALS['userid']);
 
-       if (!empty($nick))
-       {
+       if (!empty($nick)) {
                // Display nickname link
                OUTPUT_HTML(NICKNAME_YOUR_REFLINK.":<br />
 <STRONG><A href=\"".URL."/ref.php?ref=".$nick."\" target=\"_blank\">".URL."/ref.php?ref=".$nick."</A></STRONG><br />
 <br />");
-       }
-        else
-       {
+       } else {
                // Display link to nickname form
                OUTPUT_HTML("<STRONG class=\"guest_note\">".NO_NICKNAME_SET."</STRONG><br />
 <A class=\"tiny\" href=\"".URL."/modules.php?module=login&amp;what=nickname\">".PLEASE_CLICK_NICKNAME_FORM."</A>");
@@ -79,23 +74,18 @@ $whereStatement = " WHERE visible='Y'";
 if (IS_ADMIN()) $whereStatement = "";
 $result = SQL_QUERY("SELECT id, url, alternate, counter, clicks FROM "._MYSQL_PREFIX."_refbanner", __FILE__, __LINE__);
 
-if (SQL_NUMROWS($result) > 0)
-{
+if (SQL_NUMROWS($result) > 0) {
        // List available ref banners
        $SW = 2; $OUT = "";
-       while (list($id, $url, $alt, $count, $clks) = SQL_FETCHROW($result))
-       {
+       while (list($id, $url, $alt, $count, $clks) = SQL_FETCHROW($result)) {
                $test = str_replace(URL, PATH, $url); $size = 0;
-               if ($test == $url)
-               {
+               if ($test == $url) {
                        // Download banner (I hope you keep the banner on same server???)
                        $fp = GET_URL($url); $file = "";
-                       if ((!empty($fp)) && (is_array($fp)) && (count($fp) > 0))
-                       {
+                       if ((!empty($fp)) && (is_array($fp)) && (count($fp) > 0) {
                                // Loads only found banner, when there is a 404 error this foreach() command
                                // will cause an "Invalid argument supplied for foreach()" error
-                               foreach ($fp as $f)
-                               {
+                               foreach ($fp as $f) {
                                        $file .= $f;
                                }
                        }
@@ -127,6 +117,9 @@ if (SQL_NUMROWS($result) > 0)
 
        // Load final template
        LOAD_TEMPLATE("member_reflinks_table", false, $GLOBALS['userid']);
+} else {
+       // No refbanner found!
+       LOAD_TEMPLATE("admin_settings_saved", false, MEMBER_NO_REFBANNER_FOUND);
 }
 
 // Free result
index 4f2c89ca681ed7aa7032b0e7fa4fcceafeb02a6e..084bb5ad277f632b68ddeabb5a4a1c8dbc211392 100644 (file)
@@ -1457,7 +1457,7 @@ function GET_ADMIN_DEFAULT_ACL ($aid) {
        return $ret;
 }
 //
-function ADD_OPTION_LINES($table, $id, $name, $default="",$special="",$where="") {
+function ADD_OPTION_LINES ($table, $id, $name, $default="", $special="", $where="") {
        $ret = "";
        if ($table == "/ARRAY/") {
                // Selection from array
@@ -1476,7 +1476,7 @@ function ADD_OPTION_LINES($table, $id, $name, $default="",$special="",$where="")
                $ORDER = $name.$SPEC;
                if ($table == "country") $ORDER = $special;
                $result = SQL_QUERY_ESC("SELECT %s, %s".$SPEC." FROM "._MYSQL_PREFIX."_%s ".$where." ORDER BY %s",
-                array($id, $ORDER, $table, $name), __FILE__, __LINE__);
+                       array($id, $ORDER, $table, $name), __FILE__, __LINE__);
                if (SQL_NUMROWS($result) > 0) {
                        // Found data so add them as OPTION lines: $id is the value and $name is the "name" of the option
                        while (list($value, $title, $add) = SQL_FETCHROW($result)) {