+ if ($editNow === true) {
+ // Change them all
+ $affected = '0';
+ foreach ($IDs as $id => $sel) {
+ // Prepare content array (new values)
+ $content = array();
+
+ // Prepare SQL for this row
+ $sql = sprintf("UPDATE `{?_MYSQL_PREFIX?}_%s` SET",
+ SQL_ESCAPE($table)
+ );
+ foreach (postRequestArray() as $key => $entries) {
+ // Skip raw userid which is always invalid
+ if ($key == 'userid_raw') {
+ // Continue with next field
+ continue;
+ } // END - if
+
+ // Is entries an array?
+ if (($key != $idColumn) && (is_array($entries)) && (isset($entries[$id]))) {
+ // Add this entry to content
+ $content[$key] = $entries[$id];
+
+ // Send data through the filter function if found
+ if ((isset($filterFunctions[$key])) && (isset($extraValues[$key]))) {
+ // Filter function set!
+ $entries[$id] = handleExtraValues($filterFunctions[$key], $entries[$id], $extraValues[$key]);
+ } // END - if
+
+ // Then add this value
+ $sql .= sprintf(" `%s`='%s',",
+ SQL_ESCAPE($key),
+ SQL_ESCAPE($entries[$id])
+ );
+ } elseif (($key != $idColumn) && (!is_array($entries))) {
+ // Add normal entries as well!
+ $content[$key] = $entries;
+ }
+
+ // Do we have an URL?
+ if ($key == 'url') {
+ // Then add a framekiller test as well
+ $content['frametester'] = generateFrametesterUrl($content[$key]);
+ } // END - if
+ } // END - foreach
+
+ // Finish SQL command
+ $sql = substr($sql, 0, -1) . " WHERE `" . $idColumn . "`=" . bigintval($id) . " LIMIT 1";
+
+ // Run this query
+ SQL_QUERY($sql, __FUNCTION__, __LINE__);
+
+ // Add affected rows
+ $affected += SQL_AFFECTEDROWS();
+
+ // Load all data from that id
+ $result = SQL_QUERY_ESC("SELECT * FROM `{?_MYSQL_PREFIX?}_%s` WHERE `%s`=%s LIMIT 1",
+ array($table, $idColumn, $id), __FUNCTION__, __LINE__);
+
+ // Fetch the data and merge it into $content
+ $content = merge_array($content, SQL_FETCHARRAY($result));
+
+ // Free the result
+ SQL_FREERESULT($result);
+
+ // Send "build mails" out
+ sendAdminBuildMails('edit', $table, $content, $id);
+ } // END - foreach
+
+ // Was this fine?
+ if ($affected == count($IDs)) {
+ // All deleted
+ loadTemplate('admin_settings_saved', false, getMessage('ADMIN_ALL_ENTRIES_EDITED'));
+ } else {
+ // Some are still there :(
+ loadTemplate('admin_settings_saved', false, sprintf(getMessage('ADMIN_SOME_ENTRIES_NOT_EDITED'), $affected, count($IDs)));
+ }