The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
Adsense code in fake forum on forum home Details »» | |||||||||||||||||||||||||||||
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:
2 - Two templates must be edited:
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> 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> 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="" /> 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> The URL must be your forum URL. You can use the icon you want. This one is only an example (see second attached image) Screenshots
Show Your Support
|
Comments |
#12
|
|||
|
|||
How can u get rid of the Counters?
|
#13
|
|||
|
|||
Quote:
Locate this part: Code:
<h4 class="nocss_label">{vb:rawphrase forum_statistics}:</h4> <ul class="forumstats td"> <li>{vb:rawphrase threads}: {vb:raw forum.threadcount}</li> <li>{vb:rawphrase posts}: {vb:raw forum.replycount}</li> </ul> <div class="forumlastpost td"> <h4 class="lastpostlabel">{vb:rawphrase last_post}:</h4> <div> {vb:raw forum.lastpostinfo} </div> </div> Before this part you add the condition: Code:
<vb:comment>Do not show statistics and last post info in these forums</vb:comment> <vb:if condition="$forumid != in_array($forumid, array(X,Y))"> And after you close your if condition: Code:
</vb:if> <vb:comment>Do not show statistics/last post info - end</vb:comment> So, the result should be this: Code:
<vb:comment>Do not show statistics and last post info in these forums</vb:comment> <vb:if condition="$forumid != in_array($forumid, array(X,Y))"> <h4 class="nocss_label">{vb:rawphrase forum_statistics}:</h4> <ul class="forumstats td"> <li>{vb:rawphrase threads}: {vb:raw forum.threadcount}</li> <li>{vb:rawphrase posts}: {vb:raw forum.replycount}</li> </ul> <div class="forumlastpost td"> <h4 class="lastpostlabel">{vb:rawphrase last_post}:</h4> <div> {vb:raw forum.lastpostinfo} </div> </div> </vb:if> <vb:comment>Do not show statistics/last post info - end</vb:comment> |
#14
|
|||
|
|||
Perfectly. Two more, the last , questions. Is it possible to center the ad(s) and is it also possible to add a refresh function?
Thanks a lot |
#15
|
|||
|
|||
These edits are quite simple as they keep the div and only hide their contents (title, statistics and last post).
If you want to center the whole thing in the page, then the template must be completely different. I don't know how to refresh the ad code. Sorry. |
#16
|
|||
|
|||
i wont to but google ads where i but here
|
#17
|
||||
|
||||
Quote:
I need to add an ad banner in middle of forums on my forum homepage. Thanks |
#18
|
|||
|
|||
btw i still dont get why x and y
If i add a new forum i just have one id. is this maybe for the Forum-Kategorie AND the forum itself? |
#19
|
|||
|
|||
Quote:
If you create only one, you don't need the Y. In this case you could use this kind of condition: Code:
<vb:if condition="$forumid != X"> Code:
<vb:if condition="$forumid != in_array($forumid, array(X,Y))"> Quote:
|
#20
|
|||
|
|||
So do you guys still have your GA accounts? lol...
Ill just tag this for now.. Thanks for sharing coder.. |
#21
|
|||
|
|||
As of today the ads are still up in his forum, so I'm guessing this is legit.
However, forum row DOES change color on mouseover in his forum. Something to keep in mind. |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|