+ // 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!}_ SET",
+ SQL_ESCAPE($table)
+ );
+ foreach (REQUEST_POST_ARRAY() as $key => $entries) {
+ // Skip raw userid which is always invalid
+ if ($key == "uid_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] = HANDLE_EXTRA_VALUES($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'] = FRAMETESTER($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
+ global $DATA;
+ $DATA = SQL_FETCHARRAY($result);
+
+ // Free the result
+ SQL_FREERESULT($result);
+
+ // Send "build mails" out
+ ADMIN_SEND_BUILD_MAILS("edit", $table, $content, $id);
+ } // END - foreach
+
+ // Was this fine?
+ if ($affected == count($IDs)) {
+ // All deleted
+ LOAD_TEMPLATE("admin_settings_saved", false, getMessage('ADMIN_ALL_ENTRIES_EDITED'));
+ } else {
+ // Some are still there :(
+ LOAD_TEMPLATE("admin_settings_saved", false, sprintf(ADMIN_SOME_ENTRIES_NOT_EDITED, $affected, count($IDs)));
+ }