[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!
Suggested Hosts
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
John connor
Registered User
Posts: 2306
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 » Mon Jun 11, 2018 9:14 pm

I have been using this from day one. I couldn't live without it. I have audio played to a banned account and set my footer items with this code. I'm scared to update though as I don't want anything to break. I do use parameter template vars I think it's called as well.

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

Re: [3.2][BETA] Custom Code

Post by martti » Mon Jun 11, 2018 9:23 pm

John connor wrote:
Mon Jun 11, 2018 9:14 pm
I have been using this from day one. I couldn't live without it. I have audio played to a banned account and set my footer items with this code. I'm scared to update though as I don't want anything to break. I do use parameter template vars I think it's called as well.
So you're still on phpBB 3.1.5 ?

It's easy to replace those parameter template vars.
Just search for
CUSTOMCODE_PARAM_
and replace with
marttiphpbb_customcode.query.
Then turn the PARAMETERNAME to lowercase parametername.

User avatar
John connor
Registered User
Posts: 2306
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 » Mon Jun 11, 2018 9:45 pm

No, I'm on 3.2.2 and just use the extension in my FTP. It has no GUI in the Extensions tab. I modify the code manually through the FTP. However, I'm very code stupid so I have no idea what you just said there. You were the one to help me use my footer and banned audio code. The banned audio code apparently needed that parameter template code extension.

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

Re: [3.2][BETA] Custom Code

Post by martti » Mon Jun 11, 2018 9:56 pm

John connor wrote:
Mon Jun 11, 2018 9:45 pm
No, I'm on 3.2.2 and just use the extension in my FTP. It has no GUI in the Extensions tab. I modify the code manually through the FTP. However, I'm very code stupid so I have no idea what you just said there. You were the one to help me use my footer and banned audio code. The banned audio code apparently needed that parameter template code extension.
Ok, so you are not using this extension because version pre-2.0.0 dioesn't work together with phpBB 3.1.6+.
Probably you are using an empty extension where you manually create the files for the events. And you are using also the Parameter Template Variables extension.

User avatar
John connor
Registered User
Posts: 2306
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 » Tue Jun 12, 2018 9:56 pm

Yeah, I think if I can remember right now that the extension didn't work back then and I reverted back to what you had before in the beginning. That is, it's an extension so to speak that I enabled in the ACP, but I have to edit the files manually in the FTP under marttiphpbb/inserttemplatecode/styles/all/template/event.

In there are the 12 HTML files I can add code to.

How would I proceed to update to your latest without losing my code now?

I have to thank you, Martii for creating this extension. It's been fantastic thus far and I have to thank you for the code help as I'm very code stupid. :lol: I once had random audio play on my index which was pretty cool. But I got rid of that since I thought it would be annoying to my visitors. I do have audio that plays to banned accounts though.

I also use your paramtempvars I think it is that allows me to hide the contact bubbles from guest viewing, and thus far it works great. I couldn't have done it without you.


To make it easier, this is what I'm using.

Image

User avatar
John connor
Registered User
Posts: 2306
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 » Tue Jun 12, 2018 10:02 pm

Okay, this might help you out. I'm using version 0.1.0. Yeah, quite old indeed, but it works.

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

Re: [3.2][BETA] Custom Code

Post by martti » Tue Jun 12, 2018 10:14 pm

The advantage of "Custom Code" is that you can edit in the ACP. But the disadvantage is that it has only 12 template events:
  • forumlist_body_category_header_before.html
  • overall_footer_after.html
  • overall_footer_body_after.html
  • overall_footer_copyright_append.html
  • overall_footer_page_body_after.html
  • overall_header_body_before.html
  • overall_header_content_before.html
  • overall_header_head_append.html
  • overall_header_page_body_before.html
  • overall_header_stylesheets_after.html
  • topiclist_row_append.html
  • viewtopic_body_postrow_post_after.html
If you do things manually, like you do now, you can chose any of the phpBB template events.
So it's up to you what you like to use. You could of course stay with the solution that you have now. If it works, why not? Or, you could also enable Custom Code, and move stuff there (gradually). But in any case, just backup the files before you do anything. Also note that this new version of Custom Code is fresh and needs testing. Quite a lot has changed internally.

User avatar
John connor
Registered User
Posts: 2306
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 » Tue Jun 12, 2018 10:21 pm

martti wrote:
Tue Jun 12, 2018 10:14 pm
Also note that this new version of Custom Code is fresh and needs testing. Quite a lot has changed internally.
Ah, and that's where I'll wait. So far what I have now works great.

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

Re: [3.2][BETA] Custom Code

Post by martti » Mon Nov 05, 2018 7:51 am

The plan for this "Custom Code" extension from version 3+ is to support ALL template events present in Prosilver. A new (not required) dependency will be (a future version of) the Show phpBB Events extension (only to be enabled during editing of template code inserts).

roepertje
Registered User
Posts: 7
Joined: Sun Apr 09, 2006 11:12 am

Re: [3.2][BETA] Custom Code

Post by roepertje » Wed Feb 13, 2019 1:51 pm

I installed and enabled Group Template Variables and Custom Code

How to
hide avatar for guest and members without an avatar
and
show avatar for members in group 9 "members with avatar"

What I did so far:

Events:
viewtopic_body_avatar_before and viewtopic_body_avatar_after
memberlist_view_content_prepend and memberlist_view_rank_avatar_before

I added above events to customcode_directory.php

I created html files in styles/all/template/event and changed the event-name and changed the name of the file. (copy from overall_header_content_before.html)

In the ACP:

viewtopic_body_avatar_before:
{%- if marttiphpbb_grouptempvars.9 -%}

viewtopic_body_avatar_AFTER
{%- endif -%}

It does not work. Maybe I misunderstood something?

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

Re: [3.2][BETA] Custom Code

Post by martti » Wed Feb 13, 2019 2:19 pm

roepertje wrote:
Wed Feb 13, 2019 1:51 pm
I installed and enabled Group Template Variables and Custom Code

How to
hide avatar for guest and members without an avatar
and
show avatar for members in group 9 "members with avatar"

What I did so far:

Events:
viewtopic_body_avatar_before and viewtopic_body_avatar_after
memberlist_view_content_prepend and memberlist_view_rank_avatar_before

I added above events to customcode_directory.php

I created html files in styles/all/template/event and changed the event-name and changed the name of the file. (copy from overall_header_content_before.html)

In the ACP:

viewtopic_body_avatar_before:
{%- if marttiphpbb_grouptempvars.9 -%}

viewtopic_body_avatar_AFTER
{%- endif -%}

It does not work. Maybe I misunderstood something?
These template events are not yet supported. Only these at the moment:
  • forumlist_body_category_header_before.html
  • overall_footer_after.html
  • overall_footer_body_after.html
  • overall_footer_copyright_append.html
  • overall_footer_page_body_after.html
  • overall_header_body_before.html
  • overall_header_content_before.html
  • overall_header_head_append.html
  • overall_header_page_body_before.html
  • overall_header_stylesheets_after.html
  • topiclist_row_append.html
  • viewtopic_body_postrow_post_after.html

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: [3.2][BETA] Custom Code

Post by Galixte de EzCom » Wed Feb 13, 2019 4:44 pm

I explain to add new event here: http://www.ezcom-fr.com/viewtopic.php?p=1501#p1501. You can translate my post by using the “Traduire en” menu to select “ENGLISH” then by clicking on the “Traduire en” link.
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.

roepertje
Registered User
Posts: 7
Joined: Sun Apr 09, 2006 11:12 am

Re: [3.2][BETA] Custom Code

Post by roepertje » Wed Feb 13, 2019 5:57 pm

Galixte de EzCom wrote:
Wed Feb 13, 2019 4:44 pm
I explain to add new event here: http://www.ezcom-fr.com/viewtopic.php?p=1501#p1501. You can translate my post by using the “Traduire en” menu to select “ENGLISH” then by clicking on the “Traduire en” link.
I followed exactly your tutorial, but my code seems not to work for groups.

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: [3.2][BETA] Custom Code

Post by Galixte de EzCom » Thu Feb 14, 2019 4:20 am

Now it’s concerns this topic: viewtopic.php?f=456&t=2325391 to explain your issue. ;)
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
John connor
Registered User
Posts: 2306
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 » 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.

Post Reply

Return to “Extensions in Development”