More rewrites, and output-mode fixed (we should documentate this)
[mailer.git] / inc / modules / admin / admin-inc.php
index 4ee9340b32aba67d244665a28f9d4423c5d8d428..7976506243625b366d4a6e0c9453420b302b421d 100644 (file)
@@ -467,7 +467,7 @@ ORDER BY
 }
 
 // Create member selection box
-function addMemberSelectionBox ($def='0', $add_all=false, $return=false, $none=false, $field='userid') {
+function addMemberSelectionBox ($def=0, $add_all=false, $return=false, $none=false, $field='userid') {
        // Output selection form with all confirmed user accounts listed
        $result = SQL_QUERY("SELECT `userid`, `surname`, `family` FROM `{?_MYSQL_PREFIX?}_user_data` ORDER BY `userid` ASC", __FUNCTION__, __LINE__);
 
@@ -511,7 +511,7 @@ function adminMenuSelectionBox_DEPRECATED ($mode, $default = '', $defid = '') {
        if (SQL_NUMROWS($result) > 0) {
                // Load menu as selection
                $OUT = "<select name=\"".$mode."_menu";
-               if ((!empty($defid)) || ($defid == '0')) $OUT .= "[".$defid."]";
+               if ((!empty($defid)) || ($defid == 0)) $OUT .= "[".$defid."]";
                $OUT .= "\" size=\"1\" class=\"admin_select\">
        <option value=\"\">{--SELECT_NONE--}</option>\n";
                // @TODO Try to rewrite this to $content = SQL_FETCHARRAY(). Please look some lines above for the dynamic query
@@ -594,7 +594,7 @@ function adminSaveSettings (&$postData, $tableName = "_config", $whereStatement
 
        if (SQL_NUMROWS($result) == 1) {
                // "Implode" all data to single string
-               $DATA_UPDATE = implode(", ", $DATA);
+               $DATA_UPDATE = implode(', ', $DATA);
 
                // Generate SQL string
                $sql = sprintf("UPDATE `{?_MYSQL_PREFIX?}%s` SET %s WHERE %s LIMIT 1",
@@ -612,8 +612,8 @@ function adminSaveSettings (&$postData, $tableName = "_config", $whereStatement
                } // END - foreach
 
                // Add both in one line
-               $KEYs = implode(", ", $KEYs);
-               $values = implode(", ", $values);
+               $KEYs = implode(', ', $KEYs);
+               $values = implode(', ', $values);
 
                // Generate SQL string
                $sql = sprintf("INSERT INTO {?_MYSQL_PREFIX?}%s (%s) VALUES (%s)",
@@ -677,12 +677,12 @@ function adminAddMenuSelectionBox ($menu, $type, $name, $default = '') {
 
 // Creates a user-profile link for the admin. This function can also be used for many other purposes
 function generateUserProfileLink ($userid, $title = '', $what = 'list_user') {
-       if (($title == '') && ($title != '0')) {
+       if (($title == '') && ($title != 0)) {
                // Set userid as title
                $title = $userid;
        } // END - if
 
-       if (($title == '0') && ($what == 'list_refs')) {
+       if (($title == 0) && ($what == 'list_refs')) {
                // Return title again
                return $title;
        } // END - if