vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3.5 Template Modifications (https://vborg.vbsupport.ru/forumdisplay.php?f=155)
-   -   Advertisements Enhancer + TOS Compatibility (https://vborg.vbsupport.ru/showthread.php?t=110701)

RsX 03-17-2006 10:00 PM

Advertisements Enhancer + TOS Compatibility
 
Most advertising companies will ask you not to have their ads on pages without content. This is a problem in vBulletin, because you want to have the ads on as many pages as possible, but you dont want to get banned from the service (i.e. adsense ;))

The solution is not to try and find places we CAN put the ads, but rather to exclude all the places we would NOT want them. What this hack does is make sure ads do not appear on pages we dont want them to (This includes most hacks which add pages, such as the cyber paypal donation hack, invites hack, etc. Plus, it is quite simple to add any other page you want to the no-no list :))

Another thing this hack does is put the ads in a table, to make it look neater. In addition, it gives the members an option to collapse the ads. It will still get you impressions, and it wont be annoying for the user, so its a win-win situation.
------------------------------------------------------------

UPDATE 1.01:
There seemed to have been code which was one style specific (satellite skin spacer) so I replaced it with a <br />. If you had a problem with spaces between the ads table and the navbar and/or forum categories, use this updated code.

------------------------------------------------------------


The following script will work with any type of affiliates, including referencers, search boxes, and links/images.

NOTE: It works best with Leaderboard size advertisements (Approximately 728x90)

Code:

<if condition="!(
(THIS_SCRIPT == 'login') OR
(THIS_SCRIPT == 'register') OR
(THIS_SCRIPT == 'usercp') OR
(THIS_SCRIPT == 'private') OR
(THIS_SCRIPT == 'subscription') OR
(THIS_SCRIPT == 'payments') OR
(THIS_SCRIPT == 'invites') OR
(THIS_SCRIPT == 'memberlist') OR
(THIS_SCRIPT == 'online') OR
(THIS_SCRIPT == 'member') OR
(THIS_SCRIPT == 'spiders') OR
(THIS_SCRIPT == 'psistats') OR
(THIS_SCRIPT == 'profile') OR
(THIS_SCRIPT == 'faq') OR
(THIS_SCRIPT == 'sendmessage') OR
(THIS_SCRIPT == 'CybPayPal') OR
(THIS_SCRIPT == 'calendar') OR
((THIS_SCRIPT == 'calendar') AND $_REQUEST['do'] == 'add') OR
((THIS_SCRIPT == 'misc') AND $_REQUEST['moderator_stats'] == '') OR
((THIS_SCRIPT == 'search') AND $_REQUEST['searchid'] == '') OR
((THIS_SCRIPT == 'gallery_search') AND $_REQUEST['searchid'] == '') OR
(THIS_SCRIPT == 'gallery_upload') OR
(THIS_SCRIPT == 'THIS_SCRIPT')
)">

<br />

<table class="tborder" cellpadding="$stylevar[cellpadding]" cellspacing="$stylevar[cellspacing]" border="0" width="100%" align="center">
<tr><td align="left" width="728" class="thead" colspan="2">
<a style="float:$stylevar[right]" href="#top" onclick="return toggle_collapse('ad_head')"><img id="collapseimg_ad_head" src="$stylevar[imgdir_button]/collapse_tcat$vbcollapse[collapseimg_ad_head].gif" alt="" border="0" /></a>
Sponsored Links</td></tr>
<tbody id="collapseobj_ad_head" style="$vbcollapse[collapseobj_ad_head]">
<tr><td class="alt1" colspan="2" ><span class="smallfont"><center>

<!-- CODE HERE -->

</center></span></td></tr>
</tbody>
</table>

<br />

<else />

</if>

------------------------------------------------------
This default version of the code will display the ads on every page except the following:

Login Pages
Registry Pages
User CP Pages
Private Messages List Pages
Subscription Payment Pages
Invitations Hack Pages
Members List Page
Online Members Page
Member Pages
Spider Watcher Hack Pages
psiStats Hack Pages
User Profile Page
FAQ Page
Send PM Page
Cyber PayPal Donation Hack Page
Calendar Page
Adding Calendar Events
Moderator Statistics Hack Page
Search Form Page
Gallery Searching Page
Gallery Uploading Page
Error Pages
------------------------------------------------------

