+ // Do we have a *real* userid?
+ if ($_POST['uid'][$id] > 0) {
+ // Generate subject
+ $eval = "\$subject = MEMBER_DEL_".strtoupper($table)."_SUBJECT;";
+ eval($eval);
+
+ // Load email template
+ $mail = LOAD_EMAIL_TEMPLATE("member_del_".$table, $content);
+
+ // Send email out
+ SEND_EMAIL($_POST['uid'][$id], $subject, $mail);
+ } // END - if
+
+ // Generate subject
+ $eval = "\$subject = ADMIN_DEL_".strtoupper($table)."_SUBJECT;";
+ eval($eval);
+
+ // Send admin notification out
+ SEND_ADMIN_NOTIFICATION($subject, "admin_del_".$table, $content, $_POST['uid'][$id]);
+ } // END - if
+
+ // Add id number
+ $idList .= $id.",";
+ } // END - if
+
+ // Run the query
+ SQL_QUERY($SQL, array($table, $idColumn, substr($idList, 0, -1)), __FILE__, __LINE__);
+
+ // Was this fine?
+ if (SQL_AFFECTEDROWS() == count($IDs)) {
+ // All deleted
+ LOAD_TEMPLATE("admin_settings_saved", false, ADMIN_ALL_ENTRIES_REMOVED);
+ } else {
+ // Some are still there :(
+ LOAD_TEMPLATE("admin_settings_saved", false, sprintf(ADMIN_SOME_ENTRIES_NOT_DELETED, SQL_AFFECTEDROWS(), count($IDs)));
+ }
+ } else {
+ // List for deletion confirmation
+ ADMIN_BUILD_LIST("del", $IDs, $table, $columns, $filterFunctions, $extraValues, $idColumn, $userIdColumn);
+ }
+ } // END - if
+}
+// Edit rows by given ID numbers
+function ADMIN_EDIT_ENTRIES_CONFIRM ($IDs, $table, $columns=array(), $filterFunctions=array(), $extraValues=array(), $editNow=false, $idColumn="id", $userIdColumn="userid") {
+ // All valid entries? (We hope so here!)
+ if ((is_array($IDs)) && (count($IDs) > 0) && (count($columns) == count($filterFunctions)) && (count($columns) == count($extraValues))) {
+ // Shall we change here or list for editing?
+ if ($editNow) {
+ // Change them all
+ $affected = 0;
+ foreach ($IDs as $id => $sel) {
+ // Prepare content array (new values)
+ $content = array();
+
+ // Prepare SQL for this row
+ $SQL = "UPDATE "._MYSQL_PREFIX."_".$table." SET";
+ foreach ($_POST 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;