[3.2][BETA] Custom Code

A place for Extension Authors to post and receive feedback on Extensions still in development. No Extensions within this forum should be used within a live environment!
Suggested Hosts
Forum rules
READ: phpBB.com Board-Wide Rules and Regulations

IMPORTANT: Extensions Development rules

IMPORTANT FOR NEEDED EVENTS!!!
If you need an event for your extension please read this for the steps to follow to request the event(s)
TriKe27
Registered User
Posts: 18
Joined: Wed Feb 25, 2015 6:30 pm

Re: [RC] Custom Code

Post by TriKe27 » Fri Apr 15, 2016 7:32 pm

Hm that's sad. Were there bigger changes in the phpBB-Code or why is the plugin not usable anymore? Wish I could downgrade to 3.1.5 :(
Last edited by TriKe27 on Fri Apr 15, 2016 8:04 pm, edited 1 time in total.

User avatar
martti
Registered User
Posts: 684
Joined: Thu Jul 31, 2014 8:23 am
Location: Belgium

Re: [RC] Custom Code

Post by martti » Fri Apr 15, 2016 7:45 pm

TriKe27 wrote:Hm that's said. Were there bigger changes in the phpBB-Code or why is the plugin not usable anymore? Wish I could downgrade to 3.1.5 :(
The template engine got more strictly configured so that templates out of common paths could not be used anymore.
You can't keep hanging in 3.1.5. There's only going forward. The workaround is a clean solution.

TriKe27
Registered User
Posts: 18
Joined: Wed Feb 25, 2015 6:30 pm

Re: [RC] Custom Code

Post by TriKe27 » Fri Apr 15, 2016 8:39 pm

Damn it, found this plugin perfect for my usecase... Thank you!

User avatar
Puchahawa
Registered User
Posts: 768
Joined: Sat Jan 01, 2011 10:33 pm
Name: Randy

Re: [RC] Custom Code

Post by Puchahawa » Fri Apr 15, 2016 9:09 pm

Trike27 the work around that Martti talks about in this post. Works just fine. Only real difference is there isn't an interface in the ACP. I'm using it on 2 (3.1.8) forums for different things. If you were wanting to use the custom code the option is a great alternative, try it. :)
Avatar courtesy of artist Faith Coyotë

User avatar
GoBieN
Registered User
Posts: 530
Joined: Fri Mar 05, 2004 5:22 pm
Location: Belgium
Contact:

Re: [RC] Custom Code

Post by GoBieN » Fri Apr 15, 2016 10:16 pm

And you can just use the files already created by CustomCode in use them in inserttemplates

User avatar
John connor
Registered User
Posts: 1834
Joined: Fri Nov 14, 2014 5:14 pm
Location: U S Of A
Contact:

Re: [RC] Custom Code

Post by John connor » Tue Apr 26, 2016 12:45 pm

Hi. Having trouble centering an image in my footer. The code is in overall_footer_after.html.

This is my code:

Code: Select all

<div style="width: 100%;"><div style="display:table; margin: auto;"><!DOCTYPE html>
<html>
<body>
<a href="http://urlcheck.info/en/verify.htm?urlOrIP=http%3A%2F%2Fsystechforum.net" target="_blank" title="systechforum.net is classified as safe by urlCheck.info!"><img src="http://urlcheck.info/public/responsive/gfx/verifiedButton88x31b.png" alt="" /></a>
</body>
</html>
And this is the result:

Image

I searched all over the Internet to find a solution and I couldn't get this image centered at all. I tried two browsers and it looks the same.

User avatar
LadyAnna
Registered User
Posts: 97
Joined: Mon Feb 08, 2010 10:17 am
Location: Sweden
Name: Anna Broman

Re: [RC] Custom Code

Post by LadyAnna » Tue Apr 26, 2016 6:57 pm

There's no reason to have <!DOCTYPE html>, <html> and <body> tags (including their closing counterparts) in your code, those parts are already part of the rendered webpage your could would become part of when the page is compiled for viewing (the start codes are up in the overall_header.html and ends in overall_footer.html).

You also lack the closing </div> containers.

Try:

Code: Select all

<div style="width: 100%;text-align:center;">
<a href="http://urlcheck.info/en/verify.htm?urlOrIP=http%3A%2F%2Fsystechforum.net" target="_blank" title="systechforum.net is classified as safe by urlCheck.info!"><img src="http://urlcheck.info/public/responsive/gfx/verifiedButton88x31b.png" alt="" /></a>
</div>
I condensed it to use only one div, with the text-align attribute instead of margin:auto as you have in your second div container. The attribute margin:auto would only center the container, not its content. If the content is the full width of your container that would achieve the same though, assuming the container itself is narrower then the container it sits in.

User avatar
John connor
Registered User
Posts: 1834
Joined: Fri Nov 14, 2014 5:14 pm
Location: U S Of A
Contact:

Re: [RC] Custom Code

Post by John connor » Wed Apr 27, 2016 6:39 am

That worked! many thanks! I don't know much HTML or any code for that matter so I have to try and figure things out myself with code examples on the Internet. I have since removed the <html> and <body> tags from my other text in the footer.

