View Single Post
  #8  
Old 06-17-2015, 09:27 PM
Bastien's Avatar
Bastien Bastien is offline
 
Join Date: May 2015
Location: France
Posts: 70
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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
Reply With Quote
 
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01463 seconds
  • Memory Usage 1,780KB
  • Queries Executed 11 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD_SHOWPOST
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (2)bbcode_code
  • (1)bbcode_html
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_box
  • (1)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (1)post_thanks_postbit_info
  • (1)postbit
  • (1)postbit_onlinestatus
  • (1)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • reputationlevel
  • showthread
Included Files:
  • ./showpost.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_postinfo_query
  • fetch_postinfo
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showpost_start
  • bbcode_fetch_tags
  • bbcode_create
  • postbit_factory
  • showpost_post
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • showpost_complete