![]() |
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 |
PHP Code:
|
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 |
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) |
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:
|
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:
|
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:
|
PHP Code:
|
Thanks, all is working now!
|
All times are GMT. The time now is 01:48 AM. |
Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
![]() |
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|