update cats

This commit is contained in:
bettina 2001-04-21 23:18:35 +00:00
parent f71b6a8f54
commit 6cd1089ca6
3 changed files with 15 additions and 12 deletions

View File

@ -26,10 +26,11 @@
$errorcount = 0; $errorcount = 0;
if (!$cat_name) { $error[$errorcount++] = lang('Please enter a name for that category !'); } if (!$cat_name) { $error[$errorcount++] = lang('Please enter a name for that category !'); }
if (!$cat_parent) { $exists = $c->exists('mains',$cat_name,$cat_id=''); } if (!$error) {
else { $exists = $c->exists('subs',$cat_name,$cat_id=''); } if (!$cat_parent) { $exists = $c->exists('mains',$cat_name,$cat_id=''); }
if ($exists == True) { $error[$errorcount++] = lang('That category name has been used already !'); } 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 (! $error) {
$cat_name = addslashes($cat_name); $cat_name = addslashes($cat_name);
$cat_description = addslashes($cat_description); $cat_description = addslashes($cat_description);

View File

@ -37,10 +37,11 @@
if ($submit) { if ($submit) {
$errorcount = 0; $errorcount = 0;
if (!$cat_name) { $error[$errorcount++] = lang('Please enter a name for that category !'); } if (!$cat_name) { $error[$errorcount++] = lang('Please enter a name for that category !'); }
if (!$error) {
if (!$cat_parent) { $exists = $c->exists('mains',$cat_name,$cat_id); } if (!$cat_parent) { $exists = $c->exists('mains',$cat_name,$cat_id); }
else { $exists = $c->exists('subs',$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 ($exists == True) { $error[$errorcount++] = lang('That category name has been used already !'); }
}
$cat_name = addslashes($cat_name); $cat_name = addslashes($cat_name);
$cat_description = addslashes($cat_description); $cat_description = addslashes($cat_description);

View File

@ -42,10 +42,11 @@
if ($submit) { if ($submit) {
$errorcount = 0; $errorcount = 0;
if (!$cat_name) { $error[$errorcount++] = lang('Please enter a name for that category !'); } if (!$cat_name) { $error[$errorcount++] = lang('Please enter a name for that category !'); }
if (!$cat_parent) { $exists = $c->exists('mains',$cat_name,$cat_id); } if (!$error) {
else { $exists = $c->exists('subs',$cat_name,$cat_id); } if (!$cat_parent) { $exists = $c->exists('mains',$cat_name,$cat_id); }
if ($exists == True) { $error[$errorcount++] = lang('That category name has been used already !'); } 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_name = addslashes($cat_name);
$cat_description = addslashes($cat_description); $cat_description = addslashes($cat_description);
if ($access) { $cat_access = 'private'; } if ($access) { $cat_access = 'private'; }