vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   Member Archives (https://vborg.vbsupport.ru/forumdisplay.php?f=202)
-   -   Ad banners for unregistered users (https://vborg.vbsupport.ru/showthread.php?t=35357)

James Cridland 06-09-2002 02:21 PM

Quote:

Originally posted by SaintDog
Could this be modified to where only those that have made a donation can have the ads removed? I know you would have to manually add them to a usergroup if I wanted to do this, but that would be fine.
Yes, this is quite easy.

Change the line that says
if ($bbuserinfo['userid']<"1") {
to say
if ($bbuserinfo['usergroupid']!="13") {

...where '13' is the usergroup you've added called something like "Contributing Members".

This will then show ads for everyone EXCEPT contributing members.

Quote:

I added a usergroup call Contributing Members, but I am not sure of the # it is, such as an admin has a set usergroup number, as do mods, and super mods (I have not added any other usergroups).
The way I do it...

Click on "User Groups - Modify" in your control panel.
Hold your mouse over the edit link for the 'Contributing Members' group
...look at the end of that URL, where it'll say something like usergroupid=13.
That means 13 is the number.


BTW, this all works fine in v2.2.6.

Andy R 06-11-2002 01:50 AM

What about having unregistered members having the largest banner, regular members having a smaller text link & contributing members have no ads.

Thanks,

Andy

danrak 06-11-2002 12:05 PM

This may be simple but I'm still learning PHP. Anyway, is there a way to add multiable groups? For example, I would prerfer my mentors and moderators not to see the ads since they help out.

BTW, this is a great hack, thanks.

James Cridland 06-11-2002 05:56 PM

It's very easy to modify, this hack.

For a "ad banner for unreg / text ad for registered / no ad for donated" then...
PHP Code:

    if ($bbuserinfo['userid']<"1") {
    
$adcode="your ad banner for unregistered users";
    }
    elseif (
$bbuserinfo['usergroupid']=="13") {
    
$adcode="(no ad banner)";
    }
    else {
    
$adcode="your text ad";
    } 

You need to know the category number for your user group of people who have donated - I've used 13 here. Skim further up the thread to find out how this is done.

I'm running a much more complicated version of this hack, which rotates ad banners. One day I might document that, if anyone's interested.


Quote:

Originally posted by danrak
This may be simple but I'm still learning PHP. Anyway, is there a way to add multiable groups? For example, I would prerfer my mentors and moderators not to see the ads since they help out.
PHP is really easy(ish).

$bbuserinfo['userid'] is the user number, and will always be "0" (or not exist) if the user isn't registered.

$bbuserinfo['usergroupid'] is the group that the user is in.

if ($bbuserinfo['usergroupid']=="5") {echo "Hello world";} will do the thing in curly brackets - print "Hello world" in this example - if the usergroupid = 5.

if ($bbuserinfo['usergroupid']!="5") {echo "Hello world";} will do the thing in curly brackets if the usergroupid is NOT 5.

if ($bbuserinfo['usergroupid']>="5") {echo "Hello world";} will do the thing in curly brackets if the usergroupid is 5 OR LARGER.

and if ($bbuserinfo['usergroupid']=="5") {echo "Hello world";}else {echo "Goodbye world";} will only print "Hello world" if the usergroupid is 5 (as above), but will print "Goodbye world" if the usergroupid is anything else.

Does that help work out how you'd show one thing to one user group and another thing to another? Hope so.

Chris M 06-11-2002 07:04 PM

Just a quick Q...

Why is this in Template Moficiations???:confused:

Satan

James Cridland 06-11-2002 07:11 PM

Because it's a modification of the php_include template.

Andy R 06-11-2002 10:41 PM

Especially for adding the limited tutorial at the end! That really helps those of us who are learning and starting from ground zero.

MrBojangle1 06-15-2002 03:44 PM

I am quite confused on how to sign up for ads and picking that stuff. Any help would be appreciated if you can help me with the two ad places in first post contact me on AIM SSJ4Gohan354

funflyer 06-22-2002 02:31 AM

I need a way placing rotating banners on my forums. Is there any code or a site where I can how to put banners on my site? I want to have multi banners so each time the person refreshes the page the banner will change and is there any way of keeping track of all the stats so I could tell how many hits, and times it has been showed. Somebody told me about phpadds, Annybody use this?

Here the links, once you create and add banners how do you get them in your templates??

http://sourceforge.net/projects/phpadsnew/

thehobbyforum 06-22-2002 04:49 AM

You have to add the place the addclick code to the template where you want it to show - in the admin section of phpadsnew if will give you the banner invocation script - you then take that and place it in the template of you choice - mine is in the header template of my forums - that way it will show up automatically on all pages of the forum


All times are GMT. The time now is 07:59 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
  • Page Generation 0.01197 seconds
  • Memory Usage 1,745KB
  • 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_php_printable
  • (3)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (3)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)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