![]() |
Randomly positioned ad in between postbits in showthread
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"> 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. https://vborg.vbsupport.ru/external/2010/02/12.gif |
I'll give this one a try, because the "Adsense after first post" did not work with Firefox at "Quick Reply". Thanks for releasing this one.
edit: works perfect. |
I had the same problem with the adsense code affecting the functionality of AJAX. Quick reply would work ONLY if you did not have to click to activate it. One thing you may want to test is to attempt to click quick reply in a post AFTER the display of the adsense and see if it works.
The code I have now will allow you to click quick reply in a post above the adsense, however, not in a post below it. If this works I will be using it :) |
I've installed the plugging and the code and this is not working, What am I doing wrong? Thanks.
It just doesn't show up. |
nice one! just wish we could add/edit the ads without going into the template.
|
can you select certain usergroups not to see this?
|
yea i got the same question, id prefer only guests see the ads, not logged in members, i get more guests than anything
|
mandatory "is there a screen shot?" request. ;) :p
|
To make only guest see the ads take this code and add it at the end of the postbit (_legacy) template.
Code:
<if condition="in_array($bbuserinfo[usergroupid], array(1))"> |
Thanks for posting the usergroup variation Doc Great. I've got no issues with you re-posting the code elsewhere as long as it's not being sold!
|
Quote:
|
Quote:
|
how do you add additional usergroups? to
Code:
<if condition="in_array($bbuserinfo[usergroupid], array(1))"> Code:
<if condition="in_array($bbuserinfo[usergroupid], array(1, 2, 3, 4))"> |
This does appear to work with click for quick reply.
**clicks install** |
To limit it just to certain user groups I'd recommend the following conditional rather than the in_array() solution posted above. This version ensures that secondary group assignments are checked too.
For a single user group (1 in this case) PHP Code:
PHP Code:
|
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? |
That's a nice idea and one I'll look into. I think it will be possible to use the $threadview variable but it'll require slightly more CPU and will have to deal with cases where the latest the newest post isn't displayed on the page.
|
How can I get this to not show in the PM's???
For some reason it is screwing up the page formatting when viewing private messages. |
Quote:
|
Quote:
|
Quote:
|
Quote:
This problem can be fixed with a simple template change. I've adjusted the code listed above to include the additional condition: $GLOBALS['adsense_position'] > 0 |
Quote:
Copy/paste the code you've put in your template and I'll try to help. |
Quote:
|
Quote:
|
Quote:
|
Quote:
I've placed it at the end right after <!-- / post $post[postid] popup menu --> <if condition="$show['spacer']"> </div> $spacer_close </if> <!-- / post #$post[postid] --> PHP Code:
|
Quote:
PHP Code:
|
Quote:
You already installed the plugin right? Is it active? |
Quote:
Appreciate it sir! |
Quote:
PHP Code:
|
Quote:
|
Quote:
You can either use: PHP Code:
PHP Code:
|
Quote:
Thanks for the help! |
Quote:
I use linear as my default and it does not work. I think the threaded view is for the non registered only. I'll change it to be safe all around. The plugging I installed and it is active. When I upload the pluging what do I select from the drop down? I put it under Ajax_start is that the correct mode? |
Quote:
**Edit** I see what you are talking about...do not go to 'add new plugin' look at the bottom where it shows upload/download plugin and then import the .xml file. |
Quote:
|
Quote:
|
Quote:
|
Quote:
|
All times are GMT. The time now is 11:03 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 | |
---|---|
|
|
![]() |
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|