[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!
Scam Warning
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
Lumpy Burgertushie
Registered User
Posts: 66471
Joined: Mon May 02, 2005 3:11 am
Contact:

Re: [RC] Custom Code

Post by Lumpy Burgertushie » Sun Sep 13, 2015 5:49 am

I don't know much about how to create extensions at all, but I always wondered why you put all the html files in the store folder to begin with. I don't think other extensions do that , do they?


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?

User avatar
Sniper_E
Registered User
Posts: 782
Joined: Wed May 09, 2007 12:18 am
Location: Shreveport, Louisiana
Name: Ed Humphrey
Contact:

Re: [RC] Custom Code

Post by Sniper_E » Sun Sep 13, 2015 5:54 am

@ martti, I'm sorry your extension is having this problem with 3.1.6

I wish you good luck straighten it out and keeping this fine extension working.
Image
No is NEVER an Option and NEVER is the only Option when it comes to Giving Up!
:!: Sniper_E Styles | phpbbmodders :!:

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

Re: [RC] Custom Code

Post by martti » Sun Sep 13, 2015 6:01 am

Lumpy Burgertushie wrote:I don't know much about how to create extensions at all, but I always wondered why you put all the html files in the store folder to begin with. I don't think other extensions do that , do they?


robert
Because the store folder is writeable and the ext folder is not. And the files in the store/customcode directory is user content/data and isn't clearly part of the extension code itself.

User avatar
KillBill.
Registered User
Posts: 596
Joined: Tue Jun 02, 2009 4:07 pm
Contact:

Re: [RC] Custom Code

Post by KillBill. » Sun Sep 13, 2015 10:04 am

martti wrote:
Lumpy Burgertushie wrote:I don't know much about how to create extensions at all, but I always wondered why you put all the html files in the store folder to begin with. I don't think other extensions do that , do they?


robert
Because the store folder is writeable and the ext folder is not. And the files in the store/customcode directory is user content/data and isn't clearly part of the extension code itself.
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 -->

User avatar
david63
Registered User
Posts: 16319
Joined: Thu Dec 19, 2002 8:08 am
Location: Lancashire, UK
Name: David Wood
Contact:

Re: [RC] Custom Code

Post by david63 » Sun Sep 13, 2015 10:12 am

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
That idea, whilst good, would not get past validation.

It is not allowed to add/delete/modify files within an extension. The way that it is handled at the moment is, as I understand it, the correct way. The issue is to resolve the Twig change (which may be a bug)
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
Raul [ThE KuKa]
Style Customisations
Style Customisations
Posts: 6166
Joined: Mon Dec 08, 2003 9:24 pm
Location: Spain
Name: Raul Arroyo
Contact:

Re: [RC] Custom Code

Post by Raul [ThE KuKa] » Sun Sep 13, 2015 10:29 am

Users,
This extension not works on 3.1.6 version, please disable extension BEFORE update to 3.1.6 version please.
All unsolicited PMs will be ignored.
:warning: Knowledge Base | Documentation | Board rules | phpBB Styles Rules & Policies :warning:


If you like my styles, translations, etc. and want to show some appreciation, then feel free to Donate with Image
:flag_es: phpBB Spain - Online Since 2003 :heart:



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

Re: [RC] Custom Code

Post by martti » Sun Sep 13, 2015 11:12 am

Raul [ThE KuKa] wrote:Users,
This extension not works on 3.1.6 version, please disable extension BEFORE update to 3.1.6 version please.
This warning is put in the first post now.

User avatar
Mauron
Registered User
Posts: 342
Joined: Wed Jul 16, 2014 11:25 am

Re: [RC] Custom Code

Post by Mauron » Sun Sep 13, 2015 11:13 am

Galixte de EzCom wrote:Go in PhpMyAdmin, in table phpbb_ext, in column ext_name search the line marttiphpbb/customcode, in the column ext_active for the corresponding line found change the value 1 to 0.
martti wrote:If you are not logged in the ACP then delete the styles directory from the extension first. (under ext/marttiphpbb/customcode/) Then the board should work again.
Both these solutions don't work (I'm using a local test board anyway, so MEH).

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

Re: [RC] Custom Code

Post by martti » Sun Sep 13, 2015 11:15 am

