View Full Version : Member number in profile
I.G.O.T.A.
03-02-2012, 08:16 PM
Is there any way to add a the member number of the user to their profile. Say a member signs up and is 301 can you add that somewhere in his profile?
Lynne
03-03-2012, 05:15 PM
You would need to do it manually, like in a template edit. Depending on which template you add it to, it's probably either {vb:raw userinfo.userid} or {vb:raw prepared.userid}
I.G.O.T.A.
03-07-2012, 02:52 AM
I tried this and it don't work. Any ideas.
<vb:if condition="$post['membernumber']"><dt>{vb:rawphrase member_number}</dt> <dd>{vb:raw post.userid}</dd></vb:if>
cellarius
03-07-2012, 08:26 AM
In profile you need to use prepared.userid, not post.userid (which is for postbit).
I.G.O.T.A.
03-07-2012, 02:50 PM
So like this? I tried it and it don't work.
<vb:if condition="$post['membernumber']"><dt>{vb:rawphrase member_number}</dt> <dd>{vb:raw prepared.userid}</dd></vb:if>
Lynne
03-07-2012, 05:03 PM
As Cellarius said, $post is not a valid variable there. What is $post[membernumber] supposed to be? Don't you mean something more like $prepared['userid']?
I.G.O.T.A.
03-07-2012, 05:12 PM
I think I'm a tard, lol. So how would I write that to get it to worK?
Lynne
03-07-2012, 05:25 PM
Maybe something like:
<vb:if condition="$prepared['userid']"><dt>{vb:rawphrase member_number}</dt> <dd>{vb:raw prepared.userid}</dd></vb:if>
Have you even tried it without the condition to see if that part is correct?
I.G.O.T.A.
03-07-2012, 05:41 PM
I just tried it and it didn't work. Pulling my hair out, lol.
TheLastSuperman
03-07-2012, 05:58 PM
Try...
<vb:if condition="$prepared['userid']"><dt>{vb:rawphrase member_number}</dt> <dd>{vb:raw userinfo.userid}</dd></vb:if>
Of course you must manually add the phrase I see in the code i.e. member_number before the <dt> part of the code will display but we use userinfo.userid as it picks up the members profile number your viewing instead of bbuserinfo.userid as that would show you YOUR number when viewing their profile = no good.
Edit: Yeap and to confirm, it's what Lynne mentioned above in post #2 (https://vborg.vbsupport.ru/showpost.php?p=2305776&postcount=2).
I.G.O.T.A.
03-07-2012, 06:26 PM
So would the whole code look like this? Or am I missing something. I tried it and nothing. I'm still learning, lol. Thanks for all the help everyone.
{vb:raw prepared.userid}<vb:if condition="$prepared['userid']"><dt>{vb:rawphrase member_number}</dt> <dd>{vb:raw userinfo.userid}</dd></vb:if>
Lynne
03-08-2012, 03:36 AM
As I asked before..
Have you even tried it without the condition to see if that part is correct?
cellarius
03-08-2012, 06:15 AM
Also: Where exactly do you put that code?
I.G.O.T.A.
03-08-2012, 12:28 PM
As I asked before..
Have you even tried it without the condition to see if that part is correct?
Yes I did and doesn't work.
Also: Where exactly do you put that code?
Styles/templates/style manager/edit templates/postbit templates/postbit legacy
cellarius
03-08-2012, 02:13 PM
So you're in postbit after all? :confused:
In your first post, you wrote you would want to show it in the member's profile! As has been pointed out, the code needs to be different for profile (the memper's page you get taken to if you click on a username) and postbit (the information field on top or on the left of every post in threadview).
Try this:
<dt>{vb:rawphrase member_number}</dt> <dd>{vb:raw post.userid}</dd>
Make sure you have created a phrase "member_number" and have put it into an appropriate phrase group (global or, preferably if not used anywhere else, postbit). Note that you do not need the condition you have put around your code - the whole userinfo block in postbit is already wrapped in the exact same condition.
If you ask questions like that, please provide as much information on what you want to achieve where - makes it a lot easier to help :)
I.G.O.T.A.
03-08-2012, 06:28 PM
I want it underneath the avatar. Like where it says join date, real name and so on. Sorry again for the confusion.
cellarius
03-08-2012, 08:40 PM
Have you tried the code I provided?
I.G.O.T.A.
03-08-2012, 10:55 PM
Awesome! Thank you for your time. If you need anything just ask!
vBulletin® v3.8.12 by vBS, Copyright ©2000-2025, vBulletin Solutions Inc.