vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3.8 Template Modifications (https://vborg.vbsupport.ru/forumdisplay.php?f=236)
-   -   Forum Display Enhancements - Replace "Display Options" In Forum Display With "Google Adsense" (https://vborg.vbsupport.ru/showthread.php?t=261040)

ShawneyJ 03-27-2011 10:00 PM

Replace "Display Options" In Forum Display With "Google Adsense"
 
1 Attachment(s)
I searched all over Vb org for a mod to replace "display options" with a google ad in Forum Display. Sorry if there is some sort of mod out there, but i couldnt find one.
Im not sure if this mod will be at any use to anyone, but i wanted it, i seen it on a forum while searching the net. What i came up with was not spot on the same as the forum i seen it at, but i came damn close to it, if not spot on. Im also not sure if my code is %100 perfect but i have tested on IE and FF and it works like a charm.

First you need to install kira's modification, Big thanks to him/her for that mod.

After you have finished installing kira's mod, NEXT, Find In Forum Display Templates >> FORUMDISPLAY

Code:

<!-- Simplified Active Users in this Forum (and sub-forums) and Moderators -->

<table class="tborder" cellpadding="$stylevar[cellpadding]" cellspacing="$stylevar[cellspacing]" border="0" width="100%" align="center">
<tr>
        <if condition="$show['activeusers']">
        <td class="tcat">$vbphrase[currently_active_users]</td>
        </if>
        <if condition="$show['moderators']">
        <td class="tcat">$vbphrase[moderators]</td>
        </if>
</tr>
<tr>
<if condition="$show['activeusers']">
        <td class="thead">$totalonline (<phrase 1="$numberregistered" 2="$numberguest">$vbphrase[x_members_y_guests]</phrase>)</td>
        </if>
        <if condition="$show['moderators']">
        <td class="thead">$vbphrase[moderators] : $totalmods</td>
        </if>
</tr>
<tr>
<if condition="$show['activeusers']">
        <td class="alt1"><div class="smallfont">$activeusers</div></td>
        </if>
        <if condition="$show['moderators']">
        <td class="alt1"><div class="smallfont">$moderatorslist&nbsp;</div></td>
        </if>
</tr>
</table>

<!-- End Simplified Active Users in this Forum (and sub-forums) and Moderators -->



AND REPLACE THE ABOVE CODE WITH THIS:

Code:

<!-- Active Users in this Forum (and sub-forums) and Moderators -->



<table class="tborder" cellpadding="$stylevar[cellpadding]" cellspacing="$stylevar[cellspacing]" border="0" width="100%" align="center">
<tr>
        <td class="tcat">Advertisement</td>
        <if condition="$show['activeusers']">
        <td class="tcat">$vbphrase[currently_active_users]</td>
        </if>
        <if condition="$show['moderators']">
        <td class="tcat">$vbphrase[moderators]</td>
        </if>
</tr>
<tr>
       

<td class="thead"></td>

        <if condition="$show['activeusers']">
        <td class="thead">$totalonline (<phrase 1="$numberregistered" 2="$numberguest">$vbphrase[x_members_y_guests]</phrase>)</td>
        </if>
        <if condition="$show['moderators']">
        <td class="thead">$vbphrase[moderators] : $totalmods</td>
        </if>
</tr>

<tr valign="top">

       
<td class="alt1" width="340">
<table cellpadding="0" cellspacing="0" border="0">


                               
                                <div>YOUR ADSENSE CODE HERE</div>
                       
                </tr></td>
                </table>


        <if condition="$show['activeusers']">
        <td class="alt1"><div class="smallfont">$activeusers</div></td>
        </if>
        <if condition="$show['moderators']">
        <td class="alt1"><div class="smallfont">$moderatorslist&nbsp;</div></td>
        </if>
</tr>
</table>


<!-- End Active Users in this Forum (and sub-forums) and Moderators -->


Replace Your Adsense Code With The Part In The Red.

I am using a (336 x 280) google ad, so if you want to put in say a (468x60) ad, find in the code above:
Code:

<td class="alt1" width="340">
and change it to eg:
Code:

<td class="alt1" width="470">
as you can see we are just changing the number in size <td class="alt1" width="470"> change that to suit your needs.

sorry if the code is a bit messy, i had to add the <div> tags around the google ad to make it display with IE :rolleyes:

Anyway, just thought i'd share this, a good coder would have worked this out quick, but took me ages lol. cheers.
DEMO: Teen Forums
Screen Shot Below.

P.S I Am Currently Running Vbulletin 3.8.7.

FreshFroot 03-31-2011 05:45 AM

Thanks for the tips. This will come in handy!

al2thero 11-25-2012 06:59 PM

thank you


All times are GMT. The time now is 06:40 AM.

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.01126 seconds
  • Memory Usage 1,732KB
  • 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)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (3)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
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete