PDA

View Full Version : Multiple categories for users


2001174022
11-16-2007, 12:32 AM
I posted in a wrong place so i'll put it here :o


Hi,

I've checked that there's an awsome option called "categories" where writers can post just to an specified category, It's cool but...

what about if I want to let him post to 2, 3 or more categories?

I've changed the drop down menu into a multiple selection list buy the DB only catches the last selection, writing over and over the other categories.

how can i fix this?

original code as I remember
<select class="options" name="USER_category_id">
<option value="0"><vte:value select="{LNG_ADMIN_ALL_CATEGORIES}" /></option>
<vte:box module="box_sections">
<vte:params>
<vte:param name="id" value="0" />
<vte:param name="prefix" value="" />
</vte:params>
<vte:template>
<vte:foreach item = "category" from = "{categories}">
<vte:if test="{category.category_name} != ''">
<option value="{category.id}">
<vte:attribute name="selected">
<vte:if test="{user.category_id} = {category.id}">selected</vte:if>
</vte:attribute>
<vte:value select="{prefix}" />- <vte:value select="{category.category_name}" />
</option>
<vte:if test="{category.subcategories}">
<vte:load module="box_sections" id="{category.id}" template_string="{template_string}" prefix=" {prefix}" />
</vte:if>
</vte:if>
</vte:foreach>
</vte:template>
</vte:box>
</select>

new code edited
<select name="USER_category_id" size="15" multiple class="options">
<option value="0"><vte:value select="{LNG_ADMIN_ALL_CATEGORIES}" /></option>
<vte:box module="box_sections">
<vte:params>
<vte:param name="id" value="0" />
<vte:param name="prefix" value="" />
</vte:params>
<vte:template>
<vte:foreach item = "category" from = "{categories}">
<vte:if test="{category.category_name} != ''">
<option value="{category.id}">
<vte:attribute name="selected">
<vte:if test="{user.category_id} = {category.id}">selected</vte:if>
</vte:attribute>
<vte:value select="{prefix}" />- <vte:value select="{category.category_name}" />
</option>
<vte:if test="{category.subcategories}">
<vte:load module="box_sections" id="{category.id}" template_string="{template_string}" prefix=" {prefix}" />
</vte:if>
</vte:if>
</vte:foreach>
</vte:template>
</vte:box>
</select>

Micha
11-16-2007, 08:30 AM
Unfortunately this is not possible with editing only template from administration.
It would require lot of PHP coding and it is not so simple to do.

2001174022
11-16-2007, 08:29 PM
thank you micha, that is very sad!

I thought it was going to be much easier, as vivvo uses the categories for making the menu tree and I have some links (external and internal links) to pages added as categories, some categories that exist, are just links to those pages so, I don't want to let users to post in that categories. The only solution is to create a new menu by hand, i think.

Thank you anyways.