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
  #152  
Old 04-08-2006, 12:28 PM
GrendelKhan{TSU's Avatar
GrendelKhan{TSU GrendelKhan{TSU is offline
 
Join Date: Jun 2005
Location: Boston | Seoul, S. Korea
Posts: 1,311
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by UK Jimbo
Hi GrendelKhan

Are the pages publically visible or do you have to register to see them? If Googlebot can't get at the pages (and content) from the same URL that you're using to access it then it can't index it. Sometimes it might take a while for pages to get indexed. I'd give it a couple of days and see how it goes. Post back and let me know how you get on.
Hey jimbo, thanks for the reply (sorry I've been out this week and didn't see it).

The threads are all public. (no registration necessary to read)
And its been like this for weeks. :/

(eg:
here's one with a ton of text about the superbowl and ward winning MVP...but again, the ads are still "free forum software etc."
http://www.naestar.net/forums/showthread.php?t=19196 )
Reply With Quote
  #153  
Old 04-09-2006, 08:37 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 GrendelKhan{TSU
(eg:
here's one with a ton of text about the superbowl and ward winning MVP...but again, the ads are still "free forum software etc."
http://www.naestar.net/forums/showthread.php?t=19196 )
Hotels in Seoul of Korea
Animaged images for ?150
All Steelers games on DVD

were the ads I got. Looks like it's working.
Reply With Quote
  #154  
Old 04-09-2006, 09:11 AM
GrendelKhan{TSU's Avatar
GrendelKhan{TSU GrendelKhan{TSU is offline
 
Join Date: Jun 2005
Location: Boston | Seoul, S. Korea
Posts: 1,311
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by UK Jimbo
Hotels in Seoul of Korea
Animaged images for ?150
All Steelers games on DVD

were the ads I got. Looks like it's working.
really? :/
is some kinda of geo-location in effect? where are you located?

I get 4 forum software or other related ads. (ie: pretty useless)
(see image).

can you check some other threads and see if you get related ads? I'd appreciated it greatly. I want to see if its just feeding me those ads.
Reply With Quote
  #155  
Old 04-10-2006, 01:44 AM
tamborinegal's Avatar
tamborinegal tamborinegal is offline
 
Join Date: Sep 2005
Location: Australia
Posts: 119
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Works very well. Thank you.

Clancy
Reply With Quote
  #156  
Old 04-10-2006, 03:20 PM
Makaveli105's Avatar
Makaveli105 Makaveli105 is offline
 
Join Date: May 2004
Location: California
Posts: 124
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by GrendelKhan{TSU
really? :/
is some kinda of geo-location in effect? where are you located?

I get 4 forum software or other related ads. (ie: pretty useless)
(see image).

can you check some other threads and see if you get related ads? I'd appreciated it greatly. I want to see if its just feeding me those ads.
I see relevant ads.

Steelers pendants
Pittsburg Steelers
Pittsburg Steelers
Seoul Hotels

---

Thanks UK Jimbo, I'll give it a go
Reply With Quote
  #157  
Old 04-12-2006, 12:29 AM
arossphoto arossphoto is offline
 
Join Date: Jan 2006
Posts: 126
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by UK Jimbo
Took less time than I thought - give this a try:

Code:
// only for non-threaded display
if($threadedmode == 0) {

	// only need to do the calculation once
	if( $counter == 2 && empty($GLOBALS['adsense_position'] && $totalposts >= 3 ) ) {

		$_min = $postcount;
		$_max = min($totalposts,$_min+$perpage-1) - 1;

		$GLOBALS['adsense_position'] = rand($_min,$_max);
	}

}
I've installed and it's working very well. Will the code above display the ads after the first post and before the last? Would you mind showing me what the whole code for the post bit would look like, and is it possible to show the ads to certain usergroups?

Cheers.
Reply With Quote
  #158  
Old 04-12-2006, 12:00 PM
Marv Marv is offline
 
Join Date: Jun 2002
Location: Germany
Posts: 372
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by UK Jimbo
Any luck?
Sorry for the delay, Jimbo

I?ve installed your code and modified it, so that certain usergroups see/don?t see ads, and to create different ad-channels to have a better overview (targeting).

The code seemed to work fine, but in the last days I had to notice that ads also appeared under the last post. Dunno why, but that?s the situation by now.
Reply With Quote
  #159  
Old 04-12-2006, 12:10 PM
UK Jimbo's Avatar
UK Jimbo UK Jimbo is offline
 
Join Date: Sep 2002
Posts: 249
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Hi guys - I'm really tied up at the moment. Will take a look ASAP but that might be in a few days time.

James
Reply With Quote
  #160  
Old 04-13-2006, 03:04 PM
Niall Fernie's Avatar
Niall Fernie Niall Fernie is offline
 
Join Date: Jan 2006
Location: Scotland
Posts: 5
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I know this is a bit basic, but I missed it on about 20 ocassions during my installation on this plugin.

Make sure you have the plugin/hook system enabled on your board, I was doing a test install on my other vB setup (small site - new install) and could not get this to work at all, until I read the text that vB had been almost shouting at me since the start "the plugin/hook system is currently disabled..."

Enabled it and worked first time.

I know you've probably just wasted 30 seconds of your life reading this, but I've just read every post here before reading the error message so just hoping to save someone 10 minutes.

Great plugin, easy install (especially if you're not as dopy as me)

[cleeeck]INSTALL[/cleeeck]
Reply With Quote
  #161  
Old 04-13-2006, 11:13 PM
sandrodz sandrodz is offline
 
Join Date: Mar 2006
Posts: 105
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

installed, works like charm... only concern is if I can set it to display at the end of the last post only? or after the first post only? cause I believe this kind of random placing isn't efficient in my case... thank you!
Reply With Quote
  #162  
Old 04-14-2006, 05:36 AM
imported_infitech's Avatar
imported_infitech imported_infitech is offline
 
Join Date: Apr 2004
Location: Queens, NY
Posts: 247
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

This stretches my page
Reply With Quote
  #163  
Old 04-14-2006, 02:38 PM
Niall Fernie's Avatar
Niall Fernie Niall Fernie is offline
 
Join Date: Jan 2006
Location: Scotland
Posts: 5
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Now that I have this up and running, can anyone tell me how to modify the first line condition to check for user rank, ie I would also like my Junior members to be able to see the ads. I already have it checking for forums and usergroups. Junior members (less than 30 posts) dont contribute as much content to the site as more senior members so they may as well see the ads.

Thanks in advance for any help.
Reply With Quote
  #164  
Old 04-16-2006, 05:33 AM
The Chief's Avatar
The Chief The Chief is offline
 
Join Date: Aug 2005
Location: Montreal
Posts: 1,037
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Does this work on postbit template, doesn't seem to work on mine, it creates the first post normal, then every post after that just decreases in size, lol..

the last post is super small..??
Reply With Quote
  #165  
Old 04-16-2006, 05:47 AM
AzzidReign's Avatar
AzzidReign AzzidReign is offline
 
Join Date: Apr 2006
Posts: 497
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Sweet! I've been looking for this! Thanks a lot!

I had some troubles, but once I put the code in both postbit and legacy, then the ads started showing up! Brilliant mod! Thanks very much!
Reply With Quote
  #166  
Old 04-21-2006, 09:38 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 imported_infitech
This stretches my page
Nice forum style - doesn't look very standard to me though.

You probably need to change the HTML accordingly
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 06:09 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.05506 seconds
  • Memory Usage 2,372KB
  • 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
  • (1)bbcode_code
  • (1)bbcode_html
  • (7)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
  • (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