[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
Puchahawa
Registered User
Posts: 768
Joined: Sat Jan 01, 2011 10:33 pm
Name: Randy

Re: [RC] Custom Code

Post by Puchahawa » Thu Sep 17, 2015 5:59 pm

Workaround worked great for me too. Two boards both running 3.1.6
Avatar courtesy of artist Faith Coyotë

buksida
Registered User
Posts: 308
Joined: Thu Feb 04, 2010 9:11 am

Re: [RC] Custom Code

Post by buksida » Fri Sep 18, 2015 3:57 am

Confirmed workaround working. Would be grand to see the Custom Code extension upgraded to work again though - it is very handy and obviously a lot of people are using it.

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

Re: [RC] Custom Code

Post by John connor » Fri Sep 18, 2015 6:05 am

The workaround with the other extension works. It's just you would have to edit your code in the files with Notepad ++.

User avatar
Walther
Registered User
Posts: 269
Joined: Fri Jul 09, 2004 5:21 pm
Location: The Netherlands

Re: [RC] Custom Code

Post by Walther » Fri Sep 18, 2015 12:12 pm

Luckily i had backup for the vendor map.
So now I have 3.1.6 running with the 'old' vendor contents :shock:
oh man, best extension ever... phpBB.com just proved a change is not always an improvement :evil:

User avatar
Walther
Registered User
Posts: 269
Joined: Fri Jul 09, 2004 5:21 pm
Location: The Netherlands

Re: [RC] Custom Code

Post by Walther » Fri Sep 18, 2015 12:46 pm

martti wrote:...

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)

...
Wait a moment.

With customcode mod:
I have now for example the file .adsense-under-header.html in the forum/store/customcode map
The overall_header_content_before.html in the same location contains therefore

Code: Select all

<!-- INCLUDE ../../../../../../store/customcode/.adsense-under-header.html -->
With the inserttemplatecode mod:
  • i should move the .adsense-under-header.html to the ext/marttiphpbb/inserttemplatecode/style/all/template location
  • edit the overall_header_content_before.html in the ext/marttiphpbb/inserttemplatecode/styles/all/template/event to resemble

    Code: Select all

    <!-- INCLUDE ext/marttiphpbb/inserttemplatecode/style/all/template/.adsense-under-header.html -->
    -- or -- just

    Code: Select all

    <!-- INCLUDE .adsense-under-header.html -->
    ?
I'm always fighting with relative and absolute paths :?

Sure hope you find the strength to update the customcode mod to work with 3.1.6, it was a breeze working with it :D
Please reanimate.

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

Re: [RC] Custom Code

Post by Galixte de EzCom » Fri Sep 18, 2015 1:11 pm

Hi,

maybe you can try to put this code: <!-- INCLUDE ./ext/marttiphpbb/inserttemplatecode/style/all/template/.adsense-under-header.html -->.
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
10000fists
Registered User
Posts: 30
Joined: Fri Aug 28, 2015 9:58 pm

Re: [RC] Custom Code

Post by 10000fists » Wed Sep 23, 2015 12:31 am

martti,
For the inserttemplatecode extension:
https://github.com/marttiphpbb/phpbb-ex ... mplatecode
\ext\marttiphpbb\inserttemplatecode\styles\all\template\event\overall_footer_body_after.html contains a "My content ..." on line #6 which is displayed at the bottom of a topic page.

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

Re: [RC] Custom Code

Post by Galixte de EzCom » Wed Sep 23, 2015 1:39 am

Hi,
10000fists wrote:martti,
For the inserttemplatecode extension:
https://github.com/marttiphpbb/phpbb-ex ... mplatecode
\ext\marttiphpbb\inserttemplatecode\styles\all\template\event\overall_footer_body_after.html contains a "My content ..." on line #6 which is displayed at the bottom of a topic page.
after first installation of this extension, the code in this event file is a demo you can edit /remove it.
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: 764
Joined: Thu Jul 31, 2014 8:23 am
Location: Belgium

Re: [RC] Custom Code

Post by martti » Wed Sep 23, 2015 6:49 am

Walther wrote:
martti wrote:...

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)

...
Wait a moment.

With customcode mod:
I have now for example the file .adsense-under-header.html in the forum/store/customcode map
The overall_header_content_before.html in the same location contains therefore

Code: Select all

<!-- INCLUDE ../../../../../../store/customcode/.adsense-under-header.html -->
With the inserttemplatecode mod:
  • i should move the .adsense-under-header.html to the ext/marttiphpbb/inserttemplatecode/style/all/template location
  • edit the overall_header_content_before.html in the ext/marttiphpbb/inserttemplatecode/styles/all/template/event to resemble

    Code: Select all

    <!-- INCLUDE ext/marttiphpbb/inserttemplatecode/style/all/template/.adsense-under-header.html -->
    -- or -- just

    Code: Select all

    <!-- INCLUDE .adsense-under-header.html -->
    ?
I'm always fighting with relative and absolute paths :?

Sure hope you find the strength to update the customcode mod to work with 3.1.6, it was a breeze working with it :D
Please reanimate.
The second option should work:

Code: Select all

