[ABD] Custom Code

Any abandoned Extensions will be moved to this forum.

WARNING: Extensions in this forum are not currently being supported or maintained by the original Extension author. Proceed at your own risk.
Forum rules
IMPORTANT: Extension Development Forum rules

WARNING: Extensions in this forum are not currently being supported nor updated by the original Extension author. Proceed at your own risk.
abcEzy
Registered User
Posts: 232
Joined: Mon May 09, 2005 6:48 pm

Re: [RC] Custom Code

Post by abcEzy »

Quick question if I may...

Does this extension allow me to add any code I want inside a forum post?

So like for instance...

I have S3 Amazon account where I upload my videos. There are scripts that allow you to embed your code into normal web pages so your visitors can watch your videos.

One example is called: Easy Video Player. After I configure it to lock the video to be watched on a domain on my choosing to prevent others from embedding my code on their sites, it gives me a bunch of code that I can paste on my web pages.

I've been looking for a way to do this for a while, years and years actually on PHPBB3 via the custom BB Code feature but was never able to make it work.

Would this extension of yours allow me to do this?

Like for instance, my code looks like this, i've XXX'd out some parts of it to keep the video from being played.

Code: Select all


    <div align="center">
<div id="evp-f9047XXXXXXXXXXXXXX5c78d-wrap" class="evp-video-wrap"></div><script type="text/javascript" src="http://XXXXXXXXXXXX.net/videos/framework.php?div_id=evp-f9047fXXXXXXXXXXX78d&id=MDAwNXXXXXXXXXXXXXXXXXbi0xLm1wNA%3D%3D&v=130XXXXX89&profile=default"></script><script type="text/javascript"><!--
_evpInit('MDAXXXXXXXXXXXXXXXXXXXXXXXX1wNA==[evp-f9047fXXXXXXXXXXXXXXXXXXX78d]');//--></script>
</div>
  </div>

Thanks so much for your help.
User avatar
martti
Registered User
Posts: 914
Joined: Thu Jul 31, 2014 8:23 am
Location: Belgium

Re: [RC] Custom Code

Post by martti »

abcEzy wrote:Quick question if I may...

Does this extension allow me to add any code I want inside a forum post?

So like for instance...

I have S3 Amazon account where I upload my videos. There are scripts that allow you to embed your code into normal web pages so your visitors can watch your videos.

One example is called: Easy Video Player. After I configure it to lock the video to be watched on a domain on my choosing to prevent others from embedding my code on their sites, it gives me a bunch of code that I can paste on my web pages.

I've been looking for a way to do this for a while, years and years actually on PHPBB3 via the custom BB Code feature but was never able to make it work.

Would this extension of yours allow me to do this?

Like for instance, my code looks like this, i've XXX'd out some parts of it to keep the video from being played.

Code: Select all


    <div align="center">
<div id="evp-f9047XXXXXXXXXXXXXX5c78d-wrap" class="evp-video-wrap"></div><script type="text/javascript" src="http://XXXXXXXXXXXX.net/videos/framework.php?div_id=evp-f9047fXXXXXXXXXXX78d&id=MDAwNXXXXXXXXXXXXXXXXXbi0xLm1wNA%3D%3D&v=130XXXXX89&profile=default"></script><script type="text/javascript"><!--
_evpInit('MDAXXXXXXXXXXXXXXXXXXXXXXXX1wNA==[evp-f9047fXXXXXXXXXXXXXXXXXXX78d]');//--></script>
</div>
  </div>

Thanks so much for your help.
This is something that should be done with a custom bb code I think, as it is post-specific. This extension is not really suitable.
abcEzy
Registered User
Posts: 232
Joined: Mon May 09, 2005 6:48 pm

Re: [RC] Custom Code

Post by abcEzy »

Thanks for your reply, thats what I thought, ive tried a number of combinations, none of them work :(
User avatar
Meykota
Registered User
Posts: 30
Joined: Sat Aug 16, 2014 5:19 pm
Location: Leipzig, Germany

Re: [RC] Custom Code

Post by Meykota »

Back to my question :)

I tried these Cookie Policy thing, but I am using board3-portal and so this one doesn't work. Is there a chance with Custom Code? :)
Meykota wrote:The EU has this wonderful new Cookie-thing, where you have to ask your visitors for allowance to use Cookies... I've got a code from Silktide and want to know, if and where I can implement this code with Custom Code. Is this possible? And which file do I have to use for this? :)

Here's the code:

Code: Select all

