Adding Location as required field at registration

Get help with installation and running phpBB 3.0.x here. Please do not post bug reports, feature requests, or MOD-related questions here.
Suggested Hosts
Forum rules
END OF SUPPORT: 1 January 2017 (announcement)
TheExoticFishDOTcom
I've Been Banned!
Posts: 88
Joined: Sun Mar 23, 2008 8:11 pm
Contact:

Re: Adding Location as required field at registration

Post by TheExoticFishDOTcom » Wed Mar 26, 2008 6:28 pm

I just removed the code, I have no idea what's wrong.

User avatar
Barry 441
Registered User
Posts: 215
Joined: Tue Sep 14, 2004 5:09 pm
Location: Colrain, Massachusetts

Re: Adding Location as required field at registration

Post by Barry 441 » Tue Apr 01, 2008 12:29 am

I'll probably end up doing the same
Keep it fun.
StacyRacing.com

Margie
Registered User
Posts: 7
Joined: Wed Dec 19, 2007 10:04 pm

Re: Adding Location as required field at registration

Post by Margie » Thu Apr 03, 2008 10:01 am

Is there any way to add a line of commentary to the registration form?

http://theolive-branch.org

Dr_Halo
Registered User
Posts: 3
Joined: Tue Dec 11, 2007 12:51 am

Re: Adding Location as required field at registration

Post by Dr_Halo » Mon Apr 21, 2008 9:22 pm

remeber to CLEAR the CACHE ;)

amrosm
Registered User
Posts: 9
Joined: Sat Nov 16, 2002 4:13 am

Re: Adding Location as required field at registration

Post by amrosm » Sun May 11, 2008 1:03 am

5min simple solution for 3.0.1

To solve this problem all I did was create custom fields for everything by going to
ACP-->Users and Groups-->Custom Profile Fields. (create new custom fields and set them as required, also recreate fields like location for example and make it required)


Comment out the all field areas in ucp_profile_profile_info.html with the <!--comment-->
code. While comment is what you're commenting out. Or you can just plain delete it but I feel less intrusive by commenting.

If you scroll thru the code you will notice:


<!-- IF ERROR --><p class="error">{ERROR}</p><!-- ENDIF -->
<!--
<dl>

--Lots of code that we don't want--

<!-- ENDIF -->


-->
<!-- BEGIN profile_fields -->

What's in red is all I added. I even did that from the Styles tab in ACP.




Code: Select all

<!-- INCLUDE ucp_header.html -->

<form id="ucp" method="post" action="{S_UCP_ACTION}"{S_FORM_ENCTYPE}>

<h2>{L_TITLE}</h2>

<div class="panel">
	<div class="inner"><span class="corners-top"><span></span></span>
	<p>{L_PROFILE_INFO_NOTICE}</p>


	<fieldset>
	<!-- IF ERROR --><p class="error">{ERROR}</p><!-- ENDIF -->
