View Full Version : Usergroup Specific Adverts
Chris M
06-13-2005, 10:00 PM
Installation Instructions
Step 1: Upload the .xml file to the Product Manager
Step 2: Edit the global_advert template to add your advert code, i.e. Google Adsense code
Step 3: Add the variable $advert to any of the following templates: header, navbar, footer - I placed mine at the top of the navbar template to make it show like it does in the screenshots
Step 4: Alter the plugin code to reflect your premium members/staff usergroups so that they do not see the ads (if you don't want them to)
To do so, edit:
if (!in_array($vbulletin->userinfo['usergroupid'], array(5, 6, 7))) {
replacing, obviously, 5, 6, 7 with whatever usergroups you need
Step 5: Click INSTALL (https://vborg.vbsupport.ru/vborg_miscactions.php?do=installhack&threadid=83081):D
To see what it looks like (yes I used a hideous h1 tag and red font to make the point out) take a look at the screenshots... ;)
Updates
Version 1.0.1: Simple update to make this work globally - This will show up in every page :) - To upgrade, remove the forumhome_advert template, delete the existing plugin and follow the installation instructions above :)
Chris
Martin
06-16-2005, 08:30 PM
I installed this, but wouldn't it work better for most people if the adverts were viewable on all pages to non-select usergroups?
mholtum
06-16-2005, 08:37 PM
I installed this, but wouldn't it work better for most people if the adverts were viewable on all pages to non-select usergroups?I like it this way so that people will want to subscribe (pay you money) not to see the ads. ;)
Martin
06-16-2005, 08:49 PM
I like it this way so that people will want to subscribe (pay you money) not to see the ads. ;)
Yes, I'm aware of that. But the way it is currently set up, it only views the add on the index page and the ads go away once you start browsing the forums.
mholtum
06-16-2005, 08:57 PM
I didnt get that far.. Good point. Is there a way to make it viewable on all forum pages?
gang_*
06-17-2005, 10:18 PM
how do u install?
Martin
06-17-2005, 11:51 PM
how do u install?
Just like he said in the initial post
Step 1: Upload the plugin
Step 2: Create a template called forumhome_advert
Step 3: Put your google ads/custom whatever into your forumhome_advert template
Step 4: Alter the plugin code to reflect your premium members/staff usergroups so that they do not see the ads (if you don't want them to)
Chris M
06-18-2005, 11:30 AM
It is possible, yes :)
I'll update it with a global setting sometime over the weekend ;)
Satan
Martin
06-18-2005, 08:35 PM
I had to do a clean install of Beta 2, so once you add the global, I will definitely be testing this again :)
Chris M
06-21-2005, 01:46 PM
Update
Version 1.0.1: Simple update to make this work globally - This will show up in every page :) - To upgrade, remove the forumhome_advert template, delete the existing plugin and follow the installation instructions in the first post :)
Satan
Martin
06-21-2005, 09:22 PM
If there weren't laws against me procreating I would name my firstborn child after you.
beautiful!
Chris M
06-22-2005, 10:50 AM
ROFL
Thanks Martin :p
Satan
Michael2
06-30-2005, 03:23 PM
Anyone get this to work on beta 3? I've tried 2 plugins now and neither seem to work.
Chris M
06-30-2005, 05:41 PM
Works for me on Beta 3 :ermm:
Satan
Chris M
06-30-2005, 08:07 PM
Update
Beta 3: Update to confirm that this plugin works with vBulletin 3.5.0 Beta 3;)
Satan
Chris M
07-13-2005, 02:37 AM
Update
Beta 4: Update to confirm that this plugin works with vBulletin 3.5.0 Beta 4;)
Satan
How and where do you create the new template? And where do you add the variale to place the advert?
Chris M
07-13-2005, 09:16 AM
You create the new template in the Style Manager in your AdminCP, and add your "ad" content to it :)
You place the $advert variable in a position within your navbar, header or footer templates to make it show up on every page :)
Satan
Sorry I am a noob but I dont have a clue where to add the $advert variable within those templates. Can it go anywhere within the templete code?
Michael2
07-13-2005, 02:46 PM
I'm curious too, what happens if you have one set of ads that runs at the top and one at the bottom, what is the easiest way to install this multiple times?
Chris M
07-13-2005, 09:10 PM
Just add the $advert variable multiple times ;)
Or duplicate the plugin code, changing the template name and variable ;)
@Gio - You can add it anywhere within those 3 templates ;)
Satan
Installed it works great also. Can I do the same thing by adding the phpadsnew code to the plugin code area?
Chris M
07-13-2005, 11:56 PM
Installed it works great also. Can I do the same thing by adding the phpadsnew code to the plugin code area?
Without ever having used PhpAdsNew, I cannot comment as to whether it would or would not work :ermm:
My intial response is that it is unlikely :speechless:
Satan
TrentTech
07-15-2005, 01:09 PM
Nice job on the hack satan, now my VIP members won't have to see ads!
Chris M
07-15-2005, 01:18 PM
Thank you :)
I'm sure they'll be glad of that;)
Satan
Holidazed
07-15-2005, 09:00 PM
OK, I understand I just need to ad the advert cde to the template I want the advert in. Is there a way to make it show a different advert each time the advert code is dsplayed?
Chris M
07-15-2005, 09:18 PM
OK, I understand I just need to ad the advert cde to the template I want the advert in. Is there a way to make it show a different advert each time the advert code is dsplayed?
I'll release a rotational version at some point soon :)
Other than that, the only way is to have a rotational banner code:p
Satan
shiva
07-16-2005, 07:21 AM
very nice, had a problem with the usergroups, but after rereading managed to get it to work perfectly.
Been something I have been looking for for quite a while, so thanks again.
Chris M
07-16-2005, 01:28 PM
You're welcome shiva :)
Satan
Chris M
07-26-2005, 11:24 PM
Update
RC1: Update to confirm that this plugin works with vBulletin 3.5.0 RC 1:)
Satan
Chris_D
07-30-2005, 12:10 PM
This is great :)
Mr_Bob
10-05-2005, 11:57 PM
Will this be updated for 3.5 gold or is it good as is? I'm interested in using this ;).
Chris M
10-06-2005, 09:50 AM
Currently this should work as is - There may be tweaks that can be made for 3.5 Gold but I honestly can't forsee any at the moment - It is best to assume that it is compatible and then if any issues arise they can be fixed :)
Chris
Julie
10-11-2005, 01:28 PM
Uhh, is it possible to have this work with secondary usergroups? Because I've set up my forum so that a paying user gets a secondary usergroup (without changing their primary usergroup)... Is there a way to have so that you can add secondary usergroup ids as well? :) Thanks.
n1ckn4me
10-11-2005, 02:59 PM
Hi nice hack! it's got some potention in my opinion.
I have for example some plain text I only want to show at some places of my vbsite. so I place the $advert outthere and I copy the code within the plugin from "global_start" and than add the idusergroup numbers exept for id1 (guests). This way you probably tell that every idgroup does not see it.
Is there a way to invert that? so you just place the useridgroup-numbers who WILL see it? (it's just that it tires my mind to think the other way around i guess :p)
further more...nice plugin
Mr_Bob
10-13-2005, 11:17 PM
Uhh, is it possible to have this work with secondary usergroups? Because I've set up my forum so that a paying user gets a secondary usergroup (without changing their primary usergroup)... Is there a way to have so that you can add secondary usergroup ids as well? :) Thanks.
Yes I agree. I want to use it but it doesn't seem to work that way yet. I have my forums set up so by doing certain things you are sent to another primary group. I would much rather just make a subscription that says you are a secondary user of this group which prevents you from seeing ads rather then figure out a whole new promotion scheme.
Is there a way to include secondary groups you select as well as primary?
Chris M
11-22-2005, 10:50 PM
Edit the plugin, and change:
if (!in_array($vbulletin->userinfo['usergroupid'], array(5, 6, 7))) {
to
if (!(is_member_of($vbulletin->userinfo, array(5, 6, 7)))) {
That should work :)
Chris
Mr_Bob
11-25-2005, 05:41 PM
Yup that worked flawlessly :). Maybe that could be the default in the product or even just another attachment something like "Use only primary groups" and another "Check both primary and secondary". I attached the edited version of your product if you want to throw it up alongside the first for those that want it to apply for both primary and secondary groups. I didn't rename it or anything of the sort I just went through with PSPad and changed the line :D.
Q-v-n-s-Q
12-06-2005, 03:20 AM
if u want ads display on the 1st post use this code
<if condition="!$GLOBALS['FIRSTPOSTID']">
$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">
$advert
</if>
</td>
</tr>
</table>
</div>
$spacer_close
</if>
credit go to artonex for the code
https://vborg.vbsupport.ru/showthread.php?t=96249&highlight=Adsense+post
Julie
12-23-2005, 10:35 PM
Edit the plugin, and change:
if (!in_array($vbulletin->userinfo['usergroupid'], array(5, 6, 7))) {
to
if (!(is_member_of($vbulletin->userinfo, array(5, 6, 7)))) {
That should work :)
Chris
Perhaps it's changed in vB 3.5.2, because it's not working for me :S
I've altered the plugin code;
if (!(is_member_of($vbulletin->userinfo, array(5, 6, 7, 16, 21, 26)))) {
Which are my not-to-see-ads-groups ... But they're still seeing ads. Like f.ex, 21 and 26 are my paid subscription groups. I've added a clone of myself, Julie2 in the subscription group, and marked the secondary group "Gold Membership", but I'm still viewing ads (when logged in as that user)...
readjono
09-04-2007, 03:45 PM
I've got this coding for the first post, I want to make it so it happens just before the second to last post too. What would I change it too.
<if condition="(!$GLOBALS['FIRSTPOSTID'] and !$GLOBALS['vbulletin']->GPC['ajax']) and !is_member_of($bbuserinfo,42)">
vBulletin® v3.8.12 by vBS, Copyright ©2000-2024, vBulletin Solutions Inc.