Page 41 of 52

Re: [RC] Custom Code

Posted: Thu Sep 17, 2015 5:59 pm
by Puchahawa
Workaround worked great for me too. Two boards both running 3.1.6

Re: [RC] Custom Code

Posted: Fri Sep 18, 2015 3:57 am
by buksida
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.

Re: [RC] Custom Code

Posted: Fri Sep 18, 2015 6:05 am
by John connor
The workaround with the other extension works. It's just you would have to edit your code in the files with Notepad ++.

Re: [RC] Custom Code

Posted: Fri Sep 18, 2015 12:12 pm
by Walther
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:

Re: [RC] Custom Code

Posted: Fri Sep 18, 2015 12:46 pm
by Walther
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.

Re: [RC] Custom Code

Posted: Fri Sep 18, 2015 1:11 pm
by Galixte de EzCom
Hi,

maybe you can try to put this code: <!-- INCLUDE ./ext/marttiphpbb/inserttemplatecode/style/all/template/.adsense-under-header.html -->.

Re: [RC] Custom Code

Posted: Wed Sep 23, 2015 12:31 am
by 10000fists
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.

Re: [RC] Custom Code

Posted: Wed Sep 23, 2015 1:39 am
by Galixte de EzCom
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.

Re: [RC] Custom Code

Posted: Wed Sep 23, 2015 6:49 am
by martti
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 -->

Re: [RC] Custom Code

Posted: Wed Sep 23, 2015 6:54 am
by martti
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.

Re: [RC] Custom Code

Posted: Wed Sep 23, 2015 6:12 pm
by Puchahawa
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. :)

Re: [RC] Custom Code

Posted: Wed Sep 23, 2015 6:52 pm
by Galixte de EzCom
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.

Re: [RC] Custom Code

Posted: Wed Sep 23, 2015 7:37 pm
by Puchahawa
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

Re: [RC] Custom Code

Posted: Thu Sep 24, 2015 7:06 am
by zpintar
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?

Re: [RC] Custom Code

Posted: Thu Sep 24, 2015 7:17 am
by martti
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.