The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
|||
|
|||
On the front page of a forum, how can I set something up so that it only shows if you are logged in? For example, a message shows up if you are unregistered or not logged in, and goes away when you are logged in.....what if I wanted something the other way around?
|
#2
|
|||
|
|||
Well, here's how I do that ... I'm pretty sure all PHP freaks will know of a better way, but anyway :
Code:
<? require("./global.php"); if ($bbuserinfo['userid']!=0) { *code here what you want to happen when use is logged in* } else { *code here what you want to do when user isn't known* } Code:
<? header ("Pragma: no-cache"); header ("Cache-Control: no-cache, must-revalidate, max_age=0"); header ("Expires: 0"); ?> Like I said at the beginning, there might be thousands ways to do that better ... but hey, it works Best regards, Bobbi |
#3
|
|||
|
|||
Well for unregistered users, there is a a variable called $unregwelcomemessage in the forumhome template. There is also a template called forumhome_unregmessage. What about setting something up in that matter, basically the same exact thing, just rather than unregmessage, a new one called like loggedin_message or something?
|
#4
|
||||
|
||||
In index.php replace this:
PHP Code:
PHP Code:
Also create a template named forumhome_regmessage and use it for messages for logged in users. |
#5
|
|||
|
|||
Thanks, that worked perfectly. You made a little mistake in your code for anybody that would like to use this. You did this:
PHP Code:
PHP Code:
Thanks again |
#6
|
||||
|
||||
Damn brackets...
|
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|