Go Back   vb.org Archive > vBulletin Modifications > Archive > vB.org Archives > vBulletin 3.5 > vBulletin 3.5 Add-ons
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools
Randomly positioned ad in between postbits in showthread Details »»
Randomly positioned ad in between postbits in showthread
Version: 1.01, by UK Jimbo UK Jimbo is offline
Developer Last Online: Mar 2013 Show Printable Version Email this Page

Version: 3.5.3 Rating:
Released: 10-09-2005 Last Update: Never Installs: 237
Uses Plugins Template Edits
 
No support by the author.

Inspired by this hack.

The ad is positioned randomly after one of the postbits. We use this for positioning adsense ads on visordown.com.

Install the attached plugin then add the following code to your postbit or postbit_legacy template:

HTML Code:
<if condition="$GLOBALS['adsense_position'] == $post['postcount'] && $GLOBALS['adsense_position'] > 0">
$spacer_open 
<div style="padding:0px 0px $stylevar[cellpadding]px 0px"> 

<table class="tborder" cellpadding="$stylevar[cellpadding]" cellspacing="$stylevar[cellspacing]" border="0" width="100%" align="center"> 
<tr> 
	<td class="thead" align="left">Sponsored Links</td> 
</tr> 
<tr> 
	<td class="alt1" align="center">

<!-- ad code goes here -->

	</td> 
</tr> 
</table> 

</div> 
$spacer_close 
</if>

Changelog

v1.01
Bug fix: The ad code shouldn't appear on PMs any more (template change)

Donations

Hopefully this plugin will earn you provide you with some good revenue. If you'd like to show your appreciation please donate as little or as much as you like.

Supporters / CoAuthors

Show Your Support

  • This modification may not be copied, reproduced or published elsewhere without author's permission.

Comments
  #62  
Old 10-12-2005, 09:04 AM
UK Jimbo's Avatar
UK Jimbo UK Jimbo is offline
 
Join Date: Sep 2002
Posts: 249
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Magic. PEBKAC.
Reply With Quote
  #63  
Old 10-12-2005, 05:23 PM
dsotmoon dsotmoon is offline
 
Join Date: Jun 2003
Location: VA - USA
Posts: 194
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

install, thanks for this Jimbo, works perfectly
Reply With Quote
  #64  
Old 10-13-2005, 01:05 AM
dsotmoon dsotmoon is offline
 
Join Date: Jun 2003
Location: VA - USA
Posts: 194
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

one last question, i think, what would I add to the following to keep this from showing in certain forums...

Code:
<if condition="$GLOBALS['adsense_position'] == $post['postcount'] && $GLOBALS['adsense_position'] > 0 && is_member_of($bbuserinfo,array(1,2,3,4,8,9,11,14,15,19))">
Reply With Quote
  #65  
Old 10-13-2005, 08:12 AM
Doc Great's Avatar
Doc Great Doc Great is offline
 
Join Date: Jan 2005
Location: Stuttgart
Posts: 73
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I did (it again ) --> a little modification to show all guests Ad, but let the reg. users choose if they want to get ad-posts or not.

Install: new profile field (single choice) On/Off (parameters) - note the field numer (e.g. 6)

Ad the following code at the end of your postbit (_legacy)

Code:
<if condition="in_array($bbuserinfo[usergroupid], array(1))">
<if condition="$GLOBALS['adsense_position'] == $post['postcount'] && $GLOBALS['adsense_position'] > 0">
$spacer_open 
<div style="padding:0px 0px $stylevar[cellpadding]px 0px"> 

<table class="tborder" cellpadding="$stylevar[cellpadding]" cellspacing="$stylevar[cellspacing]" border="0" width="100%" align="center"> 
<tr> 
	<td class="thead" align="left">Sponsored Links</td> 
</tr> 
<tr> 
	<td class="alt1" align="center">

<!-- Ad Start -->

<!-- Ad between -->


	</td> 
</tr> 
</table> 

</div> 
$spacer_close 
</if></if>

<else />

<if condition="$vbulletin->userinfo['field6'] == 'On'">
<if condition="$GLOBALS['adsense_position'] == $post['postcount'] && $GLOBALS['adsense_position'] > 0">
$spacer_open 
<div style="padding:0px 0px $stylevar[cellpadding]px 0px"> 

<table class="tborder" cellpadding="$stylevar[cellpadding]" cellspacing="$stylevar[cellspacing]" border="0" width="100%" align="center"> 
<tr> 
	<td class="thead" align="left">Sponsored Links</td> 
</tr> 
<tr> 
	<td class="alt1" align="center">

<!-- Ad Start -->

<!-- Ad between -->

	</td> 
</tr> 
</table> 

</div> 
$spacer_close 
</if></if>
Finished - have fun
Reply With Quote
  #66  
Old 10-16-2005, 03:04 PM
lebstars.com lebstars.com is offline
 
Join Date: Oct 2005
Posts: 2
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Could some1 tell me where to put the HTML code,
i installed the xml file through plug-in manager, but What Now?
Reply With Quote
  #67  
Old 10-16-2005, 04:43 PM
UK Jimbo's Avatar
UK Jimbo UK Jimbo is offline
 
Join Date: Sep 2002
Posts: 249
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by lebstars.com
Could some1 tell me where to put the HTML code,
i installed the xml file through plug-in manager, but What Now?
At the end of your postbit or postbit_legacy templates.

The vBulletin manual explains how to edit styles/templates.
Reply With Quote
  #68  
Old 10-21-2005, 05:20 AM
Xplorer4x4 Xplorer4x4 is offline
 
Join Date: Apr 2005
Posts: 938
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Andreas
What about:
Show Adsense in (or under, above) first unread Post of a Thread.
I think this is the place that would get the most user attention?
If this helps you guys i tried using the following IF condition to do this but vB said it was not alowed.

PHP Code:
<if condition="$threadview = fetch_bbarray_cookie('thread_lastview', $thread['threadid']);"
It says:
Quote:
With a few exceptions, function calls are not permitted in template conditional expressions. Please go back and re-write this expression.
Reply With Quote
  #69  
Old 10-21-2005, 07:13 PM
somedevil somedevil is offline
 
Join Date: Aug 2004
Posts: 11
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

OK, I added Doc's code....doesn't seem to be working. All members are seeing the ads with the default for members set to off.

Doc, where you have ad start and ad between twice in the code, am I right in thinking the adsense code should be inserted in both areas?
Reply With Quote
  #70  
Old 11-04-2005, 09:37 AM
lsgworldl lsgworldl is offline
 
Join Date: Sep 2005
Posts: 116
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

<if condition="$GLOBALS['adsense_position'] == $post['postcount'] && $GLOBALS['adsense_position'] > 0"> $spacer_open <div style="padding:0px 0px $stylevar[cellpadding]px 0px"> <table class="tborder" cellpadding="$stylevar[cellpadding]" cellspacing="$stylevar[cellspacing]" border="0" width="100%" align="center"> <tr> <td class="thead" align="left">Sponsored Links</td> </tr> <tr> <td class="alt1" align="center"> <!--e-bannerx.com code begin-->
<SCRIPT language=JavaScript type=text/javascript>
<!--
var rnd = Math.round(Math.random() * 10000000);
document.writeln('<SCR'+'IPT language=JavaScript type=text/javascript src="http://www.e-bannerx.com:8888/adrevolver/banner?js&place=13471&cpy='+rnd+'">');
document.writeln('</SC'+'RIPT>');
//-->
</SCRIPT><NOSCRIPT>
<IFRAME src="http://www.e-bannerx.com:8888/adrevolver/banner?place=13471&cpy=1" width=468 height=60 scrolling=no allowtransparency=true frameborder=0 marginheight=0 marginwidth=0>
<A href="http://www.e-bannerx.com:8888/adrevolver/href?place=13471&rnd=1000" target="_blank">
<IMG src="http://www.e-bannerx.com:8888/adrevolver/banner?img&place=13471&rnd=1000" width=468 height=60 border=0 alt="e-bannerx.com" ismap></A></IFRAME></NOSCRIPT>
<!--e-bannerx.com code end--> </td> </tr> </table> </div> $spacer_close </if>
($hook = vBulletinHook::fetch_hook('postbit_imicons')) ? eval($hook) : false;

