PDA

View Full Version : Force Current Members To Fill Out Required Profile Field


craigvm
10-09-2012, 06:48 PM
hi does any1 know of a mod for vb4 to Force Current Members To Fill Out Required Profile Field like this mod for vb3 https://vborg.vbsupport.ru/showthread.php?t=82756

Simon Lloyd
10-10-2012, 06:57 AM
You shouldn't need a mod, just make it required always and editable, but you could redirect them on login if the filed is empty. in a plugin with glbal_complete as the hook:
if (THIS_SCRIPT != 'profile' AND $vbulletin->userinfo['fieldx']==''){
/* Redirect browser */
header("Location: http://www.yourwebsite.com/profile.php?do=editoptions");
exit;
}
this is redirecting to edit options assuming the profile field is there, replace fieldx for the actual profile field.

craigvm
12-23-2012, 09:02 PM
will that force existing members to fill out the required profile fields

Simon Lloyd
12-24-2012, 07:28 AM
Yes :)

craigvm
12-24-2012, 08:14 AM
Yes :)

thanks but how do i change that code to force them to fill out more than 1 field?

Simon Lloyd
12-24-2012, 08:19 AM
Probably change this lineif (THIS_SCRIPT != 'profile' AND $vbulletin->userinfo['fieldx']=='')forif (THIS_SCRIPT != 'profile' AND $vbulletin->userinfo['fieldx']=='' OR $vbulletin->userinfo['fieldx']=='')

craigvm
12-24-2012, 08:21 AM
i just done this and users cant login so had to disable it

Simon Lloyd
12-24-2012, 09:31 AM
Capture that they are not in login like thisif (!in_array(THIS_SCRIPT, array('profile','login') AND $vbulletin->userinfo['fieldx']=='' OR $vbulletin->userinfo['fieldx']=='')