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); }
show_input_row($lang['field_category_name'], "cat_name", "", $textinput_size);
show_input_row($lang['field_category_name_ext'], "cat_name", "", $textinput_size);
$lang['field_category_name'] = "Kategorie Name";
$lang['field_category_name_ext'] = "Kategorie Name<br /><span class=\"smalltext\">Es können mehrere Kategorien hinzugefügt werden.<br>Dann sind die Kategorie-Namen durch | zu trennen. z.B. Test1|Test2|Test3</span>";
$lang['field_category_name'] = "Category name";
$lang['field_category_name_ext'] = "Category name<br /><span class=\"smalltext\">You can add several categories.<br>Then you must separate category names through | . e.g. Test1|Test2|Test3</span>";