From 6cd1089ca690bc40f0c37787faf6006c10d53768 Mon Sep 17 00:00:00 2001 From: bettina Date: Sat, 21 Apr 2001 23:18:35 +0000 Subject: [PATCH] update cats --- admin/addcategory.php | 9 +++++---- admin/editcategory.php | 9 +++++---- preferences/editcategory.php | 9 +++++---- 3 files changed, 15 insertions(+), 12 deletions(-) diff --git a/admin/addcategory.php b/admin/addcategory.php index 7a60abbb1c..41e1f9e96c 100644 --- a/admin/addcategory.php +++ b/admin/addcategory.php @@ -26,10 +26,11 @@ $errorcount = 0; if (!$cat_name) { $error[$errorcount++] = lang('Please enter a name for that category !'); } - if (!$cat_parent) { $exists = $c->exists('mains',$cat_name,$cat_id=''); } - else { $exists = $c->exists('subs',$cat_name,$cat_id=''); } - if ($exists == True) { $error[$errorcount++] = lang('That category name has been used already !'); } - + if (!$error) { + if (!$cat_parent) { $exists = $c->exists('mains',$cat_name,$cat_id=''); } + else { $exists = $c->exists('subs',$cat_name,$cat_id=''); } + if ($exists == True) { $error[$errorcount++] = lang('That category name has been used already !'); } + } if (! $error) { $cat_name = addslashes($cat_name); $cat_description = addslashes($cat_description); diff --git a/admin/editcategory.php b/admin/editcategory.php index 40b1074e6a..c2e35d20f4 100644 --- a/admin/editcategory.php +++ b/admin/editcategory.php @@ -37,10 +37,11 @@ if ($submit) { $errorcount = 0; if (!$cat_name) { $error[$errorcount++] = lang('Please enter a name for that category !'); } - - if (!$cat_parent) { $exists = $c->exists('mains',$cat_name,$cat_id); } - else { $exists = $c->exists('subs',$cat_name,$cat_id); } - if ($exists == True) { $error[$errorcount++] = lang('That category name has been used already !'); } + if (!$error) { + if (!$cat_parent) { $exists = $c->exists('mains',$cat_name,$cat_id); } + else { $exists = $c->exists('subs',$cat_name,$cat_id); } + if ($exists == True) { $error[$errorcount++] = lang('That category name has been used already !'); } + } $cat_name = addslashes($cat_name); $cat_description = addslashes($cat_description); diff --git a/preferences/editcategory.php b/preferences/editcategory.php index 1655dd0357..3621677565 100644 --- a/preferences/editcategory.php +++ b/preferences/editcategory.php @@ -42,10 +42,11 @@ if ($submit) { $errorcount = 0; if (!$cat_name) { $error[$errorcount++] = lang('Please enter a name for that category !'); } - if (!$cat_parent) { $exists = $c->exists('mains',$cat_name,$cat_id); } - else { $exists = $c->exists('subs',$cat_name,$cat_id); } - if ($exists == True) { $error[$errorcount++] = lang('That category name has been used already !'); } - + if (!$error) { + if (!$cat_parent) { $exists = $c->exists('mains',$cat_name,$cat_id); } + else { $exists = $c->exists('subs',$cat_name,$cat_id); } + if ($exists == True) { $error[$errorcount++] = lang('That category name has been used already !'); } + } $cat_name = addslashes($cat_name); $cat_description = addslashes($cat_description); if ($access) { $cat_access = 'private'; }