[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.
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 »

No, it is not allowed to show the ads to bots. Google write in its Terms of Use, that it isn't allowed to generate impressions or clicks with bots. If bots would see the ads, they would generate impressions. In the US Terms of Use it shows this:
Invalid activity is determined by Google in all cases and includes, but is not limited to, (i) spam, invalid queries, invalid impressions or invalid clicks on Ads generated by any person, bot, automated program or similar device, including through any clicks or impressions originating from your IP addresses or computers under your control;
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:No, it is not allowed to show the ads to bots. Google write in its Terms of Use, that it isn't allowed to generate impressions or clicks with bots. If bots would see the ads, they would generate impressions. In the US Terms of Use it shows this:
Invalid activity is determined by Google in all cases and includes, but is not limited to, (i) spam, invalid queries, invalid impressions or invalid clicks on Ads generated by any person, bot, automated program or similar device, including through any clicks or impressions originating from your IP addresses or computers under your control;
That are two different things you say:
  • it is not allowed to SHOW ads to bots (which is something you cannot prevent or control)
  • it isn't allowed to GENERATE impressions or clicks with bots (That means you are the one behind the bots - which also something that can not be prevented from phpBB.)
By the way, you have to allow the Adsense Crawler to see your forum content. This way Adsense can show relevant ads. If you show ads on a forum that's not public accessible, you have to give the crawler login credentials. https://support.google.com/adsense/answer/161351?hl=en
romeo_piter
Registered User
Posts: 130
Joined: Mon Nov 09, 2009 7:11 pm
Location: Paraguay

Re: [RC] Custom Code

Post by romeo_piter »

martti wrote:
romeo_piter wrote:This path:

Code: Select all

<!-- INCLUDE ../../../../../../store/customcode/new.html -->
does not work for me:

Code: Select all

Uncaught exception 'Twig_Error_Loader' with message 'Unable to find template "../../../../../../store/customcode/new.html"
But the file exists.

Maybe the problem is that my forum is on subdomen: forum.site

Could you please help?
Was the file created with the extension itself?
Yes
User avatar
martti
Registered User
Posts: 914
Joined: Thu Jul 31, 2014 8:23 am
Location: Belgium

Re: [RC] Custom Code

Post by martti »

romeo_piter wrote:
martti wrote: Was the file created with the extension itself?
Yes
Do you see new.html listed then in ACP > Extensions > Custom Code > files ?
kooljp
Registered User
Posts: 29
Joined: Thu Feb 14, 2013 11:52 pm

Re: [RC] Custom Code

Post by kooljp »

<!-- Google adsense -->
<!-- IF postrow.S_FIRST_ROW or postrow.S_ROW_COUNT == 5 or postrow.S_ROW_COUNT == 10 -->

Your Google adsense code here...

<!-- ENDIF -->
Is there a way to hide the ads from a group of members?

I have a group of Premium (Paid) Members and I encourage subscriptions by promising less ads!

Cheers
User avatar
javiexin
Code Contributor
Posts: 1157
Joined: Wed Oct 12, 2011 11:46 pm
Location: Madrid, Spain
Name: Javier

Re: [RC] Custom Code

Post by javiexin »

Hi martti,

Great extension! I am using, and recommending it as well :).

There is one thing that I would like to suggest as an exhancement/addition that should be pretty simple for you, and much less cumbersome for users.

When you create a new file, would it be possible to add a tickmark to request the creation of the internal template (event) file? That way, if you need a new template, just create the file, and it will transparently create the other part that is required.

Thanks for a great extension,
-javiexin
User avatar
martti
Registered User
Posts: 914
Joined: Thu Jul 31, 2014 8:23 am
Location: Belgium

Re: [RC] Custom Code

Post by martti »

javiexin wrote:Hi martti,

Great extension! I am using, and recommending it as well :).

There is one thing that I would like to suggest as an exhancement/addition that should be pretty simple for you, and much less cumbersome for users.

When you create a new file, would it be possible to add a tickmark to request the creation of the internal template (event) file? That way, if you need a new template, just create the file, and it will transparently create the other part that is required.

Thanks for a great extension,
-javiexin
Hi Javiexin,
An extension should be plug and play:
  • It is not certain the server has writing permissions to create a new event location.
  • Files of the extension itself should not be changed. Then you would overwrite your self-created template events when you update the extension. As an alternative you can fork.
User avatar
martti
Registered User
Posts: 914
Joined: Thu Jul 31, 2014 8:23 am
Location: Belgium

Re: [RC] Custom Code

Post by martti »

kooljp wrote:
<!-- Google adsense -->
<!-- IF postrow.S_FIRST_ROW or postrow.S_ROW_COUNT == 5 or postrow.S_ROW_COUNT == 10 -->

Your Google adsense code here...

<!-- ENDIF -->
Is there a way to hide the ads from a group of members?

I have a group of Premium (Paid) Members and I encourage subscriptions by promising less ads!

