// Check if banner is already added
$result = SQL_QUERY_ESC("SELECT `id` FROM `{?_MYSQL_PREFIX?}_refbanner` WHERE url='%s' LIMIT 1",
array(postRequestParameter('url')), __FILE__, __LINE__);
- if (SQL_NUMROWS($result) == '0') {
+ if (SQL_HASZERONUMS($result)) {
// Add banner
SQL_QUERY_ESC("INSERT INTO `{?_MYSQL_PREFIX?}_refbanner` (url, alternate, visible)
VALUES ('%s','%s','%s')",
// Display message
loadTemplate('admin_settings_saved', false, $content);
-} elseif ((countPostSelection() > 0) && (isPostRequestParameterSet('edit'))) {
+} elseif ((countPostSelection() > 0) && (isFormSent('edit'))) {
// Edit banner
$SW = 2; $OUT = '';
foreach (postRequestParameter('sel') as $id => $sel) {
// Load main template
loadTemplate('admin_refbanner_edit', false, $OUT);
} else {
- if ((countPostSelection() > 0) && (isPostRequestParameterSet('del'))) {
+ if ((countPostSelection() > 0) && (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",