vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 4.x Template Modifications (https://vborg.vbsupport.ru/forumdisplay.php?f=246)
-   -   Forum Home Enhancements - Adsense code in fake forum on forum home (https://vborg.vbsupport.ru/showthread.php?t=241996)

naisho 05-05-2010 10:00 PM

Adsense code in fake forum on forum home
 
1 Attachment(s)
I used this kind of template mod on previous vBulletin 3.8, but it didn't work any longer with version 4.xx so I made a new one.

What it does

On forum home, it displays one or more adsense codes like forum. It behaves like one or more fake forums (see attached images).
You can display it/them anyhere using the "display order" in forum manager.

How to
1 - Go to admincp and create one or two new forums:
Give them any name you want
In the description, put your adsense code (it should be a 468x60px adsense block for a correct display), then these settings are important:
  • Act as forum: yes
  • Active: yes
  • Open: no
  • Show this Forum and Child Forums on the Quick Navigation menu: no
If you stop here, you have two forums that are clickable in forum home, leading to empty forum. To prevent visitors from ckicking on these forum titles, we need to display only the descriptions (adsense code), not the titles.

2 - Two templates must be edited:
  • forumhome_forumbit_level2_post
  • forumhome_forumbit_level1_post
forumhome_forumbit_level2_post template is the full forum home forum list
forumhome_forumbit_level1_post template is the forum category list

In both template:
Find:
Code:

<h2 class="forumtitle"><a href="{vb:link forum, {vb:raw forum}}">{vb:raw forum.title}</a></h2>
And replace with:

Code:

<vb:comment>Do not show title in these forums</vb:comment>
<vb:if condition="$forumid != in_array($forumid, array(X,Y))">
<h2 class="forumtitle"><a href="{vb:link forum, {vb:raw forum}}">{vb:raw forum.title}</a></h2>
</vb:if>
<vb:comment>End of th title condition </vb:comment>

X, Y are the newly created forum IDs

The result is shown in the first attached image below.

More...

To catch visitors' attention, you may wish to display a different forum icon next to these adsense codes (see second attached image). To achieve this, you must edit the same templates.

Find:
Code:

<img src="{vb:stylevar imgdir_statusicon}/{vb:raw forum.imageprefix}forum_{vb:raw forum.statusicon}-48.png" class="forumicon" id="forum_statusicon_{vb:raw forum.forumid}" alt="" />
And replace with:

Code:

<vb:comment>New forum icon for adsense code</vb:comment>
<vb:if condition="$forumid != in_array($forumid, array(X,Y))">
                    <img src="{vb:stylevar imgdir_statusicon}/{vb:raw forum.imageprefix}forum_{vb:raw forum.statusicon}-48.png" class="forumicon" id="forum_statusicon_{vb:raw forum.forumid}" alt="" />
<vb:else />
<vb:if condition="in_array($forumid, array(X,Y))"> 
<img src="http://www.YOURSITE.COM/forum/images/search_results/search_results_socialgroup_discussion.png" class="forumicon">
</vb:if></vb:if>
<vb:comment>End of new forum icon edit</vb:comment>

X and Y are your new forum
The URL must be your forum URL.
You can use the icon you want. This one is only an example (see second attached image)

TNCclubman 05-06-2010 10:00 PM

Isnt this kind of like tricking people into clicking your adsense and is frowned upon by google?

ShawneyJ 05-07-2010 01:04 AM

Quote:

Originally Posted by TNCclubman (Post 2032827)
Isnt this kind of like tricking people into clicking your adsense and is frowned upon by google?

agreed, in order to use this you would have to simply change the out line of the google ad.

i will be using this, great addon mate thanks.

TNCclubman 05-07-2010 01:06 AM

I like it too! Hopefully we dont get our accounts terminated lol

ShawneyJ 05-07-2010 03:18 AM

you wont if you make your ads more visible color.

tafreeh 05-07-2010 04:44 AM

1 Attachment(s)
instead of putting social group logo or any other image.. you should put Google ads image so it tells people these are ads... I guess thats how u can cover your A$$

m2006 05-07-2010 08:04 AM

wow..nice thank you very much

DxSEO 05-07-2010 09:05 AM

tagged for future use

sKippah 05-07-2010 09:27 AM

Tagged. Maybe u change the Icon in front, that it is more visible as an adsense......

goxy63 05-07-2010 12:11 PM

Tagged Rated Nominated
Just great :D


All times are GMT. The time now is 09:19 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.01155 seconds
  • Memory Usage 1,737KB
  • 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
  • (4)bbcode_code_printable
  • (1)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (2)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)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