find first aparence: if (empty($error)) {
for me i find this at line 502.
now form 502 to 537 you have this code:
if (empty($error)) {
if (!$cat_order) {
$sql = "SELECT cat_order
FROM ".CATEGORIES_TABLE."
WHERE cat_parent_id = $cat_parent_id
ORDER BY cat_order DESC
LIMIT 1";
$catorder = $site_db->query_firstrow($sql);
$cat_order = $catorder['cat_order'] + 10;
$do_update_cat_order = 0;
}
else {
$do_update_cat_order = 1;
}
$sql = "INSERT INTO ".CATEGORIES_TABLE."
(cat_name, cat_description, cat_parent_id, cat_order, auth_viewcat, auth_viewimage, auth_download, auth_upload, auth_directupload, auth_vote, auth_sendpostcard, auth_readcomment, auth_postcomment)
VALUES
('$cat_name', '$cat_description', $cat_parent_id, $cat_order, $auth_viewcat, $auth_viewimage, $auth_download, $auth_upload, $auth_directupload, $auth_vote, $auth_sendpostcard, $auth_readcomment, $auth_postcomment)";
$result = $site_db->query($sql);
$cat_id = $site_db->get_insert_id();
if ($result && $cat_id) {
if ($do_update_cat_order) {
update_cat_order($cat_parent_id);
}
$msg = $lang['cat_add_success'];
create_cat_folder(MEDIA_PATH."/".$cat_id, CHMOD_DIRS);
create_cat_folder(THUMB_PATH."/".$cat_id, CHMOD_DIRS);
}
else {
$msg = $lang['cat_add_error'];
}
//$action = "modifycats";
forward_to_modify($msg);
}Replace code from line 502 to 537, with the next code:
if (empty($error)) {
$cat_name_array = explode('|', $cat_name);
$cat_name_count = count($cat_name_array);
for ($i=0;$i<$cat_name_count;$i++)
{
$cat_name = $cat_name_array[$i];
/** Start ADD **/
if (!$cat_order) {
$sql = "SELECT cat_order
FROM ".CATEGORIES_TABLE."
WHERE cat_parent_id = $cat_parent_id
ORDER BY cat_order DESC
LIMIT 1";
$catorder = $site_db->query_firstrow($sql);
$cat_order = $catorder['cat_order'] + 10;
$do_update_cat_order = 0;
}
else {
$do_update_cat_order = 1;
}
$sql = "INSERT INTO ".CATEGORIES_TABLE."
(cat_name, cat_description, cat_parent_id, cat_order, auth_viewcat, auth_viewimage, auth_download, auth_upload, auth_directupload, auth_vote, auth_sendpostcard, auth_readcomment, auth_postcomment)
VALUES
('$cat_name', '$cat_description', $cat_parent_id, $cat_order, $auth_viewcat, $auth_viewimage, $auth_download, $auth_upload, $auth_directupload, $auth_vote, $auth_sendpostcard, $auth_readcomment, $auth_postcomment)";
$result = $site_db->query($sql);
$cat_id = $site_db->get_insert_id();
if ($result && $cat_id) {
if ($do_update_cat_order) {
update_cat_order($cat_parent_id);
}
$msg = $lang['cat_add_success'];
create_cat_folder(MEDIA_PATH."/".$cat_id, CHMOD_DIRS);
create_cat_folder(THUMB_PATH."/".$cat_id, CHMOD_DIRS);
}
else {
$msg = $lang['cat_add_error'];
}
/** End ADD **/
// echo $cat_name.' , ';
} // end FOR!
forward_to_modify($msg);
}DONE!
Acum puteti sa adaugati cate categorii/subcategorii dintr'un singur click. Cum ?
Simplu, in loc sa scrieti de ex: Bussines adaugati categoria, o luati de la cap cu "add category" , adaugati iar... etc... scrieti Categoriile/Subcat ca in sintaxa de mai jos: si le adaugati pe toate odata !!!
Cars|Bussines|Nature|Musical|Sports|Abstract|Art|People|Objects|Musical|Food|Edu
ation|Animated|Landscape|Funny|Holiday
-------------
Astfel de modificare am facut la Wordpres, RunCMS si Jupiter CMS. La orice script de acest gen se poate face modificare!
Acum stau si ma intreb: de ce dreaq nu se ofera posibilitatea asta nativa la nici un script cunoscut ???
*** Descrierea este identica ptr toate categoriile/subcat inscrise o singura data, dar puteti ulterior sa faceti ajustari cand aveti timp ptr descrieri!
Contact
Facebook
Twitter
RSS















