MyBB Community Forums

Full Version: Ads for certain usergroups
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hey, I was wondering what template I would have to edit if I wanted to put an advertisement at the top of a thread only for guests. Also I need to know what code that would be.

I was guessing it would be something like
(!$mybb->user['gid']) { ad code}
(2010-12-21, 08:31 PM)BuhRock Wrote: [ -> ]Hey, I was wondering what template I would have to edit if I wanted to put an advertisement at the top of a thread only for guests. Also I need to know what code that would be.

I was guessing it would be something like
(!$mybb->user['gid']) { ad code}

You can't use conditional in template without using Template Conditional plugin.

I think there are some ads thingy plugins. I'm not sure, I never used them.
What is the ID for guests?
Guest ID = 1
(2010-12-22, 03:11 PM)BuhRock Wrote: [ -> ]What is the ID for guests?

They don't have any "User" ID, however they have "Usergroup" ID but you can use the following code as a function;
if ($mybb->user['uid'] == "0" || $mybb->user['usergroup'] == "1")
{
// run your code here.
}

If you like you can request a plugin for such purposes, I'll code it.

Don't worry, I code free plugin Wink