The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
|||
|
|||
How to show a module only to visitors?
Hello,
I want to show a "Sign up" image in a module on right sidebar only to visitors and a "Welcome" message if it's a registered user. I know I have to ad a PHP module on right sidebar ad php code. I found this, as base of work, but I am still blocked PHP Code:
Regards Laminedj |
#2
|
||||
|
||||
PHP Code:
|
#3
|
|||
|
|||
Thanks Lynne, for your quick response.
If rgister user ID id "two" , I have to replace by '2' in your code? For "else" If I want to welcome a registred user with his name and pic, what syntax I have to use ? Regards |
#4
|
||||
|
||||
I don't understand the question about userid 2. My first line is regarding users with NO userid - they are unregistered.
As for the name, I believe that would be vB5_User::get('username') avatar is possibly: $api->callApi('user', 'fetchAvatar', array('userid' => vB5_User::get('userid'))) (Never tried it, just grabbed it out of the code) |
#5
|
|||
|
|||
Sorry for misunderstand about userid 2, now I get it.
I applied you code for pic and message and it works very well. For the code for registered users (show name and avatar) I put this, but I doesn' work: PHP Code:
|
#6
|
||||
|
||||
I just played with it and got the avatar to work. You will need to format it (image size, change message, etc.) yourself:
PHP Code:
|
Благодарность от: | ||
ozzy47 |
#7
|
|||
|
|||
Hello,
I got it, thanks :up: How can add also user name for register members ? --------------- Added [DATE]1383668387[/DATE] at [TIME]1383668387[/TIME] --------------- I tried to change the pic size to 50px by 50px , but id didn't work. any idea? PHP Code:
|
#8
|
||||
|
||||
PHP Code:
|
#9
|
|||
|
|||
Thanks, all is working now!
|
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|