Cheers
Not without extra work I'm afraid. Only the default group of the user is stored in the cache and it's not available as a template variable.
wrkalot
Registered User
Posts: 108
Joined: Tue Oct 02, 2012 10:07 pm

Re: [RC] Custom Code

Post by wrkalot »

Can you use <!-- IF S_GROUP_8 --> like I did in 3.0.x?
Tutorial: How to add ads to your forum viewtopic.php?f=64&t=2417316
User avatar
javiexin
Code Contributor
Posts: 1157
Joined: Wed Oct 12, 2011 11:46 pm
Location: Madrid, Spain
Name: Javier

Re: [RC] Custom Code

Post by javiexin »

martti wrote:An extension should be plug and play:
  • It is not certain the server has writing permissions to create a new event location.
  • Files of the extension itself should not be changed. Then you would overwrite your self-created template events when you update the extension. As an alternative you can fork.
Ok, but I do not see the issues here:
  • If no permission, simply flag it, and ask the user to create file themselves (as it is now) or change permission
  • I am not talking about changing any existing file in the extension, I am talking about adding, and this is something you are encouraging and documenting yourself to do manually, so doing it from within the extension would be safer regarding control; the risk to overwriting is minimum if at all, and in any case, if you overwrite, the minimum functionality you would have is the default, so it will not be less; again, more control from the extension
I understand and respect that you might not want to spend the time on this, or that you have other priorities.
Just wanted to point out that the risks you are rising are not there, or are minimal.

Thanks again for a great extension.
-javiexin
User avatar
martti
Registered User
Posts: 914
Joined: Thu Jul 31, 2014 8:23 am
Location: Belgium

Re: [RC] Custom Code

Post by martti »

javiexin wrote:
  • I am not talking about changing any existing file in the extension, I am talking about adding, and this is something you are encouraging and documenting yourself to do manually, so doing it from within the extension would be safer regarding control; the risk to overwriting is minimum if at all, and in any case, if you overwrite, the minimum functionality you would have is the default, so it will not be less; again, more control from the
You also can't add files as the update procedure is deleting and replacing the entire extension folder.
User avatar
martti
Registered User
Posts: 914
Joined: Thu Jul 31, 2014 8:23 am
Location: Belgium

Re: [RC] Custom Code

Post by martti »

wrkalot wrote:Can you use <!-- IF S_GROUP_8 --> like I did in 3.0.x?
These template variables are standard not there. Probably you've add manually the code to create them?
Like it is described here:
https://www.phpbb.com/support/docs/en/3 ... -switches/

It must be easy to make a extension for this. I'll have a look into it.
User avatar
javiexin
Code Contributor
Posts: 1157
Joined: Wed Oct 12, 2011 11:46 pm
Location: Madrid, Spain
Name: Javier

Re: [RC] Custom Code

Post by javiexin »

martti wrote:You also can't add files as the update procedure is deleting and replacing the entire extension folder.
"Forget" the deletion step and you are done... :D
But anyway, you already have the issue with or without this, as if you want to deal with events that are not part of the initial set you provide, you will have to create those files. The question is, if you create the files manually, with the increased difficulty and possibility to do it wrongly, or the extension helps you to create them "correctly" and easily.
As for upgrade, you may choose to tell people not to remove this folder, but just to overwrite it...
User avatar
martti
Registered User
Posts: 914
Joined: Thu Jul 31, 2014 8:23 am
Location: Belgium

Re: [RC] Custom Code

Post by martti »

kooljp wrote:
<!-- Google adsense -->
<!-- IF postrow.S_FIRST_ROW or postrow.S_ROW_COUNT == 5 or postrow.S_ROW_COUNT == 10 -->

Your Google adsense code here...

<!-- ENDIF -->
Is there a way to hide the ads from a group of members?

I have a group of Premium (Paid) Members and I encourage subscriptions by promising less ads!

Cheers
martti wrote:
wrkalot wrote:Can you use <!-- IF S_GROUP_8 --> like I did in 3.0.x?
These template variables are standard not there. Probably you've add manually the code to create them?
Like it is described here:
https://www.phpbb.com/support/docs/en/3 ... -switches/

It must be easy to make a extension for this. I'll have a look into it.
I've created a tiny extension which inserts the group template variables:
viewtopic.php?f=456&t=2325391
kooljp
Registered User
Posts: 29
Joined: Thu Feb 14, 2013 11:52 pm

Re: [RC] Custom Code

Post by kooljp »

martti wrote: I've created a tiny extension which inserts the group template variables:
viewtopic.php?f=456&t=2325391
<!-- Google adsense -->
<!-- IF postrow.S_FIRST_ROW or postrow.S_ROW_COUNT == 5 or postrow.S_ROW_COUNT == 10 -->

Your Google adsense code here...

<!-- ENDIF -->
Terrific! So what's the exact code we would use to show Adsense to registered members, but hide it from a group (eg: "VIP")

Return to “Abandoned Extensions”