// Display message
loadTemplate('admin_settings_saved', false, $content);
-} elseif ((countPostSelection() > 0) && (isFormSent('edit'))) {
+} elseif ((ifPostContainsSelections()) && (isFormSent('edit'))) {
// Edit banner
$OUT = '';
foreach (postRequestParameter('sel') as $id => $sel) {
SQL_FREERESULT($result);
// Preapre data for the row
- $content['visible'] => addSelectionBox('yn', $content['visible'], 'visible');
+ $content['visible'] = addSelectionBox('yn', $content['visible'], 'visible');
// Load row template and switch color
$OUT .= loadTemplate('admin_refbanner_edit_row', true, $content);
// Load main template
loadTemplate('admin_refbanner_edit', false, $OUT);
} else {
- if ((countPostSelection() > 0) && (isFormSent('del'))) {
+ if ((ifPostContainsSelections()) && (isFormSent('del'))) {
// Delete banner
foreach (postRequestParameter('sel') as $id => $sel) {
SQL_QUERY_ESC("DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_refbanner` WHERE `id`=%s LIMIT 1",
$result = SQL_QUERY('SELECT `id`, `url`, `alternate`, `visible`, `counter`, `clicks` FROM `{?_MYSQL_PREFIX?}_refbanner` ORDER BY `url` ASC', __FILE__, __LINE__);
// Entries found?
- if (SQL_NUMROWS($result) > 0) {
+ if (!SQL_HASZERONUMS($result)) {
// Make referal banner editable and deletable
$OUT = '';
while ($content = SQL_FETCHARRAY($result)) {