PDA

View Full Version : Custom pages


DAMINK
04-25-2012, 07:29 AM
I find i have to make a few custom pages on my site for whatever reason.
Now if i want to make a page viewable to members only i use below.

<?php
include("global.php");

if ($vbulletin->userinfo['userid']!=0) {
echo "Welcome Back, <b>";
echo $vbulletin->userinfo['username'];
echo "<br>";
?>

Blah blah blah

<?php
}
else {
echo "Go Away!";
}
?>

That seems to work ok.
How would i go about making this usergroup specific?

Ziki
04-25-2012, 11:51 AM
$vbulletin->userinfo['usergroup'] != '2'

DAMINK
04-25-2012, 09:11 PM
Thanks for the reply.
I tried this...


if ($vbulletin->userinfo['usergroup'] != '2') {
echo "Welcome Back, <b>";
echo $vbulletin->userinfo['username'];
echo "<br>";


That did not work.

borbole
04-25-2012, 09:23 PM
Try this:

if (is_member_of($vbulletin->userinfo, x, y))
{
//code goes here
}

And replaxe x and y with the id of the groups that you want to do your thing.

DAMINK
04-25-2012, 09:34 PM
Exactly what i was after cheers borbole :)

borbole
04-25-2012, 09:45 PM
Exactly what i was after cheers borbole :)

Glad to have been of help :)

Boofo
04-25-2012, 09:54 PM
borbole goes for the win! ;)