• User Attivo

    implementazione addons

    Salve ragazzi, ho acquistato un mods per il sito che utilizzo io, ma ho un problema.

    questa mods permette all'amministratore del sito di pubblicare annunci per conto degli utenti iscritti sul sito, quindi dal lato dell'amministrazione.

    Il problema sorge quando dal lato amministrativo devo inserire la "regione" (sicilia, lombardia, ect), in quanto dal front-end l'utente sceglie prima la regione da un menù a tendina poi spunta un altro menù a tendina con le prov. e con lo stesso sistema il comune.

    Come dicevo prima dal back-end questo non avviene, vi posto il codice del file che secondo me crea il problema!

    {if !$submit_ok}
    <h5 class="memberarea_caption">{$catname}</h5>
    {/if}
    <script language="javascript">
    xajax_myFunction('{$reg_2_value}');
    xajax_myFunction('{$reg_3_value}');
    </script>
    <table border="0" cellspacing="1" width="100%">
    <tr>
    <td width="100%" valign="top">

    {if $errorMsg}
    <ol class="red">{$errorMsg}</ol>
    {/if}

    {if $submit_ok}

    {if $await_validation}
    <p>{$smarty.const.LA_VALIDATION_WAIT}</p>
    {/if}

    <h5 class="memberarea_caption">{$smarty.const.LA_CHOOSE}</h5>
    <div style="clear:both;height:12px;"></div>

    {if $picture_upload_enable}
    <br />
    <a href='{$url_to_upload}?pic_ad_id={$ad_id}' class="thumb">
    <img src="{$url}/layout_images/new/images.gif" align="Center" border="0" hspace="3" vspace="3" alt="{$smarty.const.LA_UPLOAD_VIDEO}"/>
    </a>
    <a href='{$url_to_upload}?pic_ad_id={$ad_id}'>
    {$smarty.const.LA_I_WANT}</a>
    {/if}

    {if $set_video_upload}
    <br />
    <a href='{$url_to_upload_video}?video_ad_id={$ad_id}' class="thumb">
    <img src="{$url}/layout_images/new/film.gif" align="left" border="0" hspace="3" vspace="3" alt="{$smarty.const.LA_UPLOAD_VIDEO}" > </a>
    <a href='{$url_to_upload_video}?video_ad_id={$ad_id}'>
    {$smarty.const.LA_UPLOAD_VIDEO}</a>
    {/if}

    {if $set_doc_upload}
    <br />
    <br />
    <a href='{$url_to_upload_doc}?doc_ad_id={$ad_id}' class="thumb">
    <img src="{$url}/layout_images/new/doc.gif" align="left" border="0" hspace="3" vspace="3" alt="{$smarty.const.LA_UPLOAD_DOC}" />
    </a>
    <a href='{$url_to_upload_doc}?doc_ad_id={$ad_id}'>
    {$smarty.const.LA_UPLOAD_DOC}</a>
    {/if}

    <br /><br />
    <a href='index.php' class="thumb">
    <img src="{$url}/layout_images/new/home_icon.gif" align="left" border="0" hspace="3" vspace="3" alt="{$smarty.const.LA_RET}" />
    </a><a href='index.php'>{$smarty.const.LA_RET}</a>
    <br /><br />
    <a href='choose_cat.php' class="thumb">
    <img src="{$url}/layout_images/new/addad.gif" align="left" border="0" hspace="3" vspace="3" alt="{$smarty.const.LA_ADD_AN}" />
    </a>
    <a href='choose_cat.php'>{$smarty.const.LA_ADD_AN}</a>
    <br />

    {/if}

    {if $pay_out_of_credits}
    <h4>{$smarty.const.LA_OUT_OF_CREDITS}</h4>
    {$smarty.const.LA_CREDITS_WARNING} <br />
    {$smarty.const.LA_CREDITS_WARNING2}
    <br /><br />{$smarty.const.LA_VISIT_OUR} <a href="payment_options.php"><u>{$smarty.const.LA_PAID_MEMBERSHIP}</u></a> {$smarty.const.LA_FOR_MORE_INFO}<br /><br />

    {/if}

    {if $show_form}

    {if $set_payments}
    <p style="background-color:white">
    {$smarty.const.LA_PAY_CREDITS_BAL} <b>{$pay_free_credits}</b> {$smarty.const.LA_PAY_CREDITS}<br />
    {$smarty.const.LA_PAY_COST} <b>{$pay_catcost}</b> {$smarty.const.LA_PAY_CREDITS}
    </p>
    <div style="clear:both;height:12px;"></div>
    {/if}

    <form method='post' action='{$phpself}' name="itemForm">
    <input type='hidden' name='ad_id' value='{$ad_id}'>
    <input type='hidden' name='update_rq' value='{$update_rq}'>
    {if !$ad_id}
    <input type='hidden' name='catid' value='{$catid}'>
    {/if}

    <table border="0" cellpadding="1" cellspacing="1" width="100%">
    {if $user_id and $admin_area}<input name=user_id value='{$user_id}' type='hidden'>{/if}
    {if $admin_area and !$user_id and !$ad_id}
    <tr>
    <td width="30%" valign="top">Enter new user details:<span class="red"></span></td>
    <td width="70%" valign="top">Name: <input name='new_user_name' value='' class="txt"> E-mail: <input name='new_user_email' value='' class="txt"></td>
    </tr>
    {/if}
    <tr>
    <td width="30%" valign="top">{$smarty.const.TITLE} <span class="red">
    </span></td>
    <td width="70%" valign="top">
    <input type="text" name="ad_title" size="39" maxlength="150" class="txt" value="{$ad_title}">
    </td>
    </tr>

    {if $set_region==1 && !$admin_region_options}
    <tr>
    <td width="30%" valign="top">{$smarty.const.LA_REGION} <span class="red">*</span></td>
    <td width="70%" valign="top">
    <select id="reg_1" name="reg_1" onChange='xajax_myFunction(reg_1.value)' class='regionselect'>
    {$reg_1_options}
    </select>

    <p><div id="DropDown2"></div></p>
    <p><div id="DropDown3"></div></p>

    </td>
    </tr>
    {elseif $admin_region_options}
    <tr>
    <td width="30%" valign="top">{$smarty.const.LA_REGION} <span class="red">*</span></td>
    <td width="70%" valign="top">
    <select id="admin_region_selected" onChange='xajax_myFunction(reg_1.value)' name="admin_region_selected" class='regionselect'>
    {$admin_region_options}
    </select>
    </td>
    </tr>

    {/if}

    <tr>
    <td width="30%" valign="top">{$smarty.const.DESCRIPTION} <span class="red">*</span></td>
    <td width="70%" valign="top"><textarea rows="7" id="ad_description" name="ad_description" cols="45">{$ad_description}</textarea>

    </td>
    </tr>

    {foreach item=e from=$extra_fields_array}

    {if $e.q_catdescr}
    <tr><td colspan="2">
    <b>{$e.q_catdescr}</b><hr style="color:black;" width="50%" align="left">
    </td></tr>
    {/if}

    <tr>
    <td valign="top">{$e.q_question} {if $e.q_mand}<span class="red">*</span>{/if}</td>
    <td valign="top">

    {if $e.q_type=="t"}

    <input type="text" name="e_{$e.q_field}" size="{$e.q_size}" value="{$e.q_value}" />

    {elseif $e.q_type=="p"}

    <input type="text" name="e_{$e.q_field}" size="7" value="{$e.q_value|replace:".":$decimal}" /> {$set_currency_text}

    {elseif $e.q_type=="d"}

    <textarea cols="{$e.q_size}" rows="{$e.q_size_2}" name="e_{$e.q_field}">{$e.q_value}</textarea>

    {elseif $e.q_type=="c"}
    {foreach item=opt from=$e.options}
    <input type="checkbox" name="e_{$e.q_field}[]" id="{$e.q_field}" value="{$opt.value}" {if $opt.selected_value} checked{/if}>
    {if $opt.$lang} {$opt.$lang|escape}{else}{$opt.text|escape}{/if} <br />
    {/foreach}

    {elseif $e.q_type=="s"}
    <select name="e_{$e.q_field}" class="txt">
    {if $e.q_mand}
    <option value=''>--</option>
    {else}
    <option value='0'>{$smarty.const.LA_EMPTY}</option>
    {/if}
    {foreach item=opt from=$e.options}
    <option value="{$opt.value}"{if $opt.selected_value} selected{/if}>{if $opt.$lang} {$opt.$lang|escape}{else}{$opt.text|escape}{/if}</option>
    {/foreach}
    </select>

    {elseif $e.q_type=="r"}

    {foreach item=opt from=$e.options}
    <input type="radio" name="e_{$e.q_field}[]" id="{$e.q_field}" value="{$opt.value}" {if $opt.selected_value} checked{/if}>
    {if $opt.$lang} {$opt.$lang|escape}{else}{$opt.text|escape}{/if} <br />
    {/foreach}

    {/if}

    </td>
    </tr>

    {/foreach}

    {if $ad_id}

    <tr>
    <td width="30%" valign="top">{$smarty.const.LA_CHANGE}</td>
    <td width="70%" valign="top"><select name='catid' class="txt">
    {$cat_list}
    </select>
    </td>
    </tr>

    {/if}

    {if $set_expire_days_option==1 && !$ad_id}
    <tr>
    <td width="30%" valign="top">{$smarty.const.LA_RUNDAYS} <font color=red>*</font></td>
    <td width="70%" valign="top"><select name="expire_days" class="txt">
    {$expire_list}
    </select>
    </td>
    </tr>
    {/if}

    <tr><td colspan="2">
    <p><input type='submit' name='submit' class='button' value='{$smarty.const.SUBMIT_BUTTON}'></p>
    </td>
    </tr>
    </table>
    </form>
    {/if}

    </td></tr></table>