[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!
Get Involved
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)
User avatar
david63
Registered User
Posts: 16330
Joined: Thu Dec 19, 2002 8:08 am
Location: Lancashire, UK
Name: David Wood
Contact:

Re: [RC] Custom Code

Post by david63 » Fri Sep 25, 2015 6:20 pm

thunderchero wrote:so if this extension was validated on 3.1.5 this still would have happened. and could happen to any extension already validated. while extension would still have validated status.
True, to some extent. An extension is validated against a specified version of phpBB and that is all. There is no guarantee that it will work with an earlier version (which will be true if events have been added), although that should be checked in the migration file, and there can never be any guarantee that any extension will work with future version of phpBB.

Incidentally this extension has not been released into the CDB so really non of this applies.

Having said all of that this is nothing new as the same thing applied to MODs.
David
Remember: You only know what you know and - you don't know what you don't know!
My CDB Contributions | How to install an extension
I will not be accepting translations for any of my extensions in Github - please post any translations in the appropriate topic.
No support requests via PM or email as they will be ignored

User avatar
umarizal
Registered User
Posts: 172
Joined: Mon Mar 17, 2008 2:03 am
Location: São Paulo - SP - Brasil
Name: Leandro dos Santos
Contact:

Re: [RC] Custom Code

Post by umarizal » Tue Sep 29, 2015 4:51 am

Can you tell if there is a forecast for when there will be a new version of the extension to make it compatible with the 3.1.6 version of phpBB?

Thank you! ;)
EN: Do to others what you would want them to do to you.
ES: Haz a los demás todo lo que quieras que te hagan a ti.
PT: Faça aos outros o que você gostaria que fizessem a você.

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

Re: [RC] Custom Code

Post by Puchahawa » Tue Sep 29, 2015 5:15 pm

From what martti has shared it may not be possible. He is looking into it to see if something can be done. In the mean time he came up with a workaround that worked for me and several others. You can find the info here:

viewtopic.php?p=14199116#p14199116
Avatar courtesy of artist Faith Coyotë

User avatar
umarizal
Registered User
Posts: 172
Joined: Mon Mar 17, 2008 2:03 am
Location: São Paulo - SP - Brasil
Name: Leandro dos Santos
Contact:

Re: [RC] Custom Code

Post by umarizal » Tue Sep 29, 2015 7:37 pm

I am very sad. This extension was perfect and is the most important of my forum.
EN: Do to others what you would want them to do to you.
ES: Haz a los demás todo lo que quieras que te hagan a ti.
PT: Faça aos outros o que você gostaria que fizessem a você.

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

Re: [RC] Custom Code

Post by Puchahawa » Tue Sep 29, 2015 7:42 pm

Don't give up. The work around is an extension that works fine. Easy to make the change. Martti may come up with something that works for custom code but in the mean time you can use the work around and get the same functioning.
Avatar courtesy of artist Faith Coyotë

User avatar
3Di
Former Team Member
Posts: 13921
Joined: Mon Apr 04, 2005 11:09 pm
Location: Milan (IT) Frankfurt (DE)
Name: Marco
Contact:

Re: [RC] Custom Code

Post by 3Di » Thu Oct 01, 2015 7:32 pm

martti wrote:I don't think it can be fixed. The path that templates can be added became limited and it is currently not possible to add extra paths.
Well, I would like to chime in just to ask a question, maybe stupid maybe not, considering the phpBB/pages extension does use the shipped styles folder.. why you don't? Maybe I am missing something, for sure.
Please PM me only to request paid works. Thx.
Want to compensate me for my interest? Donate
My development's activity º PhpStorm's proud user
Extensions, Scripts, MOD porting, Update/Upgrades
👨‍🏫 | Take a tour to | The Studio | 👨‍🏫

User avatar
Oyabun1
Former Team Member
Posts: 23162
Joined: Sun May 17, 2009 1:05 pm
Location: Australia
Name: Bill

Re: [RC] Custom Code

Post by Oyabun1 » Fri Oct 02, 2015 11:54 am

3Di wrote:Well, I would like to chime in just to ask a question, maybe stupid maybe not, considering the phpBB/pages extension does use the shipped styles folder.. why you don't? Maybe I am missing something, for sure.
It stores user content in the database, not the files. You can manually add template files to /styles/[i]whatever[/i]/template/, but the Pages extension doesn't write content to there itself.
                      Support Request Template
3.0.x: Knowledge Base Styles Support MOD Requests
3.1.x: Knowledge BaseStyles SupportExtension Requests

zorbas2
Registered User
Posts: 49
Joined: Fri Apr 02, 2010 5:51 am

Re: [RC] Custom Code

Post by zorbas2 » Fri Oct 02, 2015 12:06 pm

martti wrote:
KillBill. wrote: Idea change ext code:

1. you create new folder ext/marttiphpbb/customcode/styles/all/template/customcode
2. add info this folder change chmod 777
3. you change event/ all html include path
example
this
<!-- INCLUDE ../../../../../../store/customcode/overall_footer_after.html -->
replace
<!-- INCLUDE customcode/overall_footer_after.html -->
The disadvantages are:
  • It is not plug and play.
  • Data in the repository code. (You have to pay attention not to delete your custom code when updating).
  • Can not be validated.
