}
// Send mails for del/edit/lock build modes
-function sendAdminBuildMails ($mode, $table, $content, $id, $subjectPart = '', $userid = 'userid_raw') {
+function sendAdminBuildMails ($mode, $table, $content, $id, $subjectPart = '', $userid = 'userid') {
// Default subject is the subject part
$subject = $subjectPart;
}
// Build a special template list
-function adminListBuilder ($listType, $IDs, $table, $columns, $filterFunctions, $extraValues, $idColumn, $userIdColumn, $userid = 'userid_raw') {
+function adminListBuilder ($listType, $IDs, $table, $columns, $filterFunctions, $extraValues, $idColumn, $userIdColumn, $userid = 'userid') {
$OUT = ''; $SW = 2;
// "Walk" through all entries
$idx = array_search($key, $columns, true);
// Do we have a userid?
- if ($key == 'userid') {
+ if ($key == $userIdColumn) {
// Add it again as raw id
- $content[$userid] = bigintval($value);
+ $content[$userIdColumn] = bigintval($value);
+ $content[$userIdColumn . '_raw'] = $content[$userIdColumn];
} // END - if
// If the key matches the idColumn variable, we need to temporary remember it
}
// Change status of "build" list
-function adminBuilderStatusHandler ($mode, $IDs, $table, $columns, $filterFunctions, $extraValues, $idColumn, $userIdColumn, $statusArray, $userid = 'userid_raw') {
+function adminBuilderStatusHandler ($mode, $IDs, $table, $columns, $filterFunctions, $extraValues, $idColumn, $userIdColumn, $statusArray, $userid = 'userid') {
// All valid entries? (We hope so here!)
if ((is_array($IDs)) && (count($IDs) > 0) && (count($columns) == count($filterFunctions)) && (count($columns) == count($extraValues)) && (count($statusArray) > 0)) {
// "Walk" through all entries
}
// Delete rows by given id numbers
-function adminDeleteEntriesConfirm ($IDs, $table, $columns = array(), $filterFunctions = array(), $extraValues = array(), $deleteNow = false, $idColumn = 'id', $userIdColumn = 'userid', $userid = 'userid_raw') {
+function adminDeleteEntriesConfirm ($IDs, $table, $columns = array(), $filterFunctions = array(), $extraValues = array(), $deleteNow = false, $idColumn = 'id', $userIdColumn = 'userid', $userid = '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 delete here or list for deletion?
}
// Edit rows by given id numbers
-function adminEditEntriesConfirm ($IDs, $table, $columns = array(), $filterFunctions = array(), $extraValues = array(), $editNow = false, $idColumn = 'id', $userIdColumn = 'userid', $userid = 'userid_raw') {
+function adminEditEntriesConfirm ($IDs, $table, $columns = array(), $filterFunctions = array(), $extraValues = array(), $editNow = false, $idColumn = 'id', $userIdColumn = 'userid', $userid = '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?
// By default show the list...
$show = true;
-// Check for 'id' element
-if ((countRequestPost() > 0) && ((!isPostRequestParameterSet('id')) || (!is_array(postRequestParameter('id'))) || (count(postRequestParameter('id')) == 0))) {
+// Check for 'url_id' element
+if ((countRequestPost() > 0) && ((!isPostRequestParameterSet('url_id')) || (!is_array(postRequestParameter('url_id'))) || (count(postRequestParameter('url_id')) == 0))) {
// Not found so output message
loadTemplate('admin_settings_saved', false, getMessage('ADMIN_SURFBAR_NO_SELECTIONS'));
if (isFormSent('edit')) {
// Show entries for editing
adminEditEntriesConfirm(
- postRequestParameter('id'),
+ postRequestParameter('url_id'),
'surfbar_urls',
array('url_id', 'url_userid', 'url'),
array('bigintval', 'addMemberSelectionBox', ''),
- array('', array(false, true, true, 'userid[]'), '')
+ array('', array(false, true, true, 'url_userid[]'), ''),
+ false,
+ 'url_id',
+ 'url_userid',
+ 'url_userid'
);
$show = false;
} elseif (isPostRequestParameterSet('do_edit')) {
array(),
array(),
true,
- 'url_id'
+ 'url_id',
+ 'url_userid',
+ 'url_userid'
);
} elseif (isPostRequestParameterSet('delete')) {
// Show entries for deletion
array('', '', '', ''),
false,
'url_id',
- 'userid',
+ 'url_userid',
'url_userid'
);
$show = false;
adminLockEntriesConfirm(
postRequestParameter('url_id'),
'surfbar_urls',
- array('url_id', 'url_userid', 'url', 'url_registered', 'status'),
+ array('url_id', 'url_userid', 'url', 'url_registered', 'url_status'),
array('bigintval', 'generateUserProfileLink', 'generateFrametesterUrl', '', 'translateSurfbarUrlStatus'),
array('', '', '', '', ''),
false,
- 'url_id'
+ 'url_id',
+ 'url_userid',
+ 'url_userid'
);
$show = false;
} elseif (isPostRequestParameterSet('do_lock')) {
array(),
array(),
array(),
- array('status' => array('ACTIVE' => 'LOCKED', 'LOCKED' => 'ACTIVE')),
+ array('url_status' => array('ACTIVE' => 'LOCKED', 'LOCKED' => 'ACTIVE')),
true,
- 'url_id'
+ 'url_id',
+ 'url_userid',
+ 'url_userid'
);
} elseif (isPostRequestParameterSet('undelete')) {
// Undelete selected URLs. This does only work for deleted URLs... ;-)
adminUndeleteEntriesConfirm(
postRequestParameter('url_id'),
'surfbar_urls',
- array('url_id', 'url_userid', 'url', 'url_registered', 'status'),
+ array('url_id', 'url_userid', 'url', 'url_registered', 'url_status'),
array('bigintval', 'generateUserProfileLink', 'generateFrametesterUrl', '', 'translateSurfbarUrlStatus'),
array('', '', '', '', ''),
false,
- 'url_id'
+ 'url_id',
+ 'url_userid',
+ 'url_userid'
);
$show = false;
} elseif (isPostRequestParameterSet('do_undelete')) {
array(),
array(),
array(),
- array('status' => array('DELETED' => 'ACTIVE')),
+ array('url_status' => array('DELETED' => 'ACTIVE')),
true,
- 'url_id'
+ 'url_id',
+ 'url_userid',
+ 'url_userid'
);
}
<tr>
<td align="center" class="bottom right switch_sw$content[sw]">
<input type="hidden" name="url_id[$content[url_id]]" value="1" />
- <input type="hidden" name="url_userid[$content[url_id]]" value="$content[url_userid]" />
+ <input type="hidden" name="url_userid[content[url_id]]" value="$content[url_userid_raw]" />
$content[url_userid]
</td>
<td align="center" class="bottom right switch_sw$content[sw]">
<tr>
<td align="center" class="bottom right switch_sw$content[sw]">
<input type="hidden" name="url_id[$content[url_id]]" value="1" />
- <input type="hidden" name="url_userid[$content[url_id]]" value="$content[url_userid]" />
+ <input type="hidden" name="url_userid[$content[url_id]]" value="$content[url_userid_raw]" />
$content[url_userid]
</td>
<td align="center" class="bottom right switch_sw$content[sw]">
<tr>
<td align="center" class="bottom right switch_sw$content[sw]">
<input type="hidden" name="url_id[$content[url_id]]" value="1" />
- <input type="hidden" name="url_userid[$content[url_id]]" value="$content[url_url_userid]" />
+ <input type="hidden" name="url_userid[$content[url_id]]" value="$content[url_url_userid_raw]" />
<input type="hidden" name="last_locked[$content[url_id]]" value="NOW()" />
$content[url_userid]
</td>
<tr>
<td align="center" class="bottom right switch_sw$content[sw]">
<input type="hidden" name="url_id[$content[url_id]]" value="1" />
- <input type="hidden" name="url_userid[$content[url_id]]" value="$content[url_url_userid]" />
+ <input type="hidden" name="url_userid[content[url_id]]" value="$content[url_url_userid_raw]" />
$content[url_userid]
</td>
<td align="center" class="bottom right switch_sw$content[sw]">