If I click on "Add URL" from within Category1/Category2, is there any way to have the Category field already filled out with this category name, instead of showing the category scroll bar? I am thinking I would just have to pass <%Category_ID%> along with add.cgi or something.
Jul 30, 2000, 6:53 PM
Veteran (17240 posts)
Jul 30, 2000, 6:53 PM
Post #2 of 5
Views: 1719
By default...add.cgi will only build the select list if the CategoryID is not found...like from the home page. But if you have to configure the following variable:
$LINKS{db_gen_category_list} = 1;
in the Links.pm in order for this to work.
Look at the following codes in the add.cgi file:
# If we don't have an id, and can't generate a list, let's send the user a message.
if (! $id and ! $LINKS{db_gen_category_list}) {
&site_html_error ( { error => "Please go to the category you want to add to, and click add from there." }, $dynamic);
}
else {
if ($id) {
$name = &get_category_name ($id);
$category = "$name <input type=hidden name='CategoryID' value='$id'>";
}
else {
$category = &get_category_list ();
}
&site_html_add_form ({ Category => $category, %in }, $dynamic)
}
Translation:
1) If there is NO ID and you have "turned on" (1) the $LINKS{db_gen_category_list}, then send an error message to the user stating that they have to select a category before adding a link.
2) If there is an hidden print the Category name and hidden field for the CategoryID field.
3) If $LINKS{db_gen_category_list}) is turned off and if a Category ID is not found, then print the drop-down menu of the Categories for the CategoryID field.
Regards,
Eliot
Code:
$LINKS{db_gen_category_list} = 1;
in the Links.pm in order for this to work.
Look at the following codes in the add.cgi file:
Code:
# If we don't have an id, and can't generate a list, let's send the user a message.
if (! $id and ! $LINKS{db_gen_category_list}) {
&site_html_error ( { error => "Please go to the category you want to add to, and click add from there." }, $dynamic);
}
else {
if ($id) {
$name = &get_category_name ($id);
$category = "$name <input type=hidden name='CategoryID' value='$id'>";
}
else {
$category = &get_category_list ();
}
&site_html_add_form ({ Category => $category, %in }, $dynamic)
}
Translation:
1) If there is NO ID and you have "turned on" (1) the $LINKS{db_gen_category_list}, then send an error message to the user stating that they have to select a category before adding a link.
2) If there is an hidden print the Category name and hidden field for the CategoryID field.
3) If $LINKS{db_gen_category_list}) is turned off and if a Category ID is not found, then print the drop-down menu of the Categories for the CategoryID field.
Regards,
Eliot