Simple Machines Community Forum

Customizing SMF => Modifications and Packages => Topic started by: zStudios Team on October 14, 2016, 01:38:35 PM

Title: AdSense Mod
Post by: zStudios Team on October 14, 2016, 01:38:35 PM
Link al mod (https://custom.simplemachines.org/mods/index.php?mod=4120)

(http://i.imgur.com/42DD4VC.png)


AdSense Mod
Author: zStudios Networks (http://zStudios.es)

Description

For SMF 2.0.x only

With this modification you can easily put AdSense ads on your forum, Only putting AdSense codes
License

 * This SMF modification is subject to the Mozilla Public License Version
 * 2.0 (the "License"); you may not use this SMF modification except in compliance with
 * the License. You may obtain a copy of the License at
 * http://www.mozilla.org/MPL/ (http://www.mozilla.org/MPL/)
 
Languages
-English/utf8

Changelog

http://i.imgur.com/cHgggj6.png
http://i.imgur.com/LFE29ob.png
http://i.imgur.com/fu1iyOg.png


Do you want more Design and Development?.... zStudios Networks www.zstudios.es (http://www.zstudios.es)
Title: Re: AdSense Mod
Post by: Blackylol on December 11, 2016, 09:00:19 AM
I'm getting this in the logs

8: Undefined index: headerads_enable
File: /Themes/GamingNation/BoardIndex.template.php
Line: 26
Title: Re: AdSense Mod
Post by: Dzonny on December 11, 2016, 10:38:07 AM
I'm getting this in the logs

8: Undefined index: headerads_enable
File: /Themes/GamingNation/BoardIndex.template.php
Line: 26
Please check if you have following code at the end of your Modifications.english and Modifications.{langauge}.php file (in case you're using custom language):
Code: [Select]

// zStudios AdSenseMod.
$txt['headerads_enable'] = 'Enable AdSense in Board Index';
$txt['headerads_text'] = '(paste Adsense code)';
$txt['footerads_enable'] = 'Enable AdSense in above Stats center';
$txt['footerads_text'] = '(paste Adsense code)';
$txt['toppostads_enable'] = 'Enable AdSense at the top of a thread';
$txt['toppostads_text'] = '(paste Adsense code)';
$txt['ad_text'] = 'Advertisement</br>';
Title: Re: AdSense Mod
Post by: zStudios Team on December 26, 2016, 05:47:10 PM
Be sure that variables are set in language files, and that the modification in "BoardIndex.template.php" are ok.

Title: Re: AdSense Mod
Post by: zStudios Team on December 30, 2016, 04:26:14 AM
Soon an update:

-Membergroups permissions
-New Advertisement locations
-Tooltips in jQuery
Title: Re: AdSense Mod
Post by: fazeMark on December 30, 2016, 06:22:30 AM
Thanks, this mod is gonna be useful for sure.
Title: Re: AdSense Mod
Post by: zStudios Team on December 30, 2016, 06:28:03 AM
You're welcome, Any suggestions will be very well received.
Title: Re: AdSense Mod
Post by: snadge on January 03, 2017, 11:59:43 AM
I am new to adsense and have installed this mod but it only seems to work with one type of advert (responsive-default)...anything else just has nothing but the HUGE grey borders that I dont want and are not selected in adsense?
 e.g.:
(http://i.imgur.com/yRl9we9.jpg)

I would like to get rid of that huge grey border? is this something you can help with?

thanks
Title: Re: AdSense Mod
Post by: snadge on January 03, 2017, 03:07:15 PM
I realise now its probably to do with the forum theme - i have suggestion - how about advert on the last post? so that people that have the default view of seeing the lest reply first will get to see and advert? when clicking 'view reply' from an email or returns to the topic
Title: Re: AdSense Mod
Post by: zStudios Team on January 03, 2017, 04:53:11 PM
I am new to adsense and have installed this mod but it only seems to work with one type of advert (responsive-default)...anything else just has nothing but the HUGE grey borders that I dont want and are not selected in adsense?
 e.g.:
(http://i.imgur.com/yRl9we9.jpg)

I would like to get rid of that huge grey border? is this something you can help with?

thanks

if you want remove that default-curve background just remove the background tag or change the color

Quote
.adsensemodzstudios_header {
   background: #f0f4f7;
   border-radius: 5px;
   padding: 20px;
   color: #222;
}
.adsensemodzstudios_footer {
   background: #f5f5f5;
   border-radius: 5px;
   padding: 20px;
   color: #222;
}

*RED PART
Title: Re: AdSense Mod
Post by: zStudios Team on January 03, 2017, 04:54:17 PM
I realise now its probably to do with the forum theme - i have suggestion - how about advert on the last post? so that people that have the default view of seeing the lest reply first will get to see and advert? when clicking 'view reply' from an email or returns to the topic

Sure, thanks for your suggestion
Title: Re: AdSense Mod
Post by: wzol on August 15, 2017, 03:23:53 PM
Thanks for the mod, could you add an option to show ads only for guests - or help me do it?

I know I need $user_info['is_guest'] just don't know where to make this check.

UPDATE: correction: it is $context['user']['is_guest']  :)
Title: Re: AdSense Mod
Post by: njtweb on August 10, 2018, 12:06:45 PM
Any chance to add permissions? I appreciate the mod, I'd like to only show ads to guests and not members. Thank you
Title: Re: AdSense Mod
Post by: Rock Lee on August 10, 2018, 01:13:49 PM
Very good modification and simple :D ... Also I leave the translation to Latin Spanish

Code: [Select]
<file name="$themedir/languages/Modifications.spanish_latin.php" error="skip">
<operation>
<search position="end" />
<add><![CDATA[
// zStudios AdSenseMod.
$txt['headerads_enable'] = 'Habilitar AdSense en el &iacute;ndice del foro';
$txt['headerads_text'] = '(Pegue el c&oacute;digo de Adsense)';
$txt['footerads_enable'] = 'Habilitar AdSense en el centro y por encima de las estad&iacute;sticas';
$txt['footerads_text'] = '(Pegue el c&oacute;digo de Adsense)';
$txt['toppostads_enable'] = 'Habilitar AdSense en la parte superior de un tema';
$txt['toppostads_text'] = '(Pegue el c&oacute;digo de Adsense)';
$txt['ad_text'] = 'Publicidad</br>';
]]></add>
</operation>
</file>

<file name="$themedir/languages/Modifications.spanish_latin-utf8.php" error="skip">
<operation>
<search position="end" />
<add><![CDATA[
// zStudios AdSenseMod.
$txt['headerads_enable'] = 'Habilitar AdSense en el índice del foro';
$txt['headerads_text'] = '(Pegue el código de Adsense)';
$txt['footerads_enable'] = 'Habilitar AdSense en el centro y por encima de las estadísticas';
$txt['footerads_text'] = '(Pegue el código de Adsense)';
$txt['toppostads_enable'] = 'Habilitar AdSense en la parte superior de un tema';
$txt['toppostads_text'] = '(Pegue el código de Adsense)';
$txt['ad_text'] = 'Publicidad</br>';
]]></add>
</operation>
</file>
</modification>

If you need anything let me know!


Regards!
Title: Re: AdSense Mod
Post by: naijacrux on September 08, 2018, 08:16:08 PM
Very good modification and simple :D ... Also I leave the translation to Latin Spanish

Code: [Select]
<file name="$themedir/languages/Modifications.spanish_latin.php" error="skip">
<operation>
<search position="end" />
<add><![CDATA[
// zStudios AdSenseMod.
$txt['headerads_enable'] = 'Habilitar AdSense en el &iacute;ndice del foro';
$txt['headerads_text'] = '(Pegue el c&oacute;digo de Adsense)';
$txt['footerads_enable'] = 'Habilitar AdSense en el centro y por encima de las estad&iacute;sticas';
$txt['footerads_text'] = '(Pegue el c&oacute;digo de Adsense)';
$txt['toppostads_enable'] = 'Habilitar AdSense en la parte superior de un tema';
$txt['toppostads_text'] = '(Pegue el c&oacute;digo de Adsense)';
$txt['ad_text'] = 'Publicidad</br>';
]]></add>
</operation>
</file>

<file name="$themedir/languages/Modifications.spanish_latin-utf8.php" error="skip">
<operation>
<search position="end" />
<add><![CDATA[
// zStudios AdSenseMod.
$txt['headerads_enable'] = 'Habilitar AdSense en el índice del foro';
$txt['headerads_text'] = '(Pegue el código de Adsense)';
$txt['footerads_enable'] = 'Habilitar AdSense en el centro y por encima de las estadísticas';
$txt['footerads_text'] = '(Pegue el código de Adsense)';
$txt['toppostads_enable'] = 'Habilitar AdSense en la parte superior de un tema';
$txt['toppostads_text'] = '(Pegue el código de Adsense)';
$txt['ad_text'] = 'Publicidad</br>';
]]></add>
</operation>
</file>
</modification>

If you need anything let me know!


Regards!

dear i need help, how do i make this mod show responsive ads on static theme, i am not using a responsive them but the mod is not showing the ads on anecdota theme
Title: Re: AdSense Mod
Post by: Rock Lee on September 08, 2018, 09:35:21 PM
dear i need help, how do i make this mod show responsive ads on static theme, i am not using a responsive them but the mod is not showing the ads on anecdota theme

When I installed the mod the changes were applied correctly to your theme?. I did not try everything but you should see that change is receptive to ads (although with a fixed value it adjusts only I believe vaguely).


Regards!
Title: Re: AdSense Mod
Post by: mattizzy on September 09, 2018, 04:50:41 AM
Nice modifications. well, this will be good for people who just use AdSense alone.