<!-- Begin Cookie Consent plugin by Silktide - http://silktide.com/cookieconsent -->
<script type="text/javascript">
    window.cookieconsent_options = {"message":"Wir verwenden Cookies, um dir eine bessere Benutzerfahrung mit personalisierten Anzeigen und Funktionen bieten zu können.","dismiss":"Verstanden!","learnMore":"Weitere Informationen","link":"http://gamers-palace.de/ucp.php?mode=privacy","theme":"dark-top"};
</script>

<script type="text/javascript" src="//s3.amazonaws.com/cc.silktide.com/cookieconsent.latest.min.js"></script>
<!-- End Cookie Consent plugin -->
User avatar
Lumpy Burgertushie
Registered User
Posts: 69228
Joined: Mon May 02, 2005 3:11 am

Re: [RC] Custom Code

Post by Lumpy Burgertushie »

yes you can use the custom code for that.

put it in the overall_footer_after.html file in the customcode settings.

by the way, unless you are in europe this doesn't apply
and even if you are, from what I have read around here, it doesn't really apply to phpbb since phpbb does not collect the type of cookies that it applies to.




robert
Premium phpBB 3.3 Styles by PlanetStyles.net

I am pleased to announce that I have completed the first item on my bucket list. I have the bucket.
User avatar
martti
Registered User
Posts: 914
Joined: Thu Jul 31, 2014 8:23 am
Location: Belgium

Re: [RC] Custom Code

Post by martti »

Meykota wrote:Back to my question :)

I tried these Cookie Policy thing, but I am using board3-portal and so this one doesn't work. Is there a chance with Custom Code? :)
Meykota wrote:The EU has this wonderful new Cookie-thing, where you have to ask your visitors for allowance to use Cookies... I've got a code from Silktide and want to know, if and where I can implement this code with Custom Code. Is this possible? And which file do I have to use for this? :)

Here's the code:

Code: Select all

<!-- Begin Cookie Consent plugin by Silktide - http://silktide.com/cookieconsent -->
<script type="text/javascript">
    window.cookieconsent_options = {"message":"Wir verwenden Cookies, um dir eine bessere Benutzerfahrung mit personalisierten Anzeigen und Funktionen bieten zu können.","dismiss":"Verstanden!","learnMore":"Weitere Informationen","link":"http://gamers-palace.de/ucp.php?mode=privacy","theme":"dark-top"};
</script>

<script type="text/javascript" src="//s3.amazonaws.com/cc.silktide.com/cookieconsent.latest.min.js"></script>
<!-- End Cookie Consent plugin -->
It depends on what kind of cookies you are using and your country.
http://www.theeucookielaw.com/
http://cookiepedia.co.uk/cookie-laws-across-europe

If you are only using the normal phpbb session cookies then I would do nothing.
More evil are the third party cookies. (Fakebook like button, Google analytics, Adsense, etc.)
User avatar
Mauron
Registered User
Posts: 342
Joined: Wed Jul 16, 2014 11:25 am

Re: [RC] Custom Code

Post by Mauron »

Hello,
Any news about the validation process?
User avatar
10000fists
Registered User
Posts: 30
Joined: Fri Aug 28, 2015 9:58 pm

Re: [RC] Custom Code

Post by 10000fists »

martti wrote: Edit :: viewtopic_body_postrow_post_after.html

Code: Select all

<!-- Google adsense -->
<!-- IF not S_GROUP_9 and (postrow.S_FIRST_ROW or postrow.S_ROW_COUNT == 5 or postrow.S_ROW_COUNT == 10) -->
Your Google adsense code here...
<!-- ENDIF -->
I am using this and about 25 other extensions with no problems. However, I would like to do this for more than 1 group (admin, moderators, and a special group) in the most efficient code possible. I have tried to make it work and failed, I just don't have the skill yet. Any help would be appreciated.
User avatar
martti
Registered User
Posts: 914
Joined: Thu Jul 31, 2014 8:23 am
Location: Belgium

Re: [RC] Custom Code

Post by martti »

Mauron wrote:Hello,
Any news about the validation process?

It's in the queue again, after removing some incomplete translations.
User avatar
martti
Registered User
Posts: 914
Joined: Thu Jul 31, 2014 8:23 am
Location: Belgium

Re: [RC] Custom Code

Post by martti »

10000fists wrote:
martti wrote: Edit :: viewtopic_body_postrow_post_after.html

Code: Select all

