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>
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>