Page 51 of 52

Re: [3.2][BETA] Custom Code

Posted: Mon Jun 11, 2018 9:14 pm
by John connor
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.

Re: [3.2][BETA] Custom Code

Posted: Mon Jun 11, 2018 9:23 pm
by martti
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.

Re: [3.2][BETA] Custom Code

Posted: Mon Jun 11, 2018 9:45 pm
by John connor
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.

Re: [3.2][BETA] Custom Code

Posted: Mon Jun 11, 2018 9:56 pm
by martti
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.

Re: [3.2][BETA] Custom Code

Posted: Tue Jun 12, 2018 9:56 pm
by John connor
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

Re: [3.2][BETA] Custom Code

Posted: Tue Jun 12, 2018 10:02 pm
by John connor
Okay, this might help you out. I'm using version 0.1.0. Yeah, quite old indeed, but it works.

Re: [3.2][BETA] Custom Code

Posted: Tue Jun 12, 2018 10:14 pm
by martti
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.

Re: [3.2][BETA] Custom Code

Posted: Tue Jun 12, 2018 10:21 pm
by John connor
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.

Re: [3.2][BETA] Custom Code

Posted: Mon Nov 05, 2018 7:51 am
by martti
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).

Re: [3.2][BETA] Custom Code

Posted: Wed Feb 13, 2019 1:51 pm
by roepertje
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?

Re: [3.2][BETA] Custom Code

Posted: Wed Feb 13, 2019 2:19 pm
by martti
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

Re: [3.2][BETA] Custom Code

Posted: Wed Feb 13, 2019 4:44 pm
by Galixte de EzCom
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.

Re: [3.2][BETA] Custom Code

Posted: Wed Feb 13, 2019 5:57 pm
by roepertje
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.

Re: [3.2][BETA] Custom Code

Posted: Thu Feb 14, 2019 4:20 am
by Galixte de EzCom
Now it’s concerns this topic: viewtopic.php?f=456&t=2325391 to explain your issue. ;)

Re: [3.2][BETA] Custom Code

Posted: Thu Feb 14, 2019 10:35 pm
by John connor
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.