NOTE: If you find that the spacing between the table is too big or too little, add/remove the colored <br /> s


If you add a modification that ads another page, add the following in the space below (THIS_SCRIPT == 'CybPayPal') OR

Code:

(THIS_SCRIPT == '<PHP FILE NAME HERE>') OR
So if the php file name is arcade.php, it would look like this:

Code:

(THIS_SCRIPT == 'arcade') OR
If the hack is an addition to an already existing php file, find the command/script within. For example, if I didn't want ads to show in the new posts list, I couldn't do that using just the file name, because the file name is search, which would in turn remove the ads from every single page that has to do with search. What you need to do is copy the link of the new posts page, and copy the command, which looks like this:

Code:

http://www.siteurl.com/forum/search.php?do=getnew
So what you need to add in the template would look like this:

Code:

((THIS_SCRIPT == 'search') AND $_REQUEST['getnew'] == '') OR
I recommend using these in the header and/or footer templates. Add this at the lowest place possible in the header, and the highest place possible if in the footer (Right below the copyright notices)


Support is available if needed. You can contact me via MSN at rsx@nerdshack.com, or by email (same address)

Please give feedback!


Thanks & Enjoy!


P.S. THIS MODIFICATION IS COMPATIBLE WITH EVERY VERSION OF VBULLETIN :)

P.S 2: This is my first mod release so if I did anything wrong don't hurt me. Just tell me what the problem is and I will fix it ASAP ;) :bunny:



DementedMindz 03-18-2006 01:57 AM

RsX thank you will give it a try :)

RsX 03-18-2006 02:00 AM

No problem :)

Glad I could help


EDIT: (Yey 5 installs ^_^ Thank you!!)

Yorixz 03-18-2006 08:22 AM

Very nice hack, sadly I've already been removed from Adsense because I didn't exclude one of these pages (they didn't say what one); trust me, once you get kicked from Adsense their customer support seems to ignore you :(

MentaL 03-18-2006 11:16 AM

thats based on satallite skin right? So it needs adapting :)

Snake 03-18-2006 11:48 AM

Sweet I've been waiting for this. Thanks!

RsX 03-18-2006 04:38 PM

Quote:

Originally Posted by mentalrz
thats based on satallite skin right? So it needs adapting :)

Oh, that's correct, the spacer was based on satellite skin...
Ill rewrite it as a <br />

Thanks :)

RsX 03-18-2006 05:11 PM

Quote:

Originally Posted by Aftermath
Sweet I've been waiting for this. Thanks!

Thanks :)

Don't forget to click instal (if you did :bunny:)

soulface 03-19-2006 03:28 PM

Thx man. nice idea.

/me installed...

RsX 03-19-2006 08:59 PM

Thanks :) Im glad you like it

SIINSI 03-24-2006 03:54 PM

Thanks installed...

What if I wanted to to have it not show in another directory?

ie: I use photopost and I have photopost installed in the http://www.mysite.com/forums/gallery/ directory.

Photopost is using my vb navbar tempate where I have your hack installed. How would I make it so it wouldn't show on http://www.mysite.com/forums/gallery/uploadphoto.php ?

I tried just adding (THIS_SCRIPT == 'uploadphoto') OR in the middle but, that didn't work.

Thanks,
Miguel

RsX 03-26-2006 01:08 AM

Try (THIS_SCRIPT == 'gallery/uploadphoto')

vbreal 03-30-2006 03:09 AM

hmm i got the collapsed box but it still shows on every page

vbreal 04-05-2006 03:10 AM

the banners still show on every page. what could i be doing wrong

GeorgeNewbie 04-05-2006 07:19 PM

nice!:banana:
:installed:

vbreal 04-11-2006 08:45 AM

the banners still show on every page. what could i have done wrong

thanks

RsX 04-15-2006 03:50 PM

Did you use the if commands correctly?

Could you also please provide a link to your forum?

Dermo-MIO 04-23-2006 11:28 AM

props dude this is exactly what i was looking for lets hope i make myself some money from adsense now

Hemanth 04-23-2006 12:06 PM

Great.. But i'm using adense in 'ForumHome','Showthread' & 'Forum Display' Only. This seems more good for me as i don't want to be kicked out by adsense :D

RsX 04-23-2006 06:39 PM

Thanks for installing :)
Im glad you like it!

If you have any questions or suggestions, I'd be glad to answer/take a look!

