Invision Community 5: A video walkthrough creating a custom theme and homepage By Matt Thursday at 04:02 PM
Dazz Posted March 6, 2022 Posted March 6, 2022 I want to creat a custom welcome block or be able for the site to use a persons user name in various places around the site. Is there a way to pull the username into custom block? Something like %username% that would enter the usersname. I've tried various combinations of %user%, %user_name%, %member%, etc. Are there commads like this available to use?
Goza Posted March 6, 2022 Posted March 6, 2022 (edited) {{if \IPS\Member::loggedIn()->member_id}} {expression="\IPS\Member::loggedIn()->name"} {{else}} Guest {{endif}} So, this bit of code is basically saying. If a user is currently logged in, it will show their username but if they aren't logged in. It will get replaced with the word guest. Edited March 6, 2022 by Goza Ioannis D, prasetyosubandrio and Ramsesx 1 2
Jim M Posted March 6, 2022 Posted March 6, 2022 Thanks for posting! Unfortunately, this issue is beyond the scope of our technical support. 👩💻 Our technical support is happy to help you with the Invision Community platform, but we're unable to help with things like server management, theme questions and modifications. I've moved this to our Community Support area where other Invision Community owners will see it and help where they can.
Dazz Posted March 7, 2022 Author Posted March 7, 2022 15 hours ago, Jim M said: Thanks for posting! Unfortunately, this issue is beyond the scope of our technical support. 👩💻 Our technical support is happy to help you with the Invision Community platform, but we're unable to help with things like server management, theme questions and modifications. I've moved this to our Community Support area where other Invision Community owners will see it and help where they can. That's sortta dumb... That's something that vBulletin had 20+ years ago. They also had a list of special commands that could be used in posts that would pull different info. Seems like it should be something simple/standard by now. 19 hours ago, Goza said: {{if \IPS\Member::loggedIn()->member_id}} {expression="\IPS\Member::loggedIn()->name"} {{else}} Guest {{endif}} So, this bit of code is basically saying. If a user is currently logged in, it will show their username but if they aren't logged in. It will get replaced with the word guest. Thank you for this. Works exactly for what I needed. Thank you.
Recommended Posts