Jump to content
TNG Community

SOLVED: How would I remove 'https://' from website field and hide 'Phone' on new account form please?


Treenz

Recommended Posts

Hi All, would anyone know how to remove the 'https://' value from the website field on the newaccount form please?

I can see the value entered into the newacctform but want to ensure this was the correct place or is there someway to do this in custconfig file? I don't want to cause myself more work than required during an upgrade.

I also wondered if there was anyway to hide 'Phone' and 'Postcode' from the same form as we don't want to use these for our members.

Appreciate any assistance.

Link to comment
Share on other sites

Assume this is the New User form, not New Account.  The website field is for users who have their own website, if not, it is optional.  I don't use it, nor generally the Phone either.  So essentially you are wishing to shorten the form since you don't want to enter this data?  Those fields are optional in any event.

Ron

 

Link to comment
Share on other sites

I'm not sure why you'd want to hide the https:// value? As to the others, I have my own mod that gets rid of the fields that I don't want displayed on the registration form. This is the code and you could adjust it to hide just what you want hidden (it just comments out the lines rather than deletes them). Happy for anyone to tell me how to improve my code.

********************************************************************************
%target:newacctform.php%
**** This hides unwanted information that is currently required for registration ****
%location:%
<tr><td><?php echo $text['phone']; ?>:</td><td><input type="text" name="phone" size="30" maxlength="30" /></td></tr>
%end:%
%trimreplace:%
<!-- <tr><td><?php echo $text['phone']; ?>:</td><td><input type="text" name="phone" size="30" maxlength="30" /></td></tr> -->		
%end:%


********************************************************************************
%target:newacctform.php%
**** This hides unwanted information that is currently required for registration ****
%location:%
		<tr><td><?php echo $text['website']; ?>:</td><td><input type="text" name="website" size="50" maxlength="100" value="https://" /></td></tr>
		<tr><td><?php echo $text['address']; ?>:</td><td><input type="text" name="address" size="50" maxlength="100" /></td></tr>
		<tr><td><?php echo $text['city']; ?>:</td><td><input type="text" name="city" size="50" maxlength="64" /></td></tr>
		<tr><td><?php echo $text['state']; ?>:</td><td><input type="text" name="state" size="50" maxlength="64" /></td></tr>
		<tr><td><?php echo $text['zip']; ?>:</td><td><input type="text" name="zip" size="20" maxlength="10" /></td></tr>
		<tr><td><?php echo $text['country']; ?>:</td><td><input type="text" name="country" size="50" maxlength="64" /></td></tr>
%end:%
%trimreplace:%
<!--	<tr><td><?php echo $text['website']; ?>:</td><td><input type="text" name="website" size="50" maxlength="100" value="https://" /></td></tr> -->
<!--	<tr><td><?php echo $text['address']; ?>:</td><td><input type="text" name="address" size="50" maxlength="100" /></td></tr> -->
<!--	<tr><td><?php echo $text['city']; ?>:</td><td><input type="text" name="city" size="50" maxlength="64" /></td></tr> -->
<!--	<tr><td><?php echo $text['state']; ?>:</td><td><input type="text" name="state" size="50" maxlength="64" /></td></tr> -->
<!--	<tr><td><?php echo $text['zip']; ?>:</td><td><input type="text" name="zip" size="20" maxlength="10" /></td></tr> -->
<!--	<tr><td><?php echo $text['country']; ?>:</td><td><input type="text" name="country" size="50" maxlength="64" /></td></tr> -->
%end:%

 

Link to comment
Share on other sites

1 hour ago, tngrlkrz said:

Assume this is the New User form, not New Account.  The website field is for users who have their own website, if not, it is optional.  I don't use it, nor generally the Phone either.  So essentially you are wishing to shorten the form since you don't want to enter this data?  Those fields are optional in any event.

Ron

 

Hi Ron, it is the newacctform.php on our site clanhuntergenealogy.com/newacctform.php

I only want to hide phone and postcode. I want to reuse website for something else and just change the label the user sees.

Hope that makes sense.

Link to comment
Share on other sites

22 minutes ago, Philip Roy said:

I'm not sure why you'd want to hide the https:// value? As to the others, I have my own mod that gets rid of the fields that I don't want displayed on the registration form. This is the code and you could adjust it to hide just what you want hidden (it just comments out the lines rather than deletes them). Happy for anyone to tell me how to improve my code.

********************************************************************************
%target:newacctform.php%
**** This hides unwanted information that is currently required for registration ****
%location:%
<tr><td><?php echo $text['phone']; ?>:</td><td><input type="text" name="phone" size="30" maxlength="30" /></td></tr>
%end:%
%trimreplace:%
<!-- <tr><td><?php echo $text['phone']; ?>:</td><td><input type="text" name="phone" size="30" maxlength="30" /></td></tr> -->		
%end:%