GeorgeNewbie 04-24-2006 04:30 PM

is there a way to put more than one sponsor in and have them side by side...i tried but they sit ontop of one another?

nelto 04-25-2006 11:43 AM

Im kinda of a newb around and I was looking to hsi.

I didnt found any type of instroctions on how to set this up.
Can any one hlep me out here?

RsX 04-27-2006 03:07 AM

Place it in your Header template

RsX 04-27-2006 03:11 AM

Quote:

Originally Posted by GeorgeNewbie
is there a way to put more than one sponsor in and have them side by side...i tried but they sit ontop of one another?

Modify this part of the code:


Code:

<br />

<table class="tborder" cellpadding="$stylevar[cellpadding]" cellspacing="$stylevar[cellspacing]" border="0" width="100%" align="center">
<tr><td align="left" width="728" class="thead" colspan="2">
<a style="float:$stylevar[right]" href="#top" onclick="return toggle_collapse('ad_head')"><img id="collapseimg_ad_head" src="$stylevar[imgdir_button]/collapse_tcat$vbcollapse[collapseimg_ad_head].gif" alt="" border="0" /></a>
Sponsored Links</td></tr>
<tbody id="collapseobj_ad_head" style="$vbcollapse[collapseobj_ad_head]">
<tr><td class="alt1" colspan="2" ><span class="smallfont"><center>

 <!-- CODE HERE -->

</center></span></td></tr>
</tbody>
</table>

<br />


to look like this:


Code:

<br />

<table class="tborder" cellpadding="$stylevar[cellpadding]" cellspacing="$stylevar[cellspacing]" border="0" width="100%" align="center">
<tr><td align="left" width="728" class="thead" colspan="2">
<a style="float:$stylevar[right]" href="#top" onclick="return toggle_collapse('ad_head')"><img id="collapseimg_ad_head" src="$stylevar[imgdir_button]/collapse_tcat$vbcollapse[collapseimg_ad_head].gif" alt="" border="0" /></a>
Sponsored Links</td></tr>
<tbody id="collapseobj_ad_head" style="$vbcollapse[collapseobj_ad_head]">
<tr><td class="alt1" colspan="2" ><span class="smallfont"><center>

 <!-- CODE OF BANNER 1 HERE -->

</center></span></td></tr>
</tbody>
</table>



<table class="tborder" cellpadding="$stylevar[cellpadding]" cellspacing="$stylevar[cellspacing]" border="0" width="100%" align="center">
<tr><td align="left" width="728" class="thead" colspan="2">
<a style="float:$stylevar[right]" href="#top" onclick="return toggle_collapse('ad_head2')"><img id="collapseimg_ad_head2" src="$stylevar[imgdir_button]/collapse_tcat$vbcollapse[collapseimg_ad_head2].gif" alt="" border="0" /></a>
Sponsored Links</td></tr>
<tbody id="collapseobj_ad_head2" style="$vbcollapse[collapseobj_ad_head2]">
<tr><td class="alt1" colspan="2" ><span class="smallfont"><center>

 <!-- CODE OF BANNER 2 HERE -->

</center></span></td></tr>
</tbody>
</table>

<br />


wobbly 06-25-2006 01:07 PM

Installed thx,

Is there anyway to make the ads just viewable to certain usergroups at all?

Tulsa 06-25-2006 02:54 PM

Replace the usergroup #'s that you want to be able to see the ad with the 1 2 3 4 etc..

<if condition="is_member_of($bbuserinfo, array(1, 2, 3, 4))">

Insert the code your controlling

</if>

Dannyboy1 06-29-2006 01:35 PM

Here is my question, can I remove Adsense ads only from specific folders with this script? I need to do that :)

Get Shorty 07-01-2006 08:47 PM

Simple to change... Great idea!

Clicked install...

Get Shorty 07-02-2006 12:12 AM

:\

I'm using this for my Adsense banners. Anytime someone clicks on a banner, the following error shows up:

This page contains the following errors:

error on line 1 at column 1: Extra content at the end of the document
Below is a rendering of the page up to the first error.




Any thoughts? I just pasted my adsense code in the specified area.


edit
Nevermind. It just doesn't seem to work in Safari. It works perfectly in IE and Firefox. :)

Cosimo 07-05-2006 10:29 PM

Great work :)

Installed it currently on my vb3.6.0b4

Dumi 07-25-2006 10:41 AM

Amazing mode...just what I wanted!

Dumi 07-25-2006 11:52 AM

The bottom banner I am unable to collapse. I used the same code as the top. I put the code at the very top.

http://www.prisonbreakscene.com

Code:

<if condition="!(
(THIS_SCRIPT == 'login') OR
(THIS_SCRIPT == 'register') OR
(THIS_SCRIPT == 'usercp') OR
(THIS_SCRIPT == 'private') OR
(THIS_SCRIPT == 'subscription') OR
(THIS_SCRIPT == 'payments') OR
(THIS_SCRIPT == 'invites') OR
(THIS_SCRIPT == 'memberlist') OR
(THIS_SCRIPT == 'online') OR
(THIS_SCRIPT == 'member') OR
(THIS_SCRIPT == 'spiders') OR
(THIS_SCRIPT == 'psistats') OR
(THIS_SCRIPT == 'profile') OR
(THIS_SCRIPT == 'faq') OR
(THIS_SCRIPT == 'sendmessage') OR
(THIS_SCRIPT == 'CybPayPal') OR
(THIS_SCRIPT == 'calendar') OR
((THIS_SCRIPT == 'calendar') AND $_REQUEST['do'] == 'add') OR
((THIS_SCRIPT == 'misc') AND $_REQUEST['moderator_stats'] == '') OR
((THIS_SCRIPT == 'search') AND $_REQUEST['searchid'] == '') OR
((THIS_SCRIPT == 'gallery_search') AND $_REQUEST['searchid'] == '') OR
(THIS_SCRIPT == 'gallery_upload') OR
(THIS_SCRIPT == 'THIS_SCRIPT')
)">

<br />

<table class="tborder" cellpadding="$stylevar[cellpadding]" cellspacing="$stylevar[cellspacing]" border="0" width="100%" align="center">
<tr><td align="left" width="728" class="thead" colspan="2">
<a style="float:$stylevar[right]" href="#top" onclick="return toggle_collapse('ad_head')"><img id="collapseimg_ad_head" src="$stylevar[imgdir_button]/collapse_tcat$vbcollapse[collapseimg_ad_head].gif" alt="" border="0" /></a>
Sponsored Links</td></tr>
<tbody id="collapseobj_ad_head" style="$vbcollapse[collapseobj_ad_head]">
<tr><td class="alt1" colspan="2" ><span class="smallfont"><center>

<script type="text/javascript"><!--
google_ad_client = "pub-9433563858228418";
google_ad_width = 728;
google_ad_height = 90;
google_ad_format = "728x90_as";
google_ad_type = "text_image";
google_ad_channel ="";
google_color_border = "AC5B22";
google_color_bg = "F6DFCE";
google_color_link = "AC5B22";
google_color_text = "AC5B22";
google_color_url = "AC5B22";
//--></script>
<script type="text/javascript"
  src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>

</center></span></td></tr>
</tbody>
</table>

<br />

<else />

</if>

<br />
<div class="smallfont" align="center">$vbphrase[all_times_are_gmt_x_time_now_is_y]</div>
<br />

$spacer_close
<!-- /content area table -->

<form action="$vboptions[forumhome].php" method="get">
       
<table cellpadding="$stylevar[cellpadding]" cellspacing="0" border="0" width="$stylevar[outertablewidth]" class="page" align="center">
<tr>
        <if condition="$show['quickchooser']">
                <td>
                        <select name="styleid" onchange="switch_id(this, 'style')">
                                <optgroup label="$vbphrase[quick_style_chooser]">
                                        $quickchooserbits
                                </optgroup>
                        </select>
                </td>
        </if>
        <if condition="$show['languagechooser']">
                <td>
                        <select name="langid" onchange="switch_id(this, 'lang')">
                                <optgroup label="$vbphrase[quick_language_chooser]">
                                        $languagechooserbits
                                </optgroup>
                        </select>
                </td>
        </if>
        <td align="$stylevar[right]" width="100%">
                <div class="smallfont">
                        <strong>
                                <if condition="$show['contactus']"><a href="$vboptions[contactuslink]" rel="nofollow">$vbphrase[contact_us]</a> -</if>
                                <a href="$vboptions[homeurl]">$vboptions[hometitle]</a> -
                                <if condition="$show['admincplink']"><a href="$admincpdir/index.php$session[sessionurl_q]">$vbphrase[admin]</a> -</if>
                                <if condition="$show['modcplink']"><a href="$modcpdir/index.php$session[sessionurl_q]">$vbphrase[mod]</a> -</if>
                                <if condition="$vboptions['archiveenabled']"><a href="archive/index.php">$vbphrase[archive]</a> -</if>
                                <if condition="$vboptions[privacyurl]"><a href="$vboptions[privacyurl]">$vbphrase[privacy_statement]</a> -</if>
                                <a href="#top" onclick="self.scrollTo(0, 0); return false;">$vbphrase[top]</a>
                        </strong>
                </div>
        </td>
</tr>
</table>
</form>

</td><td width="84" background="$stylevar[imgdir_misc]/br.gif">
        <img src="$stylevar[imgdir_misc]/br.gif" width="84" height="2" align="right"></td>
</table>

<div align="justify">
        <table cellSpacing="0" cellPadding="0" align="center">
                <tr>
                        <td><img src="$stylevar[imgdir_misc]/footer1.gif"></td>
                </tr>
        </table>
</div>
<div align="justify">
        <table height="60" cellSpacing="0" cellPadding="0" width="1000" background="$stylevar[imgdir_misc]/footer2.gif" align="center">
                <tr>
                        <td align="middle" background="$stylevar[imgdir_misc]/footer2.gif">
                                <div class="smallfont" align="center">
                        <a style="text-decoration: none; color: #AC5B22" href="http://www.starpages.net/cgi-bin/star.pl?VID=1152650057">
                        Vote For Our Site
                                <br />
        <!-- Do not remove this copyright notice -->
        $vbphrase[powered_by_vbulletin]
        <!-- Do not remove this copyright notice -->
        </div>
                <div class="smallfont" align="center">
        <!-- Do not remove $cronimage or your scheduled tasks will cease to function -->
        $cronimage
        <!-- Do not remove $cronimage or your scheduled tasks will cease to function -->
       
        $vboptions[copyrighttext]</div></td>
                </tr>
        </table>
        <table class="smalltxt" height="56" cellSpacing="0" cellPadding="0" width="1000" background="$stylevar[imgdir_misc]/footer3.gif" align="center">
                <tr>
                        <td vAlign="top" align="right" width="435"></td>
                        <td vAlign="top" align="left" width="364"></td>
                </tr>
        </table>
</div>
</center>
<if condition="$show['dst_correction']">
<!-- auto DST correction code -->
<form action="profile.php" method="post" name="dstform">
        <input type="hidden" name="s" value="$session[sessionhash]" />
        <input type="hidden" name="do" value="dst" />
</form>
<script type="text/javascript">
<!--
        var tzOffset = $bbuserinfo[timezoneoffset] + $bbuserinfo[dstonoff];
        var utcOffset = new Date().getTimezoneOffset() / 60;
        if (Math.abs(tzOffset + utcOffset) == 1)
        {        // Dst offset is 1 so its changed
                document.forms.dstform.submit();
        }
//-->
</script>
<!-- / auto DST correction code -->

</if>
<script type="text/javascript">
<!--
        // Main vBulletin Javascript Initialization
        vBulletin_init();
//-->
</script>


Dumi 07-25-2006 07:05 PM

It works fine with one at the header but once you at the second one in the footer or the forumdisplay it wont work at all!

Dumi 07-27-2006 08:27 PM

Anyone have this issue also?

Dumi 07-30-2006 05:37 PM

Bump!

Dumi 08-03-2006 02:36 AM

Any ideas guys!

project-Buckfas 08-09-2006 06:36 PM

Is it safe to have this (displaying google ads) on vbadvanced and forum index?

Dumi 08-10-2006 05:06 AM

I dont see why not, there is content on both those pages!

project-Buckfas 08-10-2006 02:57 PM

Thanks. For some reason I thought they weren't allowed on pages with registration. I understand now though!

Nuguru 08-11-2006 10:55 PM

Hello,

Very nice addition, thank you.

Hey, does anyone know where I could find a script (or does anyone know a script 'php, html' java') that would rotate linked banners? The script would go in the spot of:

<!-- CODE HERE -->

in this new addition.


Thank You,

Nuguru :)


All times are GMT. The time now is 05:03 PM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01582 seconds
  • Memory Usage 1,874KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (8)bbcode_code_printable
  • (3)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (40)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete