Page 1 of 1

Location Field

Posted: Tue Jul 27, 2004 1:01 am
by StarionBoy
Is it possible to make it mandatory that the Location field be filled in when registering a new profile?? makes it easier when people have things for sale and also just makes it easier to know where different people are from.

Posted: Tue Jul 27, 2004 2:04 am
by decoy
u farken agree!

jrod? cam? anyone know how to code that?

Posted: Tue Jul 27, 2004 9:23 am
by jrod82
You will need to edit includes/usercp_register.php

Find the line that says :

Code: Select all

	else if ( $mode == 'register' )
	{
		if ( empty($username) || empty($new_password) || empty($password_confirm) || empty($email))
		{
			$error = TRUE;
			$error_msg .= ( ( isset($error_msg) ) ? '<br />' : '' ) . $lang['Fields_empty'];
		}
	}
see the line that says

Code: Select all

if ( empty($username) || empty($new_password) || empty($password_confirm) || empty($email))
?

This is the line that checks the mandatory fields are filled. You want to make location mandatory, so add in || empty($location) before the last bracket, and the line will look like this:

Code: Select all

if ( empty($username) || empty($new_password) || empty($password_confirm) || empty($email) || empty($location))
And that will work, and reject people who do not specify a location. But it won't show location with a * beside it - if I work that out I will let you know.

Deeks - BE VERY CAREFUL CHANGING THIS. DON'T BREAK THE FORUM :D

Posted: Tue Jul 27, 2004 9:52 am
by jrod82
..and to make a * appear beside Location, edit Templates\subSilver\profile_add_body.tpl

find this line:

Code: Select all

	  <td class="row1"><span class="gen">{L_LOCATION}:</span></td>
and change it to

Code: Select all

	  <td class="row1"><span class="gen">{L_LOCATION}: *</span></td>
(all we did there was add a star after it)

Posted: Tue Jul 27, 2004 6:05 pm
by decoy
hehe, ok ok ok, reelaaaaaaaaaax matty... dun fark nothing up now...

so this will work with new members signing up, and to get everyone here to add their location, i'll just delete every user who hasn't entered one!

Posted: Tue Jul 27, 2004 6:40 pm
by jrod82
or set their location as something highly offensive to force them to change it :D