The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
Randomly positioned ad in between postbits in showthread Details »» | |||||||||||||||||||||||||||
Randomly positioned ad in between postbits in showthread
Developer Last Online: Mar 2013
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
|
Comments |
#138
|
|||
|
|||
clicking install
|
#139
|
|||
|
|||
Hi UK Jimbo,
I?ve got my own custom Ads showing up above the first post and under the lastpost. Any chance that your plugin could show the Ads only under the firstpost and above the lastpost ? Otherwise sometimes there would be 2 Ads showing up and that?s not nice and clean.. Guess it could be done with another conditional in PHP Code:
Any ideas ? |
#140
|
|||
|
|||
Quote:
even better would be a second one for registered users where Adsense only appears:
Would turn this plug-in into a must-have for all AdSense and Yahoo publishers, which have already own custom ads or adservers running on their forums |
#141
|
|||
|
|||
Quote:
PHP Code:
|
#142
|
||||
|
||||
@Marv
Try replacing the plugin code with this (untested) edit: removed, that's not going to work. Have a meeting to go to now but will look at it a bit later |
#143
|
||||
|
||||
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); } } |
#144
|
|||
|
|||
I get this error with that code above:
Parse error: parse error, unexpected T_BOOLEAN_AND, expecting ')' in /pathto/showthread.php(1031) : eval()'d code on line 5 BTW - awesome plugin. |
#145
|
||||
|
||||
OOps - that's what happens when you do things in a hurry. Try this for size:
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); } } |
#146
|
|||
|
|||
Works. Thank you!
|
#147
|
|||
|
|||
Quote:
I?ll give it a try and report back to you asap. |
#148
|
||||
|
||||
installed and works great!!
|
#149
|
||||
|
||||
Quote:
|
#150
|
||||
|
||||
I don't know if cause I installed this wrong or the Googlebot just isn't doing its job (so to speak)...
but I'm having trouble actually getting relevant ads. I don't think the googlebot is actually "reading" the content of the page. I always get ads for "free forum software" and related. ie: I think its basically only reading the footer. or something any ideas as to what is blocking or causing the Gbot to not actually dig into the content? |
#151
|
||||
|
||||
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. |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|