User avatar
Paul
Infrastructure Team Leader
Infrastructure Team Leader
Posts: 24791
Joined: Sat Dec 04, 2004 3:44 pm
Location: The netherlands.
Name: Paul Sohier
Contact:

Re: [RC] Custom Code

Post by Paul » Tue May 10, 2016 9:02 am

As this extension does not meet the rules for the Extensions in development forum anymore, I am locking this topic.
Knock knock
Race condition
Who's there?

My BlogMy Photosmy phpBB Extensionscustom phpBB work & Development

User avatar
DavidIQ
Customisations Team Leader
Customisations Team Leader
Posts: 16785
Joined: Thu Jan 06, 2005 1:30 pm
Location: Fishkill, NY
Name: David Colón
Contact:

Re: [ABD] Custom Code

Post by DavidIQ » Sun Jun 10, 2018 4:20 pm

Restored topic and unlocked upon author's request. :ugeek:
Apply to become a Jr. Extension Validator
My extensions | In need of phpBB services? | Was I helpful today?
No unsolicited PMs unless you're planning on asking for paid help.

User avatar
martti
Registered User
Posts: 684
Joined: Thu Jul 31, 2014 8:23 am
Location: Belgium

Re: [3.2][BETA] Custom Code

Post by martti » Sun Jun 10, 2018 4:51 pm

Devlopment on this extension has restarted!

Version 2.0.0:
  • Is not blocking anymore (the previous version resulted in a white screen from phpBB v3.1.6 on).
  • The minimum requirements are raised to phpBB 3.2.1+ and PHP7+
  • The code editor makes now use of the CodeMirror Helper Extension
  • The templates are switched to "Twig style" internally. (You can still use the old template style if you wish in your "custom code").
ACP Editor:
Image

ACP Files list:
Image

Result rendered in the board:
Image

User avatar
Galixte de EzCom
Registered User
Posts: 955
Joined: Mon Oct 04, 2004 11:14 pm
Location: France
Name: Raphaël M.
Contact:

Re: [3.2][BETA] Custom Code

Post by Galixte de EzCom » Sun Jun 10, 2018 5:00 pm

Wonderfull! Thanks martti. ;)
Communau EzCom
📖 « Traductions d’extensions & styles pour phpBB 3.1.x & 3.2.x ».
📋 Lists of all extensions identified for phpBB 3.1.x & 3.2.x.
📋 Lists of all styles identified for phpBB 3.1.x & 3.2.x.

Image Tu as un forum et tu veux aussi un site web ? Regarde par ici.

User avatar
martti
Registered User
Posts: 684
Joined: Thu Jul 31, 2014 8:23 am
Location: Belgium

Re: [3.2][BETA] Custom Code

Post by martti » Sun Jun 10, 2018 9:43 pm

Update 2.0.1
Ths extension produces template variables itself for the query parameters of the current url.

For example you want to insert some content in the "Send password" page:

The url looks like this: http://my-domain.com/ucp.php?mode=sendpassword

Code: Select all

{#- content in "send password" page -#}

{%- if SCRIPT_NAME == 'ucp' and marttiphpbb_customcode.query.mode == 'sendpassword' -%}
This content shows on the "send password" page.
{%- endif -%}
See the 2nd post for more examples

User avatar
Galixte de EzCom
Registered User
Posts: 955
Joined: Mon Oct 04, 2004 11:14 pm
Location: France
Name: Raphaël M.
Contact:

Re: [3.2][BETA] Custom Code

Post by Galixte de EzCom » Sun Jun 10, 2018 10:17 pm

Do I need the Parameter Template Variables extension: https://github.com/marttiphpbb/phpbb-ext-paramtempvars or is it already inside the Custom Code extension?
Communau EzCom
📖 « Traductions d’extensions & styles pour phpBB 3.1.x & 3.2.x ».
📋 Lists of all extensions identified for phpBB 3.1.x & 3.2.x.
📋 Lists of all styles identified for phpBB 3.1.x & 3.2.x.

Image Tu as un forum et tu veux aussi un site web ? Regarde par ici.

User avatar
martti
Registered User
Posts: 684
Joined: Thu Jul 31, 2014 8:23 am
Location: Belgium

Re: [3.2][BETA] Custom Code

Post by martti » Mon Jun 11, 2018 5:14 am

Galixte de EzCom wrote:
Sun Jun 10, 2018 10:17 pm
Do I need the Parameter Template Variables extension: https://github.com/marttiphpbb/phpbb-ext-paramtempvars or is it already inside the Custom Code extension?
It is also available in Custom Code but not in version 2.0.0 (I forgot) and the format changed:

Before 2.0.0

Code: Select all

{%- if CUSTOMCODE_PARAM_PARAMETERNAME == 'value' -%}
   This is  only visible when you see "parametername=value" in the current url after the question mark (?).
    Like: https://my-domain.com/index.php?parametername=value
{%- endif -%}
2.0.0

Nothing

From 2.0.1

Code: Select all

{%- if marttiphpbb_customcode.query.parametername == 'value' -%}
    This is only visible when you see "parametername=value" in the current url after the question mark (?).
{%- endif -%}

Post Reply

Return to “Extensions in Development”

Who is online

Users browsing this forum: david63, Havym, Midway and 34 guests