[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!
Anti-Spam Guide
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
martti
Registered User
Posts: 752
Joined: Thu Jul 31, 2014 8:23 am
Location: Belgium

Re: [RC] Custom Code

Post by martti » Fri Oct 09, 2015 5:32 am

Solidjeuh wrote: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>
Use overall_header_stylesheets_after.html

overall_header_body_before is inside the <body>

User avatar
Galixte de EzCom
Registered User
Posts: 1028
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 Oct 09, 2015 1:06 pm

@Solidjeuh,

use instead, overall_header_head_append.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
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 1:14 pm

I use that mostly for the Facebook share image
But not working now haha

So, overall_header_stylesheets_after.html or overall_header_head_append.html ? :roll:
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 » Fri Oct 09, 2015 1:19 pm

Solidjeuh wrote:I use that mostly for the Facebook share image
But not working now haha

So, overall_header_stylesheets_after.html or overall_header_head_append.html ? :roll:
Either of them. They're both inside <head>. overall_header_head_append.html is before the stylesheets and overall_header_stylesheets_after.html after the stylesheets.

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 1:30 pm

martti wrote:
Solidjeuh wrote:I use that mostly for the Facebook share image
But not working now haha

So, overall_header_stylesheets_after.html or overall_header_head_append.html ? :roll:
Either of them. They're both inside <head>. overall_header_head_append.html is before the stylesheets and overall_header_stylesheets_after.html after the stylesheets.
Ok thank you! gonna try
I don't suffer from insanity. I enjoy every minute of it.

Vastatio
Registered User
Posts: 5
Joined: Fri Aug 07, 2015 7:51 am

Re: [RC] Custom Code

Post by Vastatio » Wed Nov 11, 2015 11:45 am

Hi

I need to set open graph tag. My idea was to set a standard image but not for some Topics.
All Topics with some text inside the title need to have different image.

How I can set in IF statement a strpos() function or similar behaviour.

ex

Code: Select all

<!-- IF SCRIPT_NAME == 'viewtopic' and TOPIC_TITLE ????  -->
.....
<!-- ELSE -->
......
<!-- ENDIF -->
Thanks

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 » Wed Nov 11, 2015 2:03 pm

The extension Custom Code will be replaced by Insert Template Code?

Ask because the Custom Code is essential to my forum, for all the money obtained to finance domain, hosting, people involved, etc., comes from advertising, inserted using the Custom Code Extension, however, this has not (or will not) support in 3.1.5 version and above, if I remember correctly.

So, I wonder of a possible replacement of the Custom Code for Insert Template Code.

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
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 » Thu Nov 12, 2015 9:56 am

umarizal wrote:The extension Custom Code will be replaced by Insert Template Code?
Read the first post in this topic.
                      Support Request Template
3.0.x: Knowledge Base Styles Support MOD Requests
3.1.x: Knowledge BaseStyles SupportExtension Requests

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

Re: [RC] Custom Code

Post by John connor » Thu Nov 12, 2015 11:32 am

Hey Martti, you made this code for me to play audio to banned members, but now it seems it won't work. Perhaps this is a 3.1.6 issue? It played before and now I just noticed this trying 4 browsers and changing the audio from MP3 to Ogg. Nothing worked. Not sure what to make of this. The code is in the overall_footer_after.html.

Code: Select all

<!-- play requiem for the banned -->

<!-- IF SCRIPT_NAME == 'ucp' and CUSTOMCODE_PARAM_MODE == 'login' -->

<audio src="https://mysite.com/images/banned.mp3"></audio>

<script>
$(document).ready( function() {
  window.setTimeout( function() {
    if ($('div#message > div.inner > p > em').text().indexOf('A ban has been issued') >= 0){
      $('audio')[0].play();
    }
  }, 100);
});

</script>

<!-- ENDIF -->

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 Nov 13, 2015 12:05 pm

Vastatio wrote:Hi

I need to set open graph tag. My idea was to set a standard image but not for some Topics.
All Topics with some text inside the title need to have different image.

How I can set in IF statement a strpos() function or similar behaviour.

ex

Code: Select all

<!-- IF SCRIPT_NAME == 'viewtopic' and TOPIC_TITLE ????  -->
.....
<!-- ELSE -->
......
<!-- ENDIF -->
Thanks
I don't think the template engine has such functionality.

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 Nov 13, 2015 12:21 pm

John connor wrote:Hey Martti, you made this code for me to play audio to banned members, but now it seems it won't work. Perhaps this is a 3.1.6 issue? It played before and now I just noticed this trying 4 browsers and changing the audio from MP3 to Ogg. Nothing worked. Not sure what to make of this. The code is in the overall_footer_after.html.

Code: Select all

<!-- play requiem for the banned -->

<!-- IF SCRIPT_NAME == 'ucp' and CUSTOMCODE_PARAM_MODE == 'login' -->

<audio src="https://mysite.com/images/banned.mp3"></audio>

<script>
$(document).ready( function() {
  window.setTimeout( function() {
    if ($('div#message > div.inner > p > em').text().indexOf('A ban has been issued') >= 0){
      $('audio')[0].play();
    }
  }, 100);
});

</script>

<!-- ENDIF -->
  • Is the language in your board still English? See that the script searches for the string 'A ban has been issued'
  • Do you see that the page tries to load the audio? For example you can inspect this with Firebug in Firefox.
The script can be improved, by the way, because you're not limited anymore to certain events. When you use event overall_footer_body_after.html you can forget about the SetTimeout function, because the event is located after jQuery:

Edit : overall_footer_body_after.html

Code: Select all

<!-- play requiem for the banned -->

<!-- IF SCRIPT_NAME == 'ucp' and CUSTOMCODE_PARAM_MODE == 'login' -->

<audio src="https://mysite.com/images/banned.mp3"></audio>

<script>
$(document).ready( function() {
    if ($('div#message > div.inner > p > em').text().indexOf('A ban has been issued') >= 0){
      $('audio')[0].play();
    }
});

</script>

<!-- ENDIF -->

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 » Fri Nov 13, 2015 7:07 pm

Oyabun1 wrote:
umarizal wrote:The extension Custom Code will be replaced by Insert Template Code?
Read the first post in this topic.
For me it is not clear.
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
martti
Registered User
Posts: 752
Joined: Thu Jul 31, 2014 8:23 am
Location: Belgium

Re: [RC] Custom Code

Post by martti » Fri Nov 13, 2015 7:16 pm

umarizal wrote:
Oyabun1 wrote:
umarizal wrote:The extension Custom Code will be replaced by Insert Template Code?
Read the first post in this topic.
For me it is not clear.
The Custom Code no longer works with phpBB 3.1.6.
Insert Template Code is a quick fix for those who were relying on the the functionality of the Custom Code extension. Insert Template Code is actually nothing more than an empty extension that you can use to fill with whatever template events you wish.

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 » Fri Nov 13, 2015 9:07 pm

martti wrote:
umarizal wrote:
Oyabun1 wrote:
umarizal wrote:The extension Custom Code will be replaced by Insert Template Code?
Read the first post in this topic.
For me it is not clear.
The Custom Code no longer works with phpBB 3.1.6.
Insert Template Code is a quick fix for those who were relying on the the functionality of the Custom Code extension. Insert Template Code is actually nothing more than an empty extension that you can use to fill with whatever template events you wish.
Do is compatible with

The Insert Template Code extension is compatible with the latest version of phpBB? It will be compatible with new versions (forecast)?

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
John connor
Registered User
Posts: 2179
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 Nov 14, 2015 10:57 pm

martti wrote:
John connor wrote:Hey Martti, you made this code for me to play audio to banned members, but now it seems it won't work. Perhaps this is a 3.1.6 issue? It played before and now I just noticed this trying 4 browsers and changing the audio from MP3 to Ogg. Nothing worked. Not sure what to make of this. The code is in the overall_footer_after.html.

Code: Select all

<!-- play requiem for the banned -->

<!-- IF SCRIPT_NAME == 'ucp' and CUSTOMCODE_PARAM_MODE == 'login' -->

<audio src="https://mysite.com/images/banned.mp3"></audio>

<script>
$(document).ready( function() {
  window.setTimeout( function() {
    if ($('div#message > div.inner > p > em').text().indexOf('A ban has been issued') >= 0){
      $('audio')[0].play();
    }
  }, 100);
});

</script>

<!-- ENDIF -->
  • Is the language in your board still English? See that the script searches for the string 'A ban has been issued'
  • Do you see that the page tries to load the audio? For example you can inspect this with Firebug in Firefox.
The script can be improved, by the way, because you're not limited anymore to certain events. When you use event overall_footer_body_after.html you can forget about the SetTimeout function, because the event is located after jQuery:

Edit : overall_footer_body_after.html

Code: Select all

<!-- play requiem for the banned -->

<!-- IF SCRIPT_NAME == 'ucp' and CUSTOMCODE_PARAM_MODE == 'login' -->

<audio src="https://mysite.com/images/banned.mp3"></audio>

<script>
$(document).ready( function() {
    if ($('div#message > div.inner > p > em').text().indexOf('A ban has been issued') >= 0){
      $('audio')[0].play();
    }
});

</script>

<!-- ENDIF -->
Okay, I had the code in overall_footer_after.html so I added it to overall_footer_body_after.html and delted from the other file, cleared the cache and all I see load is the following:

Code: Select all

<!-- append to quickreply -->


<!-- append to posting box -->

<!-- play requiem for the banned -->
No audio. Yes, my board is still in English. I'm wondering if an extension is interfering? I used Firebug, but not sure how to see if there are errors.

Post Reply

Return to “Extensions in Development”