View Full Version : how to hide the username of a user
miticoste
07-15-2011, 06:39 PM
Hello, I need to hide some user groups that I created (unregistered user groups and user groups, level 1) the username of a message that appears next to your answer. How can I do?
Lynne
07-15-2011, 11:18 PM
You will need to write several plugins to do this since the username shows up in several places. Or, if you are unfamiliar with writing plugins, you can just edit the templates. Go to the page you want to remove the username on and use this trick to find the template:
To find the template to modify, do this - vboptions > General Settings > Add Template Name in HTML Comments > set to Yes . Then go back to your page and view the source code and you will see the name of the template called around your part of the code. (Sometimes the template is the one mentioned at the very top of the page source.)
Then, go edit that part of the template and put a condition around it to only show if the user is not in usergroup x, y, z (there is an article on writing conditions).
miticoste
07-19-2011, 03:18 PM
Ok thanks for the info. But what should I write in the template code? Do you have any example of code to suggest?
Lynne
07-19-2011, 04:19 PM
You would put a condition around the variable. Something like:
<vb:if condition="!is_member_of($post, x, y, z)">username</vb:if>
As I said, there is an article on writing conditions in vb4.
As always, test on your test site first.
miticoste
07-20-2011, 09:21 AM
Ok thanks a lot I will try.
vBulletin® v3.8.12 by vBS, Copyright ©2000-2025, vBulletin Solutions Inc.