********************************************************************************
%target:newacctform.php%
**** This hides unwanted information that is currently required for registration ****
%location:%
		<tr><td><?php echo $text['website']; ?>:</td><td><input type="text" name="website" size="50" maxlength="100" value="https://" /></td></tr>
		<tr><td><?php echo $text['address']; ?>:</td><td><input type="text" name="address" size="50" maxlength="100" /></td></tr>
		<tr><td><?php echo $text['city']; ?>:</td><td><input type="text" name="city" size="50" maxlength="64" /></td></tr>
		<tr><td><?php echo $text['state']; ?>:</td><td><input type="text" name="state" size="50" maxlength="64" /></td></tr>
		<tr><td><?php echo $text['zip']; ?>:</td><td><input type="text" name="zip" size="20" maxlength="10" /></td></tr>
		<tr><td><?php echo $text['country']; ?>:</td><td><input type="text" name="country" size="50" maxlength="64" /></td></tr>
%end:%
%trimreplace:%
<!--	<tr><td><?php echo $text['website']; ?>:</td><td><input type="text" name="website" size="50" maxlength="100" value="https://" /></td></tr> -->
<!--	<tr><td><?php echo $text['address']; ?>:</td><td><input type="text" name="address" size="50" maxlength="100" /></td></tr> -->
<!--	<tr><td><?php echo $text['city']; ?>:</td><td><input type="text" name="city" size="50" maxlength="64" /></td></tr> -->
<!--	<tr><td><?php echo $text['state']; ?>:</td><td><input type="text" name="state" size="50" maxlength="64" /></td></tr> -->
<!--	<tr><td><?php echo $text['zip']; ?>:</td><td><input type="text" name="zip" size="20" maxlength="10" /></td></tr> -->
<!--	<tr><td><?php echo $text['country']; ?>:</td><td><input type="text" name="country" size="50" maxlength="64" /></td></tr> -->
%end:%

 

Hi Philip, do you mind if I ask where and how do you use that code? Do you have a whole mod you install or do you amend one of the php files on your site?

We want to ask users for their Facebook profile and preferred contact method not website, phone, postcode. Re-label Address to Facebook profile so it also shows to other users on the tree information and relabel website to Preferred Contact Method that only shows to admins via user account. Hope that makes sense.

Thanks

Link to comment
Share on other sites

Sorry, my mistake.   I was looking at my (heavily) customized site in which I have already removed those fields from the registration aka new account form. Philip has the right instructions to remove the fields you wish.

Ron

Link to comment
Share on other sites

2 minutes ago, Treenz said:

Hi Philip, do you mind if I ask where and how do you use that code?

That code is from a mod that I created for my own site. So you have two options...

1. Create a mod yourself and use the code I have given you in the mod - https://tng.lythgoes.net/wiki/index.php/Mod_Manager_-_Creating_Config_Files

That way, any time there are changes or updates to TNG, you can uninstall the mod, apply the changes and then reinstall the mod....which saves you manually having to edit code every time.

2. Manually edit code. Everything you need is in there're in the mod code, but let me give you an example from that code, done the manual way...

  • Keep a backup of the file newacctform.php
  • Open the file in text or code editor
  • Find the line that says....
<tr><td><?php echo $text['phone']; ?>:</td><td><input type="text" name="phone" size="30" maxlength="30" /></td></tr>
  • Change that line to...
<!-- <tr><td><?php echo $text['phone']; ?>:</td><td><input type="text" name="phone" size="30" maxlength="30" /></td></tr> -->
  • Save the file
  • You have now commented out that line and it won't be displayed on the form when people register. You can do this with other lines on the form that you want to hide.

Basically creating a mod/config file means you don't have to keep manually doing this in the future.

Link to comment
Share on other sites

3 minutes ago, Philip Roy said:

That code is from a mod that I created for my own site. So you have two options...

1. Create a mod yourself and use the code I have given you in the mod - https://tng.lythgoes.net/wiki/index.php/Mod_Manager_-_Creating_Config_Files

That way, any time there are changes or updates to TNG, you can uninstall the mod, apply the changes and then reinstall the mod....which saves you manually having to edit code every time.

2. Manually edit code. Everything you need is in there're in the mod code, but let me give you an example from that code, done the manual way...

  • Keep a backup of the file newacctform.php
  • Open the file in text or code editor
  • Find the line that says....
<tr><td><?php echo $text['phone']; ?>:</td><td><input type="text" name="phone" size="30" maxlength="30" /></td></tr>
  • Change that line to...
<!-- <tr><td><?php echo $text['phone']; ?>:</td><td><input type="text" name="phone" size="30" maxlength="30" /></td></tr> -->
  • Save the file
  • You have now commented out that line and it won't be displayed on the form when people register. You can do this with other lines on the form that you want to hide.

Basically creating a mod/config file means you don't have to keep manually doing this in the future.

Thank you very much Philip, I get the manual change now you have explained it, but I will give creating a mod a go and hopefully I'll be successful with that :)

Link to comment
Share on other sites

Thank you, I managed to do the mod like you suggested.

It wouldn't work when I took items out of the 2nd location section, nor did it work when I just had one location section with phone, zip and website in it.

I split them into 3 location sections and now working as I wanted and I learnt something new today!

Thanks again

Link to comment
Share on other sites

  • Treenz changed the title to SOLVED: How would I remove 'https://' from website field and hide 'Phone' on new account form please?

Thank you, I have done that.

Also to remove the https:// I did not hide the website field I changed it to the following instead.

<tr><td><?php echo $text['website']; ?>:</td><td><input type="text" name="website" size="50" maxlength="100" value="" /></td></tr>
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...