For anyone that is using the Custom Code extension I propose the following solution/alternative:

Create your own private extension by modifying this little extension: https://github.com/marttiphpbb/phpbb-ex ... mplatecode

In the ext/marttiphpbb/inserttemplatecode/style/all/template/event directory you can put then any template events you like.
If you have created content with the Custom Code extension, you can copy the contents of the store/customcode directory and move it to ext/marttiphpbb/inserttemplatecode/style/all/template/event.
(If you had included other files with <!-- INCLUDE ../../../../../../ you have to remove the prefix ../../../../../../ to and put the included files in ext/marttiphpbb/inserttemplatecode/style/all/template)

Don't forget to clear the cache when you have edited something. Tip: whilst editing you can switch on the option Recompile stale style components in ACP > Load Settings. Then you don't need to clear the cache each time you change something. But for the sake of performance switch off this option after editing.

The disadvantage is that you loose the editor of the Custom Code extension in the ACP. But on the other hand it is more flexible as you can easily insert any template event possible. You are not limited by the set template events that was provided by the Custom Code extension.
You can use my extension Template Event Locations to see markers in the board of all template events available.
Image

Here are 2 extra little extensions that provide extra template variables (these were used in the previous examples):
Worked perfect for me! Thanks martti!
Will this extention stay compatible with future phpBB versions??

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

Re: [RC] Custom Code

Post by martti » Fri Oct 02, 2015 12:35 pm

zorbas2 wrote:Worked perfect for me! Thanks martti!
Will this extention stay compatible with future phpBB versions??
Yes, the Insert template code extension will be compatible with future phpBB versions.

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

Re: [RC] Custom Code

Post by John connor » Sat Oct 03, 2015 11:00 am

Just want to point out again you can just use Notepad ++ to edit your code.

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

Re: [RC] Custom Code

Post by GoBieN » Sat Oct 03, 2015 6:10 pm

Maybe it's an option to add a file editor to the insert template code extension? This file editor would just allow you to edit and save every template file that is present in the folder?

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

Re: [RC] Custom Code

Post by martti » Sat Oct 03, 2015 6:28 pm

GoBieN wrote:Maybe it's an option to add a file editor to the insert template code extension? This file editor would just allow you to edit and save every template file that is present in the folder?
Normally the server has no permission to store a file inside the extension folder. And, this extension is just a quick 'work around' (not new project). But ok if someone else would like to put effort into adding a file editor. (I don't miss it really; my favourite text editor is so much nicer to use.)

User avatar
thunderchero
Registered User
Posts: 129
Joined: Sun Nov 03, 2013 10:16 pm

Re: [RC] Custom Code

Post by thunderchero » Fri Oct 09, 2015 1:33 am

martti wrote:
zorbas2 wrote:Worked perfect for me! Thanks martti!
Will this extention stay compatible with future phpBB versions??
Yes, the Insert template code extension will be compatible with future phpBB versions.
martti wrote: this extension is just a quick 'work around' (not new project)
I wonder if phpbb would valadate "Insert template code extension" as is?

I don't think a file editor is needed either. also maybe simple is best for this extension? it is easy to use and very versatile as is.

User avatar
Solidjeuh
Registered User
Posts: 522
Joined: Wed Oct 06, 2010 11:20 pm
Location: Aalst / Belgium
Name: Andy Dm
Contact:

Re: [RC] Custom Code

Post by Solidjeuh » Fri Oct 09, 2015 2:36 am

Meta tags are not working? Or do I have to add those somewhere special?
I added the code in overall_header_body_before
But 2 weeks later the code was still not showing on Facebook posts..
I now added them back in the core files, and that works on Facebook..

Code: Select all

<link rel="shortcut icon" type="image/png" href="http://arcadeplaats.be/favicon.ico"/>
<meta name="description" content="Speel duizenden leuke flash games, Doe mee aan onze toernooien en daag andere leden uit voor een wedstrijd! Uren speel plezier gegarandeerd, en volledig gratis!" />
<meta name="keywords" content="Arcade, spelen, wedstrijd, vrienden, verveling, forum, vriendenkring, flash, stress, humor, kameraden, online, plezier" />
<meta name="author" content="Solidjeuh" />
<meta name="robots" content="index, follow" />
<meta property="og:title" content="~ Arcadeplaats ~ &bull; Portaal" /> 
<meta property="og:image" content="http://arcadeplaats.be/images/ledenuploads/1400586901.jpg" />
<head>
I don't suffer from insanity. I enjoy every minute of it.

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

Re: [RC] Custom Code

Post by Lumpy Burgertushie » Fri Oct 09, 2015 5:04 am

none of that goes before the opening <head> tag.
it should all be within the <head> tag will all the rest of the head section.

also, meta keywords are a complete waste of time. search engines do not pay any attention to them because they are so easy to spam with.

also, things added to the overall_header body before event won't show up in the head section because that event is after the opening <body> tag so that it would display on the actual web page instead of just being in the header.



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?

Post Reply

Return to “Extensions in Development”