vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3.5 Add-ons (https://vborg.vbsupport.ru/forumdisplay.php?f=113)
-   -   Usergroup Specific Adverts (https://vborg.vbsupport.ru/showthread.php?t=83081)

Chris M 06-13-2005 10:00 PM

Usergroup Specific Adverts
 
[high]Installation Instructions[/high]

Step 1: Upload the .xml file to the Product Manager
Step 2: Edit the [high]global_advert[/high] template to add your advert code, i.e. Google Adsense code
Step 3: Add the variable [high]$advert[/high] to any of the following templates: [high]header, navbar, footer[/high] - 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:
PHP Code:

if (!in_array($vbulletin->userinfo['usergroupid'], array(567))) { 

replacing, obviously, [high]5, 6, 7[/high] with whatever usergroups you need
Step 5: Click [high]INSTALL[/high]: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... ;)

[high]Updates[/high]
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

Quote:

Originally Posted by Martin
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

Quote:

Originally Posted by mholtum
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

Quote:

Originally Posted by gang_*
how do u install?

Just like he said in the initial post

Quote:

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

[high]Update[/high]
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

[high]Update[/high]
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

[high]Update[/high]
Beta 4: Update to confirm that this plugin works with vBulletin 3.5.0 Beta 4;)

Satan

Gio 07-13-2005 05:13 AM

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

Gio 07-13-2005 01:04 PM

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

Gio 07-13-2005 09:19 PM

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

Quote:

Originally Posted by Gio
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

Quote:

Originally Posted by bitg
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

[high]Update[/high]
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

Quote:

Originally Posted by Julieh
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:
PHP Code:

if (!in_array($vbulletin->userinfo['usergroupid'], array(567))) { 

to
PHP Code:

if (!(is_member_of($vbulletin->userinfo, array(567)))) { 

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

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/showthrea...t=Adsense+post

Julie 12-23-2005 10:35 PM

Quote:

Originally Posted by Chris M
Edit the plugin, and change:
PHP Code:

if (!in_array($vbulletin->userinfo['usergroupid'], array(567))) { 

to
PHP Code:

if (!(is_member_of($vbulletin->userinfo, array(567)))) { 

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;

PHP Code:

if (!(is_member_of($vbulletin->userinfo, array(567162126)))) { 

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)...


All times are GMT. The time now is 04:50 PM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01395 seconds
  • Memory Usage 1,827KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)bbcode_code_printable
  • (6)bbcode_php_printable
  • (8)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (40)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.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/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.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
  • printthread_start
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete