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.