where in postbit do I add this, I have tried the end it dont work
Reply With Quote
  #71  
Old 11-04-2005, 09:46 AM
UK Jimbo's Avatar
UK Jimbo UK Jimbo is offline
 
Join Date: Sep 2002
Posts: 249
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by lsgworldl
where in postbit do I add this, I have tried the end it dont work
Are you using legacy postbits? If so add it to postbit_legacy.

I've no idea what you're doing with the code $hook = vBulletinHook::fetch_hook('postbit_imicons')) that shouldn't be in a template anywhere and isn't part of this hack.
Reply With Quote
  #72  
Old 11-04-2005, 09:52 AM
lsgworldl lsgworldl is offline
 
Join Date: Sep 2005
Posts: 116
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

add it where, I dont know where to add it, and I copied and pasted from this thread
Reply With Quote
  #73  
Old 11-04-2005, 09:52 AM
lsgworldl lsgworldl is offline
 
Join Date: Sep 2005
Posts: 116
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

<if condition="$GLOBALS['adsense_position'] == $post['postcount'] && $GLOBALS['adsense_position'] > 0">
$spacer_open
<div style="padding:0px 0px $stylevar[cellpadding]px 0px">

<table class="tborder" cellpadding="$stylevar[cellpadding]" cellspacing="$stylevar[cellspacing]" border="0" width="100%" align="center">
<tr>
<td class="thead" align="left">Sponsored Links</td>
</tr>
<tr>
<td class="alt1" align="center">

<!-- ad code goes here -->

</td>
</tr>
</table>

</div>
$spacer_close
</if>
Reply With Quote
  #74  
Old 11-04-2005, 11:07 AM
UK Jimbo's Avatar
UK Jimbo UK Jimbo is offline
 
Join Date: Sep 2002
Posts: 249
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Install the plugin then at the end of the postbit or postbit_legacy template copy in the code as per the instructions at the top of this thread.

Info on how to edit templates and how to upload plugins is described in detail on the vBulletin site. http://www.vbulletin.com/
Reply With Quote
  #75  
Old 11-04-2005, 11:41 PM
lohman lohman is offline
 
Join Date: Mar 2002
Posts: 4
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Brilliant! This is exactly the kind of ad placement that I was hoping to find. Tower and header/footer ads get ignored, and intrusive pop-over ads are just wrong. This is perfect!

Many Thanks!
Reply With Quote
  #76  
Old 11-05-2005, 01:43 PM
lsgworldl lsgworldl is offline
 
Join Date: Sep 2005
Posts: 116
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

where in the end why isnt there a find this and add below it like most plugins?

Quote:
Originally Posted by UK Jimbo
Install the plugin then at the end of the postbit or postbit_legacy template copy in the code as per the instructions at the top of this thread.

Info on how to edit templates and how to upload plugins is described in detail on the vBulletin site. http://www.vbulletin.com/
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 01:32 PM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.05633 seconds
  • Memory Usage 2,377KB
  • Queries Executed 31 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (2)bbcode_code
  • (1)bbcode_html
  • (1)bbcode_php
  • (5)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_post
  • (1)navbar
  • (6)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (4)pagenav_pagelink
  • (1)pagenav_pagelinkrel
  • (16)post_thanks_box
  • (16)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (16)post_thanks_postbit_info
  • (15)postbit
  • (16)postbit_onlinestatus
  • (16)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.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/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.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
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete