// Load header, footer, render menu
$content['header'] = loadTemplate('admin_header' , true, $content);
$content['footer'] = loadTemplate('admin_footer' , true, $content);
- $content['menu'] = addAdminMenu($action, $what, true);
+ $content['menu'] = addAdminMenu($action, $what);
- // Tableset header
- loadTemplate('admin_main_header', false, $content);
+ // Load main template
+ loadTemplate('admin_main', false, $content);
// Check if action/what pair is valid
$result_action = SQL_QUERY_ESC("SELECT
}
// Adds an admin menu
-function addAdminMenu ($action, $what, $return = false) {
+function addAdminMenu ($action, $what) {
// Init variables
$SUB = false;
$OUT = '';
// Menu descriptions
$GLOBALS['menu']['description'] = array();
- $GLOBALS['menu']['title'] = array();
+ $GLOBALS['menu']['title'] = array();
// Build main menu
$result_main = SQL_QUERY("SELECT
- `action`,`title`,`descr`
+ `action` AS `main_action`,
+ `title` AS `main_title`,
+ `descr` AS `main_descr`
FROM
`{?_MYSQL_PREFIX?}_admin_menu`
WHERE
// Do we have entries?
if (!SQL_HASZERONUMS($result_main)) {
$OUT .= '<ul class="admin_menu_main">';
- // @TODO Rewrite this to $content = SQL_FETCHARRAY()
- while (list($menu, $title, $descr) = SQL_FETCHROW($result_main)) {
+
+ // Load all 'action' menus
+ while ($mainContent = SQL_FETCHARRAY($result_main)) {
// Filename
- $inc = sprintf("inc/modules/admin/action-%s.php", $menu);
+ $inc = sprintf("inc/modules/admin/action-%s.php", $mainContent['main_action']);
// Is the file readable?
$readable = isIncludeReadable($inc);
// Is the current admin allowed to access this 'action' menu?
- if (isAdminAllowedAccessMenu($menu)) {
+ if (isAdminAllowedAccessMenu($mainContent['main_action'])) {
if ($SUB === false) {
// Insert compiled menu title and description
- $GLOBALS['menu']['title'][$menu] = $title;
- $GLOBALS['menu']['description'][$menu] = $descr;
+ $GLOBALS['menu']['title'][$mainContent['main_action']] = $mainContent['main_title'];
+ $GLOBALS['menu']['description'][$mainContent['main_action']] = $mainContent['main_descr'];
} // END - if
- $OUT .= '<li class="admin_menu">
+ $OUT .= '<li class="admin_menu"' . addJavaScriptMenuContent('admin', $mainContent['main_action'], $action, $what) . '>
<div class="nobr"><strong>·</strong> ';
if ($readable === true) {
- if (($menu == $action) && (empty($what))) {
+ if (($mainContent['main_action'] == $action) && (empty($what))) {
$OUT .= '<strong>';
} else {
- $OUT .= '[<a href="{%url=modules.php?module=admin&action=' . $menu . '%}">';
+ $OUT .= '[<a href="{%url=modules.php?module=admin&action=' . $mainContent['main_action'] . '%}">';
}
} else {
- $OUT .= '<em style="cursor:help" class="notice" title="{%message,ADMIN_MENU_ACTION_404_TITLE=' . $menu . '%}">';
+ $OUT .= '<span class="bad" style="cursor:help" title="{%message,ADMIN_MENU_ACTION_404_TITLE=' . $mainContent['main_action'] . '%}">';
}
- $OUT .= $title;
+ $OUT .= $mainContent['main_title'];
if ($readable === true) {
- if (($menu == $action) && (empty($what))) {
+ if (($mainContent['main_action'] == $action) && (empty($what))) {
$OUT .= '</strong>';
} else {
$OUT .= '</a>]';
}
} else {
- $OUT .= '</em>';
+ $OUT .= '</span>';
}
$OUT .= '</div>
</li>';
- // Check for menu entries
- $result_what = SQL_QUERY_ESC("SELECT
- `what`,`title`,`descr`
+ // Add sub menu
+ $OUT .= addAdminSubMenu($mainContent, $action, $what);
+ } // END - if
+ } // END - while
+
+ // Close ul-tag
+ $OUT .= '</ul>';
+
+ // Free memory
+ SQL_FREERESULT($result_main);
+ } // END - if
+
+ // Return content
+ return $OUT;
+}
+
+// Add admin sub menu
+function addAdminSubMenu ($mainContent, $action, $what) {
+ // Init content
+ $OUT = '';
+
+ // Check for menu entries
+ $result_what = SQL_QUERY_ESC("SELECT
+ `what` AS `sub_what`,
+ `title` AS `sub_title`,
+ `descr` AS `sub_descr`
FROM
`{?_MYSQL_PREFIX?}_admin_menu`
WHERE
ORDER BY
`sort` ASC,
`id` DESC",
- array($menu), __FUNCTION__, __LINE__);
-
- // Remember the count for later checks
- setAdminMenuHasEntries($menu, ((!SQL_HASZERONUMS($result_what)) && ($action == $menu)));
-
- // Do we have entries?
- if ((ifAdminMenuHasEntries($menu)) && (!SQL_HASZERONUMS($result_what))) {
- $GLOBALS['menu']['description'] = array();
- $GLOBALS['menu']['title'] = array();
- $SUB = true;
- $OUT .= '<li class="admin_menu_sub"><ul class="admin_menu_sub">';
- // @TODO Rewrite this to $content = SQL_FETCHARRAY()
- while (list($what_sub, $title_what, $desc_what) = SQL_FETCHROW($result_what)) {
- // Filename
- $inc = sprintf("inc/modules/admin/what-%s.php", $what_sub);
-
- // Is the file readable?
- $readable = isIncludeReadable($inc);
-
- // Is the current admin allowed to access this 'what' menu?
- if (isAdminAllowedAccessMenu(null, $what_sub)) {
- // Insert compiled title and description
- $GLOBALS['menu']['title'][$what_sub] = $title_what;
- $GLOBALS['menu']['description'][$what_sub] = $desc_what;
- $OUT .= '<li class="admin_menu">
+ array($mainContent['main_action']), __FUNCTION__, __LINE__);
+
+ // Remember the count for later checks
+ setAdminMenuHasEntries($mainContent['main_action'], ((!SQL_HASZERONUMS($result_what)) && (($action == $mainContent['main_action']) || (isAdminMenuJavascriptEnabled()))));
+
+ // Start li-tag for sub menu content
+ $OUT .= '<li class="admin_menu_sub" id="action_menu_' . $mainContent['main_action'] . '"' . addStyleMenuContent('admin', $mainContent['main_action'], $action) . '>';
+
+ // Do we have entries?
+ if (ifAdminMenuHasEntries($mainContent['main_action'])) {
+ // Sub menu has been called
+ $SUB = true;
+ $OUT .= '<ul class="admin_menu_sub">';
+
+ // Load all entries
+ while ($subContent = SQL_FETCHARRAY($result_what)) {
+ // Filename
+ $inc = sprintf("inc/modules/admin/what-%s.php", $subContent['sub_what']);
+
+ // Is the file readable?
+ $readable = isIncludeReadable($inc);
+
+ // Is the current admin allowed to access this 'what' menu?
+ if (isAdminAllowedAccessMenu(NULL, $subContent['sub_what'])) {
+ // Insert compiled title and description
+ $GLOBALS['menu']['title'][$subContent['sub_what']] = $subContent['sub_title'];
+ $GLOBALS['menu']['description'][$subContent['sub_what']] = $subContent['sub_descr'];
+ $OUT .= '<li class="admin_menu">
<div class="nobr"><strong>--></strong> ';
- if ($readable === true) {
- if ($what == $what_sub) {
- $OUT .= '<strong>';
- } else {
- $OUT .= '[<a href="{%url=modules.php?module=admin&what=' . $what_sub . '%}">';
- }
- } else {
- $OUT .= '<em style="cursor:help" class="notice" title="{%message,ADMIN_MENU_WHAT_404_TITLE=' . $what_sub . '%}">';
- }
-
- $OUT .= $title_what;
-
- if ($readable === true) {
- if ($what == $what_sub) {
- $OUT .= '</strong>';
- } else {
- $OUT .= '</a>]';
- }
- } else {
- $OUT .= '</em>';
- }
- $OUT .= '</div>
-</li>';
- } // END - if
- } // END - while
+ if ($readable === true) {
+ if ($what == $subContent['sub_what']) {
+ $OUT .= '<strong>';
+ } else {
+ $OUT .= '[<a href="{%url=modules.php?module=admin&what=' . $subContent['sub_what'] . '%}">';
+ }
+ } else {
+ $OUT .= '<span class="bad" style="cursor:help" title="{%message,ADMIN_MENU_WHAT_404_TITLE=' . $subContent['sub_what'] . '%}">';
+ }
+
+ $OUT .= $subContent['sub_title'];
- // Free memory
- SQL_FREERESULT($result_what);
- $OUT .= '</ul>
+ if ($readable === true) {
+ if ($what == $subContent['sub_what']) {
+ $OUT .= '</strong>';
+ } else {
+ $OUT .= '</a>]';
+ }
+ } else {
+ $OUT .= '</span>';
+ }
+ $OUT .= '</div>
</li>';
- } // END - if
} // END - if
} // END - while
// Free memory
- SQL_FREERESULT($result_main);
+ SQL_FREERESULT($result_what);
$OUT .= '</ul>';
- }
+ } // END - if
- // Is there a cache instance again?
- // Return or output content?
- if ($return === true) {
- return $OUT;
- } else {
- outputHtml($OUT);
- }
+ // Close li-tag
+ $OUT .= '</li>';
+
+ // Return content
+ return $OUT;
}
-// Create member selection box
-function addMemberSelectionBox ($def = 0, $add_all = false, $return = false, $none = false, $field = 'userid') {
+// Create an admin selection box form
+function addAdminSelectionBox ($adminId = NULL, $special = '') {
+ // Default is email as "special column"
+ $ADD = ',`email` AS `special`';
+
+ // Is a special column given?
+ if (!empty($special)) {
+ // Additional column for SQL query
+ $ADD = ',`' . $special . '` AS `special`';
+ } // END - if
+
+ // Query all entries
+ $result = SQL_QUERY('SELECT
+ `id`,
+ `login`
+ ' . $ADD . '
+FROM
+ `{?_MYSQL_PREFIX?}_admins`
+ORDER BY
+ `login` ASC', __FUNCTION__, __LINE__);
+
+ // Init output
+ $OUT = '';
+
+ // Load all entries
+ while ($content = SQL_FETCHARRAY($result)) {
+ // Add the entry
+ $OUT .= loadTemplate('select_admins_option', true, $content);
+ } // END - if
+
+ // Free memory
+ SQL_FREERESULT($result);
+
+ // Add form to content
+ $content['form_selection'] = $OUT;
+
+ // Output form
+ loadTemplate('select_admins_box', false, $content);
+}
+
+// Create a member selection box
+function addMemberSelectionBox ($userid = NULL, $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__);
+ $result = SQL_QUERY('SELECT
+ `userid`,`surname`,`family`
+FROM
+ `{?_MYSQL_PREFIX?}_user_data`
+ORDER BY
+ `userid` ASC', __FUNCTION__, __LINE__);
// Default output
$OUT = '';
// USe this only for adding points (e.g. adding refs really makes no sence ;-) )
- if ($add_all === true) $OUT = ' <option value="all">{--ALL_MEMBERS--}</option>';
- elseif ($none === true) $OUT = ' <option value="0">{--SELECT_NONE--}</option>';
+ if ($add_all === true) {
+ $OUT = ' <option value="all">{--ALL_MEMBERS--}</option>';
+ } elseif ($none === true) {
+ $OUT = ' <option value="0">{--SELECT_NONE--}</option>';
+ }
+ // Load all entries
while ($content = SQL_FETCHARRAY($result)) {
$OUT .= '<option value="' . bigintval($content['userid']) . '"';
- if ($def == $content['userid']) $OUT .= ' selected="selected"';
+ if ($userid == $content['userid']) $OUT .= ' selected="selected"';
$OUT .= '>' . $content['surname'] . ' ' . $content['family'] . ' (' . bigintval($content['userid']) . ')</option>';
} // END - while
if ($return === false) {
// Remeber options in constant
$content['form_selection'] = $OUT;
- $content['what'] = getWhat();
+ $content['what'] = '{%pipe,getWhat%}';
// Load template
loadTemplate('admin_form_selection_box', false, $content);
$title = $userid;
} elseif (!isValidUserId($userid)) {
// User id zero is invalid
- return '<strong>' . makeNullToZero($userid) . '</strong>';
+ return '<strong>' . convertNullToZero($userid) . '</strong>';
}
if (($title == '0') && ($what == 'list_refs')) {
// Filter all data
foreach ($content as $key => $value) {
// Search index
- $idx = array_search($key, $columns, true);
+ $idx = searchXmlArray($key, $columns, 'column');
+
+ // Skip any missing entries
+ if ($idx === false) {
+ // Skip this one
+ //* DEBUG: */ debug_report_bug(__FUNCTION__, __LINE__, 'key=' . $key . ' - SKIPPED!');
+ continue;
+ } // END - if
//Â Do we have a userid?
//* NOISY-DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'key=' . $key . ',userIdColumn=' . $userIdColumn[0]);
if ($key == $userIdColumn[0]) {
// Add it again as raw id
//* DEBUG: */ debug_report_bug(__FUNCTION__, __LINE__, 'key=' . $key . ',userIdColumn=' . $userIdColumn[0]);
- $content[$userIdColumn[0]] = bigintval($value);
+ $content[$userIdColumn[0]] = convertZeroToNull($value);
$content[$userIdColumn[0] . '_raw'] = $content[$userIdColumn[0]];
} // END - if
$GLOBALS['admin_list_builder_id_value'] = $value;
} // END - if
- // Handle the call in external function
- //* DEBUG: */ debugOutput('key=' . $key . ',fucntion=' . $filterFunctions[$idx] . ',value=' . $value);
- $content[$key] = handleExtraValues(
- $filterFunctions[$idx],
- $value,
- $extraValues[$idx]
- );
+ // Do we have a call-back function and extra-value pair?
+ if ((isset($filterFunctions[$idx])) && (isset($extraValues[$idx]))) {
+ // Handle the call in external function
+ //* DEBUG: */ debugOutput('key=' . $key . ',fucntion=' . $filterFunctions[$idx] . ',value=' . $value);
+ $content[$key] = handleExtraValues(
+ $filterFunctions[$idx],
+ $value,
+ $extraValues[$idx]
+ );
+ } elseif ((isset($columns[$idx]['name'])) && (isset($filterFunctions[$columns[$idx]['name']])) && (isset($extraValues[$columns[$idx]['name']]))) {
+ // Handle the call in external function
+ //* DEBUG: */ debugOutput('key=' . $key . ',fucntion=' . $filterFunctions[$columns[$idx]['name']] . ',value=' . $value);
+ $content[$key] = handleExtraValues(
+ $filterFunctions[$columns[$idx]['name']],
+ $value,
+ $extraValues[$columns[$idx]['name']]
+ );
+ }
} // END - foreach
// Then list it
// All valid entries? (We hope so here!)
//* DEBUG: */ debug_report_bug(__FUNCTION__, __LINE__, 'idColumn=<pre>'.print_r($idColumn,true).'</pre>,tableName<pre>'.print_r($tableName,true).'</pre>,columns=<pre>'.print_r($columns,true).'</pre>,filterFunctions=<pre>'.print_r($filterFunctions,true).'</pre>,extraValues=<pre>'.print_r($extraValues,true).'</pre>,editNow=<pre>'.print_r($editNow,true).'</pre>,userIdColumn=<pre>'.print_r($userIdColumn,true).'</pre>,rawUserId=<pre>'.print_r($rawUserId,true).'</pre>');
- if ((count($columns) == count($filterFunctions)) && (count($columns) == count($extraValues))) {
+ //if ((count($columns) == count($filterFunctions)) && (count($columns) == count($extraValues))) {
+ if (true) {
// Shall we change here or list for editing?
if ($editNow[0] === true) {
// Change them all
$sqlValues = array();
// Add columns and values
- foreach ($columns as $key=>$columnName) {
+ foreach ($columns as $key => $columnName) {
// Copy entry to final arrays
$sqlColumns[$key] = $columnName;
$sqlValues[$key] = postRequestElement($columnName);
} // END - foreach
// Build the SQL query
- $SQL = 'INSERT INTO `{?_MYSQL_PREFIX?}_' . $tableName[0] . '` (`' . implode('`, `', $sqlColumns) . "`) VALUES ('" . implode("','", $sqlValues) . "')";
+ $SQL = 'INSERT INTO `{?_MYSQL_PREFIX?}_' . $tableName[0] . '` (`' . implode('`,`', $sqlColumns) . "`) VALUES ('" . implode("','", $sqlValues) . "')";
// Run the SQL query
SQL_QUERY($SQL, __FUNCTION__, __LINE__);
// This is the minimum query, so at least columns and tableName must have entries
$SQL = 'SELECT ';
- foreach ($columns as $columnArray) {
- // Init SQL part
- $sqlPart = '';
- // Do we have a table/alias
- if (!empty($columnArray['table'])) {
- // Pre-add it
- $sqlPart .= $columnArray['table'] . '.';
- } // END - if
-
- // Add column
- $sqlPart .= '`' . $columnArray['column'] . '`';
- // Is a function and alias set?
- if ((!empty($columnArray['function'])) && (!empty($columnArray['alias']))) {
- // Add both
- $sqlPart = $columnArray['function'] . '(' . $sqlPart . ') AS `' . $columnArray['alias'] . '`';
- } // END - if
-
- // Add finished SQL part to the query
- $SQL .= $sqlPart . ',';
- } // END - foreach
+ // Get the sql part back from given array
+ $SQL .= getSqlPartFromXmlArray($columns);
// Remove last commata and add FROM statement
- $SQL = substr($SQL, 0, -1) . ' FROM `{?_MYSQL_PREFIX?}_' . $tableName[0] . '`';
+ $SQL .= ' FROM `{?_MYSQL_PREFIX?}_' . $tableName[0] . '`';
// Do we have entries from whereColumns to add?
if (count($whereColumns) > 0) {
if (count($orderByColumns) > 0) {
// Add them as well
$SQL .= ' ORDER BY ';
- foreach ($orderByColumns as $orderByColumn=>$array) {
+ foreach ($orderByColumns as $orderByColumn => $array) {
// Get keys (table/alias) and values (sorting itself)
$table = trim(implode('', array_keys($array)));
$sorting = trim(implode('', array_keys($array)));
$OUT = '';
while ($content = SQL_FETCHARRAY($result)) {
// "Translate" content
- foreach ($callbackColumns as $columnName=>$callbackFunction) {
+ foreach ($callbackColumns as $columnName => $callbackFunction) {
// Fill the callback arguments
$args = array($content[$columnName]);
SQL_FREERESULT($result);
}
-// Checks proxy settins by fetching check-updates3.php from www.mxchange.org
+// Checks proxy settins by fetching check-updates3.php from mxchange.org
function adminTestProxySettings ($settingsArray) {
// Set temporary the new settings
mergeConfig($settingsArray);
SQL_FREERESULT($result);
// Generate hash for reset link
- $content['hash'] = generateHash(getUrl() . getEncryptSeperator() . $content['id'] . getEncryptSeperator() . $content['login'] . getEncryptSeperator() . $content['password'], substr($content['password'], getSaltLength()));
+ $content['hash'] = generateHash(getUrl() . getEncryptSeparator() . $content['id'] . getEncryptSeparator() . $content['login'] . getEncryptSeparator() . $content['password'], substr($content['password'], getSaltLength()));
// Remove some data
unset($content['id']);
$content = SQL_FETCHARRAY($result);
// Generate hash again
- $hashFromData = generateHash(getUrl() . getEncryptSeperator() . $content['id'] . getEncryptSeperator() . $login . getEncryptSeperator() . $content['password'], substr($content['password'], getSaltLength()));
+ $hashFromData = generateHash(getUrl() . getEncryptSeparator() . $content['id'] . getEncryptSeparator() . $login . getEncryptSeparator() . $content['password'], substr($content['password'], getSaltLength()));
// Does both match?
$valid = ($hash == $hashFromData);
// Generate a "link" for the given admin id (admin_id)
function generateAdminLink ($adminId) {
// No assigned admin is default
- $adminLink = '<span class="notice">{--ADMIN_NO_ADMIN_ASSIGNED--}</span>';
+ $adminLink = '{--ADMIN_NO_ADMIN_ASSIGNED--}';
// Zero? = Not assigned
if (bigintval($adminId) > 0) {
}
} else {
// Maybe deleted?
- $adminLink = '<div class="notice">{%message,ADMIN_ID_404=' . $adminId . '%}</div>';
+ $adminLink = '<div class="bad">{%message,ADMIN_ID_404=' . $adminId . '%}</div>';
}
} // END - if
$NAV .= '</a>';
}
- // Add seperator if we have not yet reached total pages
+ // Add separator if we have not yet reached total pages
if ($page < $numPages) {
// Add it
$NAV .= '|';
switch (postRequestElement('ok')) {
case 'edit': // Edit menu
- if (postRequestElement('sel_what', $sel) == '') {
+ // Shall we update a menu or sub menu?
+ if (!isGetRequestElementSet('sub')) {
// Update with 'what'=null
- SQL_QUERY_ESC("UPDATE `{?_MYSQL_PREFIX?}_%s_menu` SET `title`='%s', `action`='%s', `what`=NULL WHERE ".$AND." AND `id`=%s LIMIT 1",
+ SQL_QUERY_ESC("UPDATE `{?_MYSQL_PREFIX?}_%s_menu` SET `title`='%s',`action`='%s',`what`=NULL WHERE ".$AND." AND `id`=%s LIMIT 1",
array(
$type,
$menu,
postRequestElement('sel_action', $sel),
$sel
- ), __FILE__, __LINE__);
+ ), __FUNCTION__, __LINE__);
} else {
// Update with selected 'what'
- SQL_QUERY_ESC("UPDATE `{?_MYSQL_PREFIX?}_%s_menu` SET `title`='%s', `action`='%s', `what`='%s' WHERE ".$AND." AND `id`=%s LIMIT 1",
+ SQL_QUERY_ESC("UPDATE `{?_MYSQL_PREFIX?}_%s_menu` SET `title`='%s',`action`='%s',`what`='%s' WHERE ".$AND." AND `id`=%s LIMIT 1",
array(
$type,
$menu,
postRequestElement('sel_action', $sel),
postRequestElement('sel_what', $sel),
$sel
- ), __FILE__, __LINE__);
+ ), __FUNCTION__, __LINE__);
}
break;
case 'delete': // Delete menu
SQL_QUERY_ESC("DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_%s_menu` WHERE ".$AND." AND `id`=%s LIMIT 1",
- array($type, $sel), __FILE__, __LINE__);
+ array(
+ $type,
+ $sel
+ ), __FUNCTION__, __LINE__);
break;
case 'status': // Change status of menus
- SQL_QUERY_ESC("UPDATE `{?_MYSQL_PREFIX?}_%s_menu` SET `visible`='%s', `locked`='%s' WHERE ".$AND." AND `id`=%s LIMIT 1",
- array($type, postRequestElement('visible', $sel), postRequestElement('locked', $sel), $sel), __FILE__, __LINE__);
+ SQL_QUERY_ESC("UPDATE `{?_MYSQL_PREFIX?}_%s_menu` SET `visible`='%s',`locked`='%s' WHERE ".$AND." AND `id`=%s LIMIT 1",
+ array(
+ $type,
+ postRequestElement('visible', $sel),
+ postRequestElement('locked', $sel),
+ $sel
+ ), __FUNCTION__, __LINE__);
break;
default: // Unexpected action
- logDebugMessage(__FILE__, __LINE__, sprintf("Unsupported action %s detected.", postRequestElement('ok')));
+ logDebugMessage(__FUNCTION__, __LINE__, sprintf("Unsupported action %s detected.", postRequestElement('ok')));
displayMessage('{%message,ADMIN_UNKNOWN_OKAY=' . postRequestElement('ok') . '%}');
break;
} // END - switch
$type,
getRequestElement('act'),
bigintval(getRequestElement('tid'))
- ), __FILE__, __LINE__);
+ ), __FUNCTION__, __LINE__);
list($tid) = SQL_FETCHROW($result);
SQL_FREERESULT($result);
$result = SQL_QUERY_ESC("SELECT `id` FROM `{?_MYSQL_PREFIX?}_%s_menu` WHERE `action`='%s' AND `sort`=%s LIMIT 1",
$type,
getRequestElement('act'),
bigintval(getRequestElement('fid'))
- ), __FILE__, __LINE__);
+ ), __FUNCTION__, __LINE__);
list($fid) = SQL_FETCHROW($result);
SQL_FREERESULT($result);
} else {
array(
$type,
bigintval(getRequestElement('tid'))
- ), __FILE__, __LINE__);
+ ), __FUNCTION__, __LINE__);
list($tid) = SQL_FETCHROW($result);
SQL_FREERESULT($result);
$result = SQL_QUERY_ESC("SELECT `id` FROM `{?_MYSQL_PREFIX?}_%s_menu` WHERE (`what`='' OR `what` IS NULL) AND `sort`=%s LIMIT 1",
array(
$type,
bigintval(getRequestElement('fid'))
- ), __FILE__, __LINE__);
+ ), __FUNCTION__, __LINE__);
list($fid) = SQL_FETCHROW($result);
SQL_FREERESULT($result);
}
$type,
bigintval(getRequestElement('tid')),
bigintval($fid)
- ), __FILE__, __LINE__);
+ ), __FUNCTION__, __LINE__);
SQL_QUERY_ESC("UPDATE `{?_MYSQL_PREFIX?}_%s_menu` SET `sort`=%s WHERE ".$AND." AND `id`=%s LIMIT 1",
array(
$type,
bigintval(getRequestElement('fid')),
bigintval($tid)
- ), __FILE__, __LINE__);
+ ), __FUNCTION__, __LINE__);
} // END - if
} // END - if
}