Privacy policy/GDPR info code

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
Gawrion
Registered User
Posts: 1
Joined: Thu Feb 22, 2024 4:07 pm

Privacy policy/GDPR info code

Post by Gawrion »

Hey Guys.
I installed my phpBB and i wanted to customize privacy / GDPR info under "ucp.php?mode=privacy". I read that i have to find 'PRIVACY_POLICY' code in /language/pl/ucp.php and pase my custom policy cod there.

I want to use automatic privacy policy / GDPR info generated in tool: https://my.oodo.pl. I generate with this tool my snippet code, but after pasting this code into 'PRIVACY_POLICY' i got HTTP ERROR 500. My custom code is:

Code: Select all

$lang = array_merge($lang, array(
'TERMS_OF_USE_CONTENT' => '',
'PRIVACY_POLICY' => "<div id="myOodoPl-32-19-GQXc">Ładuję...</div><script>(function() { window.OodoPl = window.OodoPl || {}; OodoPl.config = OodoPl.config || []; OodoPl.config.push( { uid: 32, klauzid: 19, rand: 'GQXc', lang: 'pl', css: true } ); var script = document.createElement('script'); script.src = 'https://my.oodo.pl/pl/klauzula/32-19-GQXc'; script.async = true; var entry = document.getElementsByTagName('script')[0];
 entry.parentNode.insertBefore(script, entry); })();</script>",
));
Can someone help me? Can i paste this script code there? How to make this work?
Last edited by Mick on Fri Feb 23, 2024 9:00 am, edited 2 times in total.
Reason: Solved.
User avatar
thecoalman
Community Team Member
Community Team Member
Posts: 6626
Joined: Wed Dec 22, 2004 3:52 am
Location: Pennsylvania, U.S.A.

Re: Privacy policy/GDPR info code

Post by thecoalman »

If you are going to use double quotes to enclose a string and the the string has double quotes you need to escape them.

This:
'PRIVACY_POLICY' => "<div id="

Should be:
'PRIVACY_POLICY' => "<div id=\"

Repeat for the other double quotes except the one used to enclosed the string. Another thing you can do is just enclose it with single tick.

Just an FYI, whatever error you are encountering has probably been logged in the servers error log. Check there first in the future.
“Results! Why, man, I have gotten a lot of results! I have found several thousand things that won’t work.”

Attributed - Thomas Edison
Gawrion
Registered User
Posts: 1
Joined: Thu Feb 22, 2024 4:07 pm

Re: Privacy policy/GDPR info code

Post by Gawrion »

Thank You very much! It works! :)
I owe U beer!

https://stogi.tots.pl/ucp.php?mode=privacy
Last edited by Gawrion on Fri Feb 23, 2024 1:10 am, edited 1 time in total.

Return to “phpBB Custom Coding”