<!--
	<dl>
		<dt><label for="icq">{L_UCP_ICQ}:</label></dt>
		<dd><input type="text" name="icq" id="icq" maxlength="15" value="{ICQ}" class="inputbox" /></dd>
	</dl>
	<dl>
		<dt><label for="aim">{L_UCP_AIM}:</label></dt>
		<dd><input type="text" name="aim" id="aim" maxlength="255" value="{AIM}" class="inputbox" /></dd>
	</dl>
	<dl>
		<dt><label for="msn">{L_UCP_MSNM}:</label></dt>
		<dd><input type="text" name="msn" id="msn" maxlength="255" value="{MSN}" class="inputbox" /></dd>
	</dl>
	<dl>
		<dt><label for="yim">{L_UCP_YIM}:</label></dt>
		<dd><input type="text" name="yim" id="yim" maxlength="255" value="{YIM}" class="inputbox" /></dd>
	</dl>
	<dl>
		<dt><label for="jabber">{L_UCP_JABBER}:</label></dt>
		<dd><input type="text" name="jabber" id="jabber" maxlength="255" value="{JABBER}" class="inputbox" /></dd>
	</dl>
	<dl>
		<dt><label for="website">{L_WEBSITE}:</label></dt>
		<dd><input type="text" name="website" id="website" maxlength="255" value="{WEBSITE}" class="inputbox" /></dd>
	</dl>
	<dl>
		<dt><label for="location">{L_LOCATION}:</label></dt>
		<dd><input type="text" name="location" id="location" maxlength="255" value="{LOCATION}" class="inputbox" /></dd>
	</dl>
	<dl>
		<dt><label for="occupation">{L_OCCUPATION}:</label></dt>
		<dd><textarea name="occupation" id="occupation" class="inputbox" rows="3" cols="30">{OCCUPATION}</textarea></dd>
	</dl>
	<dl>
		<dt><label for="interests">{L_INTERESTS}:</label></dt>
		<dd><textarea name="interests" id="interests" class="inputbox" rows="3" cols="30">{INTERESTS}</textarea></dd>
	</dl>
	<!-- IF S_BIRTHDAYS_ENABLED -->
		<dl>
			<dt><label for="bday_day">{L_BIRTHDAY}:</label><br /><span>{L_BIRTHDAY_EXPLAIN}</span></dt>
			<dd>
				<label for="bday_day">{L_DAY}: <select name="bday_day" id="bday_day" style="width: 4em;">{S_BIRTHDAY_DAY_OPTIONS}</select></label> 
				<label for="bday_month">{L_MONTH}: <select name="bday_month" id="bday_month" style="width: 4em;">{S_BIRTHDAY_MONTH_OPTIONS}</select></label> 
				<label for="bday_year">{L_YEAR}: <select name="bday_year" id="bday_year" style="width: 6em;">{S_BIRTHDAY_YEAR_OPTIONS}</select></label>
			</dd>
		</dl>
	<!-- ENDIF -->


-->
	<!-- BEGIN profile_fields -->





		<dl>
			<dt><label<!-- IF profile_fields.FIELD_ID --> for="{profile_fields.FIELD_ID}"<!-- ENDIF -->>{profile_fields.LANG_NAME}:<!-- IF profile_fields.S_REQUIRED --> *<!-- ENDIF --></label>
			<!-- IF profile_fields.LANG_EXPLAIN --><br /><span>{profile_fields.LANG_EXPLAIN}</span><!-- ENDIF --></dt>
			<!-- IF profile_fields.ERROR --><dd class="error">{profile_fields.ERROR}</dd><!-- ENDIF -->
			<dd>{profile_fields.FIELD}</dd>
		</dl>
	<!-- END profile_fields -->
	</fieldset>

	<span class="corners-bottom"><span></span></span></div>
</div>

<fieldset class="submit-buttons">
	{S_HIDDEN_FIELDS}<input type="reset" value="{L_RESET}" name="reset" class="button2" />&nbsp; 
	<input type="submit" name="submit" value="{L_SUBMIT}" class="button1" />
	{S_FORM_TOKEN}
</fieldset>
</form>

<!-- INCLUDE ucp_footer.html -->

EDIT: sorry I made a few edits to better place the comment tags.
-- Miro --

postie
Registered User
Posts: 18
Joined: Sun Jul 12, 2009 8:32 pm
Contact:

Re: Adding Location as required field at registration

Post by postie » Mon Aug 02, 2010 12:33 pm

I've just tried the solution Milosbabic and I M Lost suggested on page 1... and it works a treat!

I've adjusted this bit of code though :

Code: Select all

// Location Required For Registration
            'location'         => array('string', false, 5, 60),
// Location Required For Registration
To this:

Code: Select all

// Location Required For Registration
            'location'         => array('string', false, 2, 60),
// Location Required For Registration
The 5 in the first bit of code forces a minimum 5 letter location. Many of my users want to only put UK, so I changed it to reflect the 2 letters minimum needed.

But this has solved a long standing problem on my site where users weren't completing their profiles. Even after we introduced a compulsory custom field for location on registration, it didn't show up on the memberslist where members were from (it only showed on their profile page), because the main profile wasn't filled in.

Hope that helps someone else :D

loloelpalomero
Registered User
Posts: 4
Joined: Wed Sep 22, 2010 7:47 pm

Re: Adding Location as required field at registration

Post by loloelpalomero » Thu Sep 30, 2010 8:50 pm