<!-- Google adsense -->
<!-- IF not S_GROUP_9 and (postrow.S_FIRST_ROW or postrow.S_ROW_COUNT == 5 or postrow.S_ROW_COUNT == 10) -->
Your Google adsense code here...
<!-- ENDIF -->
I am using this and about 25 other extensions with no problems. However, I would like to do this for more than 1 group (admin, moderators, and a special group) in the most efficient code possible. I have tried to make it work and failed, I just don't have the skill yet. Any help would be appreciated.
So, you installed also this extension: https://github.com/marttiphpbb/phpbb-ext-grouptempvars ?

If the group ids were 9, 11, 13, 18 then you can write the conditional statement like:
<!-- IF not (S_GROUP_9 or S_GROUP_11 or S_GROUP_13 or S_GROUP_18) and (postrow.S_FIRST_ROW or postrow.S_ROW_COUNT == 5 or postrow.S_ROW_COUNT == 10) -->

Another strategie would be to create one special group that you give no rights but you use it just for everyone that would not see the adsense content. All these members you add to this group.
User avatar
10000fists
Registered User
Posts: 30
Joined: Fri Aug 28, 2015 9:58 pm

Re: [RC] Custom Code

Post by 10000fists »

Yes Sir, I did install grouptempvars.
Your conditional code works like a charm martti! That is exactly what I was trying to do but I was missing the braces () :shock:
On another issue I was trying to insert some ads in the search member posts:
localhost/forum/search.php?author_id=2&sr=posts
since it is similar to a topic page I thought this would be a good spot to slip some ads in. I just cant seem to get anything to function.

But hey, thanks for the help and an awesome extension!

Oh, and I did get your header image for each forum working and the welcome message so maybe I'm not a complete noob.
User avatar
martti
Registered User
Posts: 914
Joined: Thu Jul 31, 2014 8:23 am
Location: Belgium

Re: [RC] Custom Code

Post by martti »

10000fists wrote: On another issue I was trying to insert some ads in the search member posts:
localhost/forum/search.php?author_id=2&sr=posts
since it is similar to a topic page I thought this would be a good spot to slip some ads in. I just cant seem to get anything to function.
In order to keep the extension simple not all template events are included. You would need the search_results_post_after template event.

You can do one of the following:
  • Place Adsense somewhere else. i.e. below the navigation bar. Use the overall_header_content_before template event with conditional statement <!-- IF not (S_GROUP_9 and S_GROUP_11) and S_SCRIPT_NAME == 'search' --> (Change the group ids.)
  • Use javascript to move the code in place.
  • Fork the Custom Code extension and include the search_results_post_after template event yourself. (It is explained in this topic how to do this.)
User avatar
10000fists
Registered User
Posts: 30
Joined: Fri Aug 28, 2015 9:58 pm

Re: [RC] Custom Code

Post by 10000fists »

martti wrote: In order to keep the extension simple not all template events are included. You would need the search_results_post_after template event.

You can do one of the following:
  • Place Adsense somewhere else. i.e. below the navigation bar. Use the overall_header_content_before template event with conditional statement <!-- IF not (S_GROUP_9 and S_GROUP_11) and S_SCRIPT_NAME == 'search' --> (Change the group ids.)
Yes I see now, I was trying to use that same conditional statement in a custom template as you described in this thread. I must have been fumbling your directions on creating custom templates.
I will try out the overall_header_content_before and see if that will do it for me.
Thanks again,
User avatar
Lumpy Burgertushie
Registered User
Posts: 69228
Joined: Mon May 02, 2005 3:11 am

Re: [RC] Custom Code

Post by Lumpy Burgertushie »

according to google's TOS, you are not allowed to put adsense on non content pages. pages like search results are non content pages.

basically, the only pages you should put the adsense code on are the index page, the viewforum and the view topic pages.


robert
Premium phpBB 3.3 Styles by PlanetStyles.net

I am pleased to announce that I have completed the first item on my bucket list. I have the bucket.
User avatar
10000fists
Registered User
Posts: 30
Joined: Fri Aug 28, 2015 9:58 pm

Re: [RC] Custom Code

Post by 10000fists »

Lumpy Burgertushie wrote:according to google's TOS, you are not allowed to put adsense on non content pages. pages like search results are non content pages.

basically, the only pages you should put the adsense code on are the index page, the viewforum and the view topic pages.


robert
I was waiting for that to be brought up robert, not sure the index page is allowed though. Unfortunately adsense is not the premier platform it once was; they will be lucky if I include them at all. I have 99 ways to advert my forum and adsense ain't one. :lol:

Return to “Abandoned Extensions”