Set language to custom text on registration page

Need some custom code changes to the phpBB core simple enough that you feel doesn't require an extension? Then post your request here so that community members can provide some assistance.

NOTE: NO OFFICIAL SUPPORT IS PROVIDED IN THIS SUB-FORUM
Forum rules
READ: phpBB.com Board-Wide Rules and Regulations

NOTE: NO OFFICIAL SUPPORT IS PROVIDED IN THIS SUB-FORUM
loukas79
Registered User
Posts: 37
Joined: Sat Feb 11, 2023 1:47 pm

Set language to custom text on registration page

Post by loukas79 »

Good evening again and sorry if i bore you with my questions.
When new member registrations are defined by an administrator, on the registration page below the site name a text is displayed that says about the email and some information. When records are set to immediate without activation, then there is no text. I can edit the ucp_register.php file and write the text i want, but when additional languages ​​are installed, the text will appear in the written one and not change. Is there any way to insert such a setting somewhere and change the language in this text?
Last edited by thecoalman on Thu Aug 29, 2024 2:44 pm, edited 1 time in total.
Reason: Moved to custom coding.
User avatar
thecoalman
Community Team Member
Community Team Member
Posts: 6309
Joined: Wed Dec 22, 2004 3:52 am
Location: Pennsylvania, U.S.A.

Re: Set language to custom text on registration page

Post by thecoalman »

Generally speaking you would edit the text in the language files for both languages. For example if you open the template /styles/prosilver/template/index_body.html near the top you'll find L_MARK_FORUMS_READ The prefix L_ indicates it's text from the active language pack. You can search forMARK_FORUMS_READ in any language pack, in the English pack around line 426 of /language/en/common.php you'll find:

Code: Select all

	'MARK_FORUMS_READ'		=> 'Mark forums read',

There is going to be corresponding entry in every language pack so if you wanted to edit this entry just do it for each language pack. If it's custom entry you are adding just add it to each language pack and add the placeholder to the template.
“Results! Why, man, I have gotten a lot of results! I have found several thousand things that won’t work.”

Attributed - Thomas Edison
loukas79
Registered User
Posts: 37
Joined: Sat Feb 11, 2023 1:47 pm

Re: Set language to custom text on registration page

Post by loukas79 »

I find in the language file in the ucp.php file 'UCP_ADMIN_ACTIVATE' and next to it is the display text.
Now I want to create for my text on the registration screen something similar for direct registrations, eg 'UCP_FREE_ACTIVATE'. In which file and location should I place it except in the ucp of each language?
User avatar
ssl
Registered User
Posts: 1979
Joined: Sat Feb 08, 2020 2:15 pm
Location: Le Lude, Pays de la Loire - France
Name: Fred Rimbert

Re: Set language to custom text on registration page

Post by ssl »

Instead of modifying language files, you will lose these modifications with each phpBB version update, download this little extension

This extension allows you to modify language keys without modifying the original files. Open ./ext/caforum/language/language/en/lang.php and add your modified language keys
Sorry for my English ... I do my best! :anger_right:

:point_right_tone3: phpBB: 3.3.13 | PHP: 8.3.9
:point_right_tone4: [Kill spam on phpBB] - [Some French translation of extensions]
"Mistress, Mistress someone is bothering me in pm"
loukas79
Registered User
Posts: 37
Joined: Sat Feb 11, 2023 1:47 pm

Re: Set language to custom text on registration page

Post by loukas79 »

You might be confused about what I want to do. Below i show you two registration screens.
What I want to do is in the one that says "no activation" enter my own text that will change languages. My problem is that i can't find which file to first import the key that will show me the text
You do not have the required permissions to view the files attached to this post.
User avatar
ssl
Registered User
Posts: 1979
Joined: Sat Feb 08, 2020 2:15 pm
Location: Le Lude, Pays de la Loire - France
Name: Fred Rimbert

Re: Set language to custom text on registration page

Post by ssl »

Indeed, you have to modify basic files
Sorry for my English ... I do my best! :anger_right:

:point_right_tone3: phpBB: 3.3.13 | PHP: 8.3.9
:point_right_tone4: [Kill spam on phpBB] - [Some French translation of extensions]
"Mistress, Mistress someone is bothering me in pm"
User avatar
Mannix_
Registered User
Posts: 2004
Joined: Sun Oct 25, 2015 2:56 pm
Name: Matt

Re: Set language to custom text on registration page

Post by Mannix_ »

In ucp_register.html find

Code: Select all

	<!-- IF L_REG_COND -->
		<dl><dd><strong>{L_REG_COND}</strong></dd></dl>
	<!-- ENDIF -->
and change to

Code: Select all

<!-- IF L_REG_COND -->
		<dl><dd><strong>{L_REG_COND}</strong></dd></dl>
	<!-- ELSE -->
	 	<dl><dd><strong>YOUR TEXT</strong></dd></dl>	
	<!-- ENDIF -->
If you use more then one language on your board you can set up a custom language string in the /language/en/common.php and use that
Did I helped You? Consider a donation.
New version of phpBB has been released? My styles aren't validated for it yet? Check my page for the latest downloads!
loukas79
Registered User
Posts: 37
Joined: Sat Feb 11, 2023 1:47 pm

Re: Set language to custom text on registration page

Post by loukas79 »

Ok I made it. In the end it was much easier than i expected. For those interested in doing the same, we open the source file from prosilver "ucp_register.html" and find on line 31 "<h2>{SITENAME} - {L_REGISTRATION}</h2>"
Below that we add: <p><b>{L_YOUR_KEY}</b></p>
Then we enter the following in each language in the ucp.php file: 'L_YOUR_KEY' => 'Your text',

It works fine and I don't see any error. If you are a developer and think there is a security issue, please report.
User avatar
thecoalman
Community Team Member
Community Team Member
Posts: 6309
Joined: Wed Dec 22, 2004 3:52 am
Location: Pennsylvania, U.S.A.

Re: Set language to custom text on registration page

Post by thecoalman »

The error is that will appear under any under conditions. If you switch how registration is done remember to remove that line from the template. It's possible to make it conditional using the directions from Mannix_ Where he has YOUR TEXT change it to {L_YOUR_KEY}
“Results! Why, man, I have gotten a lot of results! I have found several thousand things that won’t work.”

Attributed - Thomas Edison
loukas79
Registered User
Posts: 37
Joined: Sat Feb 11, 2023 1:47 pm

Re: Set language to custom text on registration page

Post by loukas79 »

thecoalman wrote: Thu Aug 29, 2024 8:16 pm The error is that will appear under any under conditions. If you switch how registration is done remember to remove that line from the template. It's possible to make it conditional using the directions from Mannix_ Where he has YOUR TEXT change it to {L_YOUR_KEY}
Yes my friend, I know that if I change the activation method that particular configuration should be removed. I'll experiment with the Mannix_ method sometime tomorrow to see how it goes.
However, the community here is a college of knowledge, even in professional software i do not find such support.
Always be well and pass on your knowledge to us.
Thank you for everything.

Return to “phpBB Custom Coding”