Which would be the variable changes for "occupation"? Just should I change "location" by "occupation" in codes given before?

User avatar
stevemaury
Support Team Member
Support Team Member
Posts: 50812
Joined: Thu Nov 02, 2006 12:21 am
Location: The U.P.
Name: Steve
Contact:

Re: Adding Location as required field at registration

Post by stevemaury » Thu Sep 30, 2010 9:31 pm

Yes.
For REALLY good and VERY inexpensive hosting CLICK HERE

I can stop all your spam. I can upgrade or update your Board. PM or email me. (Paid support)

loloelpalomero
Registered User
Posts: 4
Joined: Wed Sep 22, 2010 7:47 pm

Re: Adding Location as required field at registration

Post by loloelpalomero » Thu Sep 30, 2010 10:30 pm

Done. Works like a charm. Thanks!

markbacks
Registered User
Posts: 17
Joined: Tue Dec 07, 2010 3:20 am

Re: Adding Location as required field at registration

Post by markbacks » Mon Dec 20, 2010 4:44 pm

i know this is an old topic but i need to fix my problem, i made all this to add an extra field to the register form but when i send the register form i get the next error:

Error General
SQL ERROR [ mysql4 ]

Unknown column 'user_rut' in 'field list' [1054]

Ocurrió un error SQL mientras recuperaba esta página. Por favor contacte con La Administración del Sitio si el problema persiste.



some help¡

markbacks
Registered User
Posts: 17
Joined: Tue Dec 07, 2010 3:20 am

Re: Adding Location as required field at registration

Post by markbacks » Mon Dec 20, 2010 4:50 pm

pufff my fault, i didnt create the field in the table phpbb_users, problem fixed and new field working, thanks.

pixelkicker
Registered User
Posts: 17
Joined: Sat Jan 29, 2011 7:28 pm

Re: Adding Location as required field at registration

Post by pixelkicker » Thu Feb 10, 2011 4:10 am

Hi all, this is exactly what I have been looking for. Thank you for this.

Quick question in regards to applying this to other fields. I am trying to do this for the 'website' field. Should I also just replace 'location' with 'website' in the code instructions?

What about this bit in the ucp/ucp_register.php:

Code: Select all

// Location Required For Registration
               'user_from'            => $data['location'],
// Location Required For Registration'
What does 'user_from' do? Should that be changed to 'user_website' ?

Thanks!

Chauncey1
Registered User
Posts: 17
Joined: Tue Oct 29, 2013 3:23 pm

Re: Adding Location as required field at registration

Post by Chauncey1 » Wed Nov 06, 2013 3:35 pm

Hi, This thread is a few years old now.

Forgive my noobness but, is there away to make the IP and location sync for members as part of a requirement? We get a load of people using various IP anonymousers from trolls who've already been banned that want to hid themselves but, I don't want it on admins and moderators. In fact, I wish the forum would stop posting the IP's of admins and moderators even in the ACP.

What's the best way to search for members by location?

User avatar
stevemaury
Support Team Member
Support Team Member
Posts: 50812
Joined: Thu Nov 02, 2006 12:21 am
Location: The U.P.
Name: Steve
Contact:

Re: Adding Location as required field at registration

Post by stevemaury » Wed Nov 06, 2013 4:00 pm

There is no necessary correlation between IP address and location. For example, the satellite ISPs could at one time assign an IP to a user in Florida and the next day assign it to a user in California.
For REALLY good and VERY inexpensive hosting CLICK HERE

I can stop all your spam. I can upgrade or update your Board. PM or email me. (Paid support)

User avatar
Lumpy Burgertushie
Registered User
Posts: 66741
Joined: Mon May 02, 2005 3:11 am
Contact:

Re: Adding Location as required field at registration

Post by Lumpy Burgertushie » Wed Nov 06, 2013 4:24 pm

and currently my IP address puts me over 200 miles away from where I actually am.

basing anyting on the accuracy of IP addresses is pretty much a waste of time.


robert
I'm baaaaaccckkkk. still doing work on donation basis. PM your needs.

Premium phpBB 3.2 Styles by PlanetStyles.net

If a tree falls in the forest and nobody is there, does it make a sound?

Locked

Return to “[3.0.x] Support Forum”