To make a pulldown with the categories use the following php:
PHP Code:
$catsql = mysql_query("SELECT category_id, category_name FROM " . table_categories . " WHERE category_lang='$dblang' ORDER BY category_name ASC");
$categories = array();
while ($rows = mysql_fetch_array ($catsql, MYSQL_ASSOC)) array_push ($categories, $rows);
$main_smarty->assign('categories', $categories);
include_once(mnminclude.'dbtree.php');
$array = tree_to_array(0, table_categories, FALSE);
$main_smarty->assign('lastspacer', 0);
$main_smarty->assign('cat_array', $array);
And this in the template:
PHP Code:
<select name="category">
{section name=thecat loop=$cat_array}
<option value = "{$cat_array[thecat].auto_id}">
{if $cat_array[thecat].spacercount lt $lastspacer}{$cat_array[thecat].spacerdiff|repeat_count:''}{/if}
{if $cat_array[thecat].spacercount gt $lastspacer}{/if}
{$cat_array[thecat].spacercount|repeat_count:' '}
{$cat_array[thecat].name}
{assign var=lastspacer value=$cat_array[thecat].spacercount}
</option>
{/section}
</select>
This is in submit.php and submit_step_2.tpl in the yget template if you want to see it in use.
Patrick