That's why I do it
--------------- Added [DATE]1434660501[/DATE] at [TIME]1434660501[/TIME] ---------------
I get an other problem.
So I get this in newthread
which is, in HTML :
HTML Code:
<label for="subject" class="full">Produit concern? :</label>
<select name="produit">
<option value="" selected="selected">Faites votre choix</option>
<option value="1" style="font-weight:bold; background:#EBEBE6">Platre</option>
<option value="2">Classe I - de Paris</option>
<option value="3">classe III</option>
<option value="4">classe IV</option>
<option value="5" style="font-weight:bold; background:#EBEBE6">CFAO</option>
<option value="6">Scanner 3D</option>
<option value="7">Imprimante 3D</option>
<option value="8" style="font-weight:bold; background:#EBEBE6">Moteurs</option>
<option value="9">Pi?ce ? main</option>
<option value="11">Turbine</option>
<option value="12">Aspirations</option>
<option value="13">avion</option>
<option value="15" style="font-weight:bold; background:#EBEBE6">C?ramique</option>
</select>
I would like to force the user, to select a product when creating a new thread, so I created a hook linked to
newthread_form_complete :
Code:
if(THIS_SCRIPT == newthread AND $post['produit'] == '')
{
$errors[] = $vbphrase["force_produit_error"];
}
but it doesn't return an error if the user has not touched at the select box.
Could someone help me ?
--------------- Added [DATE]1434661051[/DATE] at [TIME]1434661051[/TIME] ---------------
Solved !
The hook used has to be linked to newpost_process
--------------- Added [DATE]1434661142[/DATE] at [TIME]1434661142[/TIME] ---------------
Not solved
It always display the error, even if the select box is filled ...
--------------- Added [DATE]1434662169[/DATE] at [TIME]1434662169[/TIME] ---------------
I added in a hook linked to newthread_start :
Code:
$vbulletin->input->clean_array_gpc('p', array(
'produit' => TYPE_STR));
$newpost['produit'] =& $vbulletin->GPC['produit'];
It seems to be good

I just need to restrict it to the wanted forum now