[3.3][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!
Ideas Centre
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: 855
Joined: Thu Jul 31, 2014 8:23 am
Location: Belgium

Re: [3.2][BETA] Custom Code

Post by martti »

John connor wrote:
Thu Feb 14, 2019 10:35 pm
Question: I rely on this extension right now for a lot of things. When phpBB updates to version 4, do you think this extension will still work? I have added a lot of footer stuff and I'd like to keep it there. Then during Christmas I have code on the index that randomly plays a Christmas audio clip.
4? I'm unaware about that. Are they working on version 4 at the moment?
User avatar
david63
Registered User
Posts: 17976
Joined: Thu Dec 19, 2002 8:08 am
Location: Lancashire, UK
Contact:

Re: [3.2][BETA] Custom Code

Post by david63 »

John connor wrote:
Thu Feb 14, 2019 10:35 pm
Question: I rely on this extension right now for a lot of things. When phpBB updates to version 4, do you think this extension will still work? I have added a lot of footer stuff and I'd like to keep it there. Then during Christmas I have code on the index that randomly plays a Christmas audio clip.
As we do not know what is in phpBB 4, or even when it may appear, I doubt that at this point anyone can answer that question. My personal view is that many, if not all, extensions will not work in phpBB 4
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
John connor
Registered User
Posts: 2539
Joined: Fri Nov 14, 2014 5:14 pm
Location: U S Of A
Name: Aaron
Contact:

Re: [3.2][BETA] Custom Code

Post by John connor »

What code would I use to play audio on login only? I have code that can play audio on the index which I use at Christmas, but how would I do it just on login? I don't know PHP.
Having spam problems? Install this extension and/or this script.
How to help protect your site from hackers.
0FL ?FE<JKCP K?@EB PFL ;<:F;<;‌​​​​‌‌⁠‌‌​‌‌‌‌⁠‌‌​‌‌‌​⁠‌‌​​‌‌‌⁠‌‌‌​​‌​⁠‌‌​​​​‌⁠‌‌‌​‌​​⁠‌‌‌​‌​‌⁠‌‌​‌‌​​⁠‌‌​​​​‌⁠‌‌‌​‌​​⁠‌‌​‌​​‌⁠‌‌​‌‌‌‌⁠‌‌​‌‌‌​⁠‌‌‌​​‌‌⁠‌​​​​‌⁠‌​​​​​⁠‌​‌‌​​‌⁠‌‌​‌‌‌‌⁠‌‌‌​‌​‌⁠‌​​‌‌‌⁠‌‌‌​​‌​⁠‌‌​​‌​‌⁠‌​​​​​⁠‌‌‌​​‌‌⁠‌‌​‌‌​‌⁠‌‌​​​​‌⁠‌‌‌​​‌​⁠‌‌‌​‌​​⁠‌‌​​‌​‌⁠‌‌‌​​‌​⁠‌​​​​​⁠‌‌‌​‌​​⁠‌‌​‌​​​⁠‌‌​​​​‌⁠‌‌​‌‌‌​⁠‌​​​​​⁠‌​​‌​​‌⁠‌​​​​​⁠‌‌‌​‌​​⁠‌‌​‌​​​⁠‌‌​‌‌‌‌⁠‌‌‌​‌​‌⁠‌‌​​‌‌‌⁠‌‌​‌​​​⁠‌‌‌​‌​​⁠‌​‌‌‌​ K?@J D<JJ8><t +?@EB 8>8@Ec
User avatar
martti
Registered User
Posts: 855
Joined: Thu Jul 31, 2014 8:23 am
Location: Belgium

Re: [3.2][BETA] Custom Code

Post by martti »

John connor wrote:
Mon Sep 02, 2019 12:31 pm
What code would I use to play audio on login only? I have code that can play audio on the index which I use at Christmas, but how would I do it just on login? I don't know PHP.
Maybe check on a template variable that comes with the login box:
(i.e in the overall_footer_page_body_after template event)

Code: Select all

{%- if S_LOGIN_ACTION -%}
Your code here
{%- endif -%}
User avatar
John connor
Registered User
Posts: 2539
Joined: Fri Nov 14, 2014 5:14 pm
Location: U S Of A
Name: Aaron
Contact:

Re: [3.2][BETA] Custom Code

Post by John connor »

I used the audio code I got from you a few years ago as a test, but this doesn't seem to work. This is what I added to overall_footer_page_body_after


Code: Select all

{%- if S_LOGIN_ACTION -%}
<audio id="audio" preload="auto" tabindex="0" controls="" type="audio/ogg" style="display: none;">   
</audio>
<div id="playing" style="display: none;">
</div>
<script>
var audio;
var playlist;
var tracks;
var current;
var musicarr = ["https://www.mywebsite.com/images/bells.ogg",
                "https://www.mywebsite.com/images/bells2.ogg",
                "https://www.mywebsite.com/images/bells3.ogg",
                "https://www.mywebsite.com/images/christmas.ogg",
                "https://www.mywebsite.com/images/santa.ogg",
                "https://www.mywebsite.com/images/noel.ogg",
                "https://www.mywebsite.com/images/hoho.ogg",];
shuffle(musicarr);

init();
function init(){
    current = 0;
    audio = $('audio');
    audio[0].volume = .20;
    len = musicarr.length;
   
    run(musicarr[current], audio[0]);
   
    
}

function run(link, player){
        player.src = link;
        audio[0].load();
        audio[0].play();
        $('#playing').html("<ul><li><a>" + link+ "</a></li></ul>");     
}

function shuffle(array) {
  var currentIndex = array.length, temporaryValue, randomIndex ;

  // While there remain elements to shuffle...
  while (0 !== currentIndex) {

    // Pick a remaining element...
    randomIndex = Math.floor(Math.random() * currentIndex);
    currentIndex -= 1;

    // And swap it with the current element.
    temporaryValue = array[currentIndex];
    array[currentIndex] = array[randomIndex];
    array[randomIndex] = temporaryValue;
  }

  return array;
}
</script>
{%- endif -%}

That code was added to your extension inserttemplatecode.
Having spam problems? Install this extension and/or this script.
How to help protect your site from hackers.
0FL ?FE<JKCP K?@EB PFL ;<:F;<;‌​​​​‌‌⁠‌‌​‌‌‌‌⁠‌‌​‌‌‌​⁠‌‌​​‌‌‌⁠‌‌‌​​‌​⁠‌‌​​​​‌⁠‌‌‌​‌​​⁠‌‌‌​‌​‌⁠‌‌​‌‌​​⁠‌‌​​​​‌⁠‌‌‌​‌​​⁠‌‌​‌​​‌⁠‌‌​‌‌‌‌⁠‌‌​‌‌‌​⁠‌‌‌​​‌‌⁠‌​​​​‌⁠‌​​​​​⁠‌​‌‌​​‌⁠‌‌​‌‌‌‌⁠‌‌‌​‌​‌⁠‌​​‌‌‌⁠‌‌‌​​‌​⁠‌‌​​‌​‌⁠‌​​​​​⁠‌‌‌​​‌‌⁠‌‌​‌‌​‌⁠‌‌​​​​‌⁠‌‌‌​​‌​⁠‌‌‌​‌​​⁠‌‌​​‌​‌⁠‌‌‌​​‌​⁠‌​​​​​⁠‌‌‌​‌​​⁠‌‌​‌​​​⁠‌‌​​​​‌⁠‌‌​‌‌‌​⁠‌​​​​​⁠‌​​‌​​‌⁠‌​​​​​⁠‌‌‌​‌​​⁠‌‌​‌​​​⁠‌‌​‌‌‌‌⁠‌‌‌​‌​‌⁠‌‌​​‌‌‌⁠‌‌​‌​​​⁠‌‌‌​‌​​⁠‌​‌‌‌​ K?@J D<JJ8><t +?@EB 8>8@Ec
User avatar
</Solidjeuh>
Registered User
Posts: 1788
Joined: Tue Mar 29, 2016 3:45 am
Location: Aalst (Belgium)
Name: Andy Dm
Contact:

Re: [3.2][BETA] Custom Code

Post by </Solidjeuh> »

martti wrote:
Tue Sep 03, 2019 6:15 am

Code: Select all

{%- if S_LOGIN_ACTION -%}
Your code here
{%- endif -%}
This is not working, it's playing the sound on every page you open
Tarantino
Registered User
Posts: 795
Joined: Sat Feb 18, 2012 1:51 pm
Contact:

Re: [3.2][BETA] Custom Code

Post by Tarantino »

I am getting this: Fatal error: Uncaught Twig\Error\LoaderError: Looks like you try to load a template outside configured directories (@marttiphpbb_customcode/../../../../../../store/customcode/overall_header_head_append.html) in "@marttiphpbb_customcode/include_file.html" at line 2

After updating to 3.3

Is there any solution for this? Thanks!
User avatar
martti
Registered User
Posts: 855
Joined: Thu Jul 31, 2014 8:23 am
Location: Belgium

Re: [3.2][BETA] Custom Code

Post by martti »

Tarantino wrote:
Sun Jan 12, 2020 7:48 pm
I am getting this: Fatal error: Uncaught Twig\Error\LoaderError: Looks like you try to load a template outside configured directories (@marttiphpbb_customcode/../../../../../../store/customcode/overall_header_head_append.html) in "@marttiphpbb_customcode/include_file.html" at line 2

After updating to 3.3

Is there any solution for this? Thanks!
The Custom Code extension is not yet compatible with phbBB 3.3+ but I'm working on it.
User avatar
John connor
Registered User
Posts: 2539
Joined: Fri Nov 14, 2014 5:14 pm
Location: U S Of A
Name: Aaron
Contact:

Re: [3.2][BETA] Custom Code

Post by John connor »

Reading around this forum there are a lot of extensions I use that aren't compatible with 3.3.x. So as of now I only updated to 3.2.9 and may have to stick with 3.2.10 until all the extensions I use work with 3.3.x. This extension here is really great because I use it for the footer and setting Google fonts board-wide and other things. I'd hate to lose this ability and have to do a ton more core edits. Bad enough I have to massage the phpBB package with all my edits prior to uploading it to the FTP.
Having spam problems? Install this extension and/or this script.
How to help protect your site from hackers.
0FL ?FE<JKCP K?@EB PFL ;<:F;<;‌​​​​‌‌⁠‌‌​‌‌‌‌⁠‌‌​‌‌‌​⁠‌‌​​‌‌‌⁠‌‌‌​​‌​⁠‌‌​​​​‌⁠‌‌‌​‌​​⁠‌‌‌​‌​‌⁠‌‌​‌‌​​⁠‌‌​​​​‌⁠‌‌‌​‌​​⁠‌‌​‌​​‌⁠‌‌​‌‌‌‌⁠‌‌​‌‌‌​⁠‌‌‌​​‌‌⁠‌​​​​‌⁠‌​​​​​⁠‌​‌‌​​‌⁠‌‌​‌‌‌‌⁠‌‌‌​‌​‌⁠‌​​‌‌‌⁠‌‌‌​​‌​⁠‌‌​​‌​‌⁠‌​​​​​⁠‌‌‌​​‌‌⁠‌‌​‌‌​‌⁠‌‌​​​​‌⁠‌‌‌​​‌​⁠‌‌‌​‌​​⁠‌‌​​‌​‌⁠‌‌‌​​‌​⁠‌​​​​​⁠‌‌‌​‌​​⁠‌‌​‌​​​⁠‌‌​​​​‌⁠‌‌​‌‌‌​⁠‌​​​​​⁠‌​​‌​​‌⁠‌​​​​​⁠‌‌‌​‌​​⁠‌‌​‌​​​⁠‌‌​‌‌‌‌⁠‌‌‌​‌​‌⁠‌‌​​‌‌‌⁠‌‌​‌​​​⁠‌‌‌​‌​​⁠‌​‌‌‌​ K?@J D<JJ8><t +?@EB 8>8@Ec
User avatar
GoBieN
Registered User
Posts: 546
Joined: Fri Mar 05, 2004 5:22 pm
Location: Belgium
Contact:

Re: [3.2][BETA] Custom Code

Post by GoBieN »

This was a major update from 3.2.x to 3.3.x so it's normal for breaking changes and I'm waiting as well.
User avatar
martti
Registered User
Posts: 855
Joined: Thu Jul 31, 2014 8:23 am
Location: Belgium

Re: [3.3][BETA] Custom Code

Post by martti »

Hi,

Update: new version 3.0.0 of this Custom Code extension is for phpBB 3.3+ and PHP 7.1+

Apart from that, nothing else changed. No new features yet.
User avatar
John connor
Registered User
Posts: 2539
Joined: Fri Nov 14, 2014 5:14 pm
Location: U S Of A
Name: Aaron
Contact:

Re: [3.3][BETA] Custom Code

Post by John connor »

Thanks! I couldn't live without this extension. I'm still using the old version where you edit the template files in the FTP. :lol:
Having spam problems? Install this extension and/or this script.
How to help protect your site from hackers.
0FL ?FE<JKCP K?@EB PFL ;<:F;<;‌​​​​‌‌⁠‌‌​‌‌‌‌⁠‌‌​‌‌‌​⁠‌‌​​‌‌‌⁠‌‌‌​​‌​⁠‌‌​​​​‌⁠‌‌‌​‌​​⁠‌‌‌​‌​‌⁠‌‌​‌‌​​⁠‌‌​​​​‌⁠‌‌‌​‌​​⁠‌‌​‌​​‌⁠‌‌​‌‌‌‌⁠‌‌​‌‌‌​⁠‌‌‌​​‌‌⁠‌​​​​‌⁠‌​​​​​⁠‌​‌‌​​‌⁠‌‌​‌‌‌‌⁠‌‌‌​‌​‌⁠‌​​‌‌‌⁠‌‌‌​​‌​⁠‌‌​​‌​‌⁠‌​​​​​⁠‌‌‌​​‌‌⁠‌‌​‌‌​‌⁠‌‌​​​​‌⁠‌‌‌​​‌​⁠‌‌‌​‌​​⁠‌‌​​‌​‌⁠‌‌‌​​‌​⁠‌​​​​​⁠‌‌‌​‌​​⁠‌‌​‌​​​⁠‌‌​​​​‌⁠‌‌​‌‌‌​⁠‌​​​​​⁠‌​​‌​​‌⁠‌​​​​​⁠‌‌‌​‌​​⁠‌‌​‌​​​⁠‌‌​‌‌‌‌⁠‌‌‌​‌​‌⁠‌‌​​‌‌‌⁠‌‌​‌​​​⁠‌‌‌​‌​​⁠‌​‌‌‌​ K?@J D<JJ8><t +?@EB 8>8@Ec
johnd0e
Registered User
Posts: 30
Joined: Fri Oct 04, 2019 3:07 pm

Re: [3.3][BETA] Custom Code

Post by johnd0e »

martti wrote:
Wed Feb 05, 2020 6:11 pm
Hi,

Update: new version 3.0.0 of this Custom Code extension is for phpBB 3.3+ and PHP 7.1+

Apart from that, nothing else changed. No new features yet.
Minor issue: I see this string in the footer, after "Powered by phpBB® Forum Software © phpBB Limited":

Code: Select all

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

Re: [3.3][BETA] Custom Code

Post by martti »

johnd0e wrote:
Thu Feb 06, 2020 3:57 pm
martti wrote:
Wed Feb 05, 2020 6:11 pm
Hi,

Update: new version 3.0.0 of this Custom Code extension is for phpBB 3.3+ and PHP 7.1+

Apart from that, nothing else changed. No new features yet.
Minor issue: I see this string in the footer, after "Powered by phpBB® Forum Software © phpBB Limited":

Code: Select all

CUSTOMCODE_GITHUB_LINK
Ok, thanks. I've corrected it in version 3.0.1 You don't need to update, it's ndeed minor.
johnd0e
Registered User
Posts: 30
Joined: Fri Oct 04, 2019 3:07 pm

Re: [3.3][BETA] Custom Code

Post by johnd0e »

Ok, thanks. I've corrected it in version 3.0.1 You don't need to update, it's ndeed minor.
I see this now:

Code: Select all

MARTTIPHPBB_CUSTOMCODE_GITHUB_LINK
Post Reply

Return to “Extensions in Development”