<!-- INCLUDE .adsense-under-header.html -->

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

Re: [RC] Custom Code

Post by martti » Wed Sep 23, 2015 6:54 am

Galixte de EzCom wrote:Hi,
10000fists wrote:martti,
For the inserttemplatecode extension:
https://github.com/marttiphpbb/phpbb-ex ... mplatecode
\ext\marttiphpbb\inserttemplatecode\styles\all\template\event\overall_footer_body_after.html contains a "My content ..." on line #6 which is displayed at the bottom of a topic page.
after first installation of this extension, the code in this event file is a demo you can edit /remove it.
Yes, you can remove all files here and just use the event files you need.
Here you can find the list and the Template Events extension shows you the actual locations.

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

Re: [RC] Custom Code

Post by Puchahawa » Wed Sep 23, 2015 6:12 pm

martti wrote:Yes, you can remove all files here and just use the event files you need.
Here you can find the list and the Template Events extension shows you the actual locations.
Just a reminder, if you uploaded the template events ext with all the events THEN remove the ones that you aren't using, be sure to purge the boards cache or it will throw an error. :)
Avatar courtesy of artist Faith Coyotë

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

Re: [RC] Custom Code

Post by Galixte de EzCom » Wed Sep 23, 2015 6:52 pm

Hi,
Puchahawa wrote:
martti wrote:Yes, you can remove all files here and just use the event files you need.
Here you can find the list and the Template Events extension shows you the actual locations.
Just a reminder, if you uploaded the template events ext with all the events THEN remove the ones that you aren't using, be sure to purge the boards cache or it will throw an error. :)
from this extension you do not remove any files. It’s an extension to inform you where the template event are activated.
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
Puchahawa
Registered User
Posts: 768
Joined: Sat Jan 01, 2011 10:33 pm
Name: Randy

Re: [RC] Custom Code

Post by Puchahawa » Wed Sep 23, 2015 7:37 pm

Galixte de EzCom wrote:Hi,
from this extension you do not remove any files. It’s an extension to inform you where the template event are activated.
Your right my error. I was referring to removing the un-needed event html files from the insertemplatecode extension - styles / all / template / events folder in reference to
martti wrote:Yes, you can remove all files here and just use the event files you need.
thanks for clarifying that. :D
Avatar courtesy of artist Faith Coyotë

User avatar
zpintar
Registered User
Posts: 30
Joined: Fri Jan 18, 2013 8:51 am
Location: Croatia
Name: Žarko Pintar
Contact:

Re: [RC] Custom Code

Post by zpintar » Thu Sep 24, 2015 7:06 am

Hello martti,

At first - thank you for this great extension! :)

I need it for inserting some custom icons in profile area of topic.
So, I needed one event what isn't on your list of events: viewtopic_body_contact_fields_after

And, I looked at directory: ext/marttiphpbb/customcode/styles/all/template/event, manually add new event file with name viewtopic_body_contact_fields_after.html and filled them with this code:

Code: Select all

<!-- IF U_CUSTOMCODE_VIEWTOPIC_BODY_CONTACT_FIELDS_AFTER -->
<a class="customcode-event" href="{U_CUSTOMCODE_VIEWTOPIC_BODY_CONTACT_FIELDS_AFTER}">viewtopic_body_contact_fields_after</a>
<!-- ENDIF -->
<!-- IF S_CUSTOMCODE -->
<!-- INCLUDE ../../../../../../store/customcode/viewtopic_body_contact_fields_after.html -->
<!-- ENDIF -->
Previously I create file viewtopic_body_contact_fields_after.html in ACP -> Extensions -> Custom Code -> Files and put some code there.

It's works nicely!

Conclusion: Maybe you can add some simply way to add custom events in this extension as users needs?

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

Re: [RC] Custom Code

Post by martti » Thu Sep 24, 2015 7:17 am

zpintar wrote:Hello martti,

At first - thank you for this great extension! :)

I need it for inserting some custom icons in profile area of topic.
So, I needed one event what isn't on your list of events: viewtopic_body_contact_fields_after

And, I looked at directory: ext/marttiphpbb/customcode/styles/all/template/event, manually add new event file with name viewtopic_body_contact_fields_after.html and filled them with this code:

Code: Select all

<!-- IF U_CUSTOMCODE_VIEWTOPIC_BODY_CONTACT_FIELDS_AFTER -->
<a class="customcode-event" href="{U_CUSTOMCODE_VIEWTOPIC_BODY_CONTACT_FIELDS_AFTER}">viewtopic_body_contact_fields_after</a>
<!-- ENDIF -->
<!-- IF S_CUSTOMCODE -->
<!-- INCLUDE ../../../../../../store/customcode/viewtopic_body_contact_fields_after.html -->
<!-- ENDIF -->
Previously I create file viewtopic_body_contact_fields_after.html in ACP -> Extensions -> Custom Code -> Files and put some code there.

It's works nicely!

Conclusion: Maybe you can add some simply way to add custom events in this extension as users needs?
Mind the extension became incompatible with phpBB 3.1.6. See previous posts and first post for a workaround.

Post Reply

Return to “Extensions in Development”