Mauron wrote:
Galixte de EzCom wrote:Go in PhpMyAdmin, in table phpbb_ext, in column ext_name search the line marttiphpbb/customcode, in the column ext_active for the corresponding line found change the value 1 to 0.
martti wrote:If you are not logged in the ACP then delete the styles directory from the extension first. (under ext/marttiphpbb/customcode/) Then the board should work again.
Both these solutions don't work (I'm using a local test board anyway, so MEH).
Also delete the contents of the cache directory.

User avatar
Mauron
Registered User
Posts: 342
Joined: Wed Jul 16, 2014 11:25 am

Re: [RC] Custom Code

Post by Mauron » Sun Sep 13, 2015 11:24 am

martti wrote:Also delete the contents of the cache directory.
Thanks, it worked now.

For reference, I didn't delete all the cache but the one file the error pointed out:

Code: Select all

Fatal error: Uncaught exception 'Twig_Error_Loader' with message 'Unable to find template "@marttiphpbb_customcode/event/overall_header_head_append.html" (looked into: ) in "overall_header.html" at line 63.' in xxx\yyy\phpBB\vendor\twig\twig\lib\Twig\Loader\Filesystem.php:195 Stack trace: #0 xxx\yyy\phpBB\phpbb\template\twig\loader.php(107): Twig_Loader_Filesystem->findTemplate('@marttiphpbb_cu...') #1 xxx\yyy\phpBB\vendor\twig\twig\lib\Twig\Loader\Filesystem.php(138): phpbb\template\twig\loader->findTemplate('@marttiphpbb_cu...') #2 xxx\yyy\phpBB\vendor\twig\twig\lib\Twig\Environment.php(266): Twig_Loader_Filesystem->getCacheKey('@marttiphpbb_cu...') #3 xxx\yyy\phpBB\vendor\twig\twig\lib\Twig\Environment.php(324): Twig_Environment->getTemplateClass('@marttiphpbb_cu...', NULL) #4 xxx\yyy\phpBB\phpbb\template\twig\environment.php(166): Twig_Environment->loadTemplate('@marttiphpbb_cu...', NULL) #5 xxx\yyy\phpBB\cache\twig\c\e\ce0d92172b651115f5888a88e54bb33c8a2c8244acaaa909db6bdfacd0ffc390.php(26 in xxx\yyy\phpBB\vendor\twig\twig\lib\Twig\Loader\Filesystem.php on line 195
So I went and just deleted phpBB\cache\twig\c\e\ce0d92172b651115f5888a88e54bb33c8a2c8244acaaa909db6bdfacd0ffc390.php.

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

Re: [RC] Custom Code

Post by martti » Sun Sep 13, 2015 11:55 am

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):
Last edited by martti on Sun Sep 13, 2015 6:52 pm, edited 4 times in total.

MarieNatalie
Registered User
Posts: 46
Joined: Tue May 05, 2015 1:19 pm
Location: Athens Greece
Name: Maria

Re: [RC] Custom Code

Post by MarieNatalie » Sun Sep 13, 2015 12:54 pm

martti wrote:This extension does not work on the phpBB 3.1.6 version, please disable extension BEFORE update to 3.1.6 version.
Could you please tell us... just disable or and DELETE data?

Thanks in advance

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

Re: [RC] Custom Code

Post by martti » Sun Sep 13, 2015 12:56 pm

MarieNatalie wrote:
martti wrote:This extension does not work on the phpBB 3.1.6 version, please disable extension BEFORE update to 3.1.6 version.
Could you please tell us... just disable or and DELETE data?

Thanks in advance
Disable.

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 » Sun Sep 13, 2015 1:54 pm

I noticed in phpbb update that auto update still is merging files
So would it not be easyer to just edit the code files like before?
Or am I mistaking?
I don't suffer from insanity. I enjoy every minute of it.

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

Re: [RC] Custom Code

Post by martti » Sun Sep 13, 2015 2:01 pm

Solidjeuh wrote:I noticed in phpbb update that auto update still is merging files
So would it not be easyer to just edit the code files like before?
Or am I mistaking?
It's always better to have a clean separation between the core and anything else, imho.

Post Reply

Return to “Extensions in Development”