// "Walk" through all entries and count them
if ($deleteNow) {
// Delete them
+ die("DELETE!");
} else {
// List for confirmation
- foreach ($IDs as $id=>$selected) {
+ foreach ($IDs as $id => $selected) {
// Secure ID number
$id = bigintval($id);
}
}
}
+// Edit rows by given ID numbers
+function ADMIN_EDIT_ENTRIES_CONFIRM ($IDs, $table, $row, $columns = array(), $filterFunctions = array(), $editNow=false, $idRow="id") {
+ global $_CONFIG;
+ $OUT = ""; $SW = 2;
+ if ((is_array($IDs)) && (count($IDs) > 0)) {
+ // "Walk" through all entries and count them
+ if ($editNow) {
+ // Delete them
+ die("EDIT!");
+ } else {
+ // List for confirmation
+ foreach ($IDs as $id => $selected) {
+ // Secure ID number
+ $id = bigintval($id);
+
+ // Will always be 1 ;-)
+ if ($selected == 1) {
+ // Get result from a given column array and table name
+ $result = SQL_RESULT_FROM_ARRAY($table, $columns, $idRow, $id);
+
+ // Is there one entry?
+ if (SQL_NUMROWS($result) == 1) {
+ // Load all data
+ $content = SQL_FETCHARRAY($result);
+
+ // Filter all data
+ foreach ($content as $key=>$value) {
+ // Is a filter function set?
+ $idx = array_search($key, $columns, true);
+ if (!empty($filterFunctions[$idx])) {
+ // Then call it!
+ $content[$key] = call_user_func($filterFunctions[$idx], $value);
+ }
+ }
+
+ // Add color switching
+ $content['sw'] = $SW;
+
+ // Then list it again...
+ $OUT .= LOAD_TEMPLATE("admin_edit_".$table."_row", true, $content);
+ $SW = 3 - $SW;
+ }
+
+ // Free the result
+ SQL_FREERESULT($result);
+ }
+ }
+
+ // Load master template
+ LOAD_TEMPLATE("admin_edit_".$table."", false, $OUT);
+ }
+ }
+}
// Checks proxy settins by fetching check-updates2.php from www.mxchange.org
function ADMIN_TEST_PROXY_SETTINGS ($settingsArray) {
global $_CONFIG;
$content = MXCHANGE_OPEN("check-updates2.php");
// Is the first line with "200 OK"?
- $valid = ereg("200 OK", $content[0]);
+ $valid = eregi("200 OK", $content[0]);
// Return result
return $valid;