View Full Version : whats the code to not let guests view certain things
salata
11-13-2006, 04:21 PM
if i wanted to restrict access to guests what code do i use?
Kirk Y
11-13-2006, 04:56 PM
<if condition="$show['guest']">You're a guest!</if>
salata
11-19-2006, 04:48 AM
i meant if i didnt want them to see...i wrapped it around a link in the navbar and it shows for guests only, i didnt want it to show for guests
Kirk Y
11-19-2006, 04:55 AM
<if condition="!$show['guest']">You're not a guest!</if>
Paul M
11-19-2006, 09:28 AM
..... or more correctly ;)
<if condition="$show['member']">You're a member, not a guest</if>
salata
11-19-2006, 04:43 PM
thanks guys.
one another question, can i just show the link but do not give them access to it. and have the login page come up? what code must i use, i'm using hacks like vbradio with there is no permission settings. thanks in advanced
Josh1
11-19-2006, 10:56 PM
thanks guys.
one another question, can i just show the link but do not give them access to it. and have the login page come up? what code must i use, i'm using hacks like vbradio with there is no permission settings. thanks in advanced
You could try opening the page you don't want to see and adding that php wrap around it or denying them access if its a addon/modification under ACP I guess..
Ntfu2
11-20-2006, 05:04 PM
thanks guys.
one another question, can i just show the link but do not give them access to it. and have the login page come up? what code must i use, i'm using hacks like vbradio with there is no permission settings. thanks in advanced
At the top of the vbradio template add
<if condition="$show['member']">
At the very end of the template
<else />
You must register to use this functions, please <a href="register.php" target="_blank" rel="nofollow">Register</a> for free first!<br />
</if>
Kirk Y
11-20-2006, 06:31 PM
It'd be better if you just used a Permissions error via a file edit. Stick this near the top of the file, on it's own line.
if ($vbulletin->userinfo['userid'] == 0)
{
print_no_permission();
}
vBulletin® v3.8.12 by vBS, Copyright ©2000-2025, vBulletin Solutions Inc.