User ID in HTML tags
2 posters
Page 1 of 1
User ID in HTML tags
Hi!
I'd like to know if you can help me with this question: just as we've got variables in PHP (smart language) such as USERNAME, USERAGE and USERBIRTHDAY, I wonder if there's also any variable for the User ID (U1, U2, U3, etc.).
If there isn't, I wonder if there's a possibility to create a link in a widget so that the forum member can visit, for example, their very own Visitor messages wall.
Thank you for your help!
I'd like to know if you can help me with this question: just as we've got variables in PHP (smart language) such as USERNAME, USERAGE and USERBIRTHDAY, I wonder if there's also any variable for the User ID (U1, U2, U3, etc.).
If there isn't, I wonder if there's a possibility to create a link in a widget so that the forum member can visit, for example, their very own Visitor messages wall.
Thank you for your help!
Last edited by AnaMi on Mon Jan 02 2012, 16:53; edited 2 times in total
Re: User ID in HTML tags
Aww! I see. So it's impossible to create a link for the user's visitor messages, isn't it?
Thank you anyway, Gassy!
Have a fantastic day!
Thank you anyway, Gassy!
Have a fantastic day!
Re: User ID in HTML tags
This will show you how to get the user id:
http://www.diondesigns.org/t440-example-9-accessing-user-information-all-boards
http://www.diondesigns.org/t440-example-9-accessing-user-information-all-boards
LGforum- Hyperactive
- Posts : 2265
Reputation : 264
Language : English
Location : UK
Re: User ID in HTML tags
Thank you, LGForum! ( Sorry, I don't know your actual name ) You're very kind!
I added this script last week, as there was an alternative shared by Dion for creating this little notification letting the user know when another forum member had written on their visitor message wall. The code you've posted generates an upper link for the user to go to his profile, doesn't it? And it stores the user tag for any other script use. (For example, the welcome message with the ID number on the homepage)
Yet, I don't know how to incorporate that tag/script function into a link. I also tried the Visitor Messages Notification suggested by Dion, but it didn't work for me.
Yeah, I'm an unlucky one.
Is there a possibility to use the tag generated by the User ID Info in a link?
I added this script last week, as there was an alternative shared by Dion for creating this little notification letting the user know when another forum member had written on their visitor message wall. The code you've posted generates an upper link for the user to go to his profile, doesn't it? And it stores the user tag for any other script use. (For example, the welcome message with the ID number on the homepage)
Yet, I don't know how to incorporate that tag/script function into a link. I also tried the Visitor Messages Notification suggested by Dion, but it didn't work for me.
Yeah, I'm an unlucky one.
Is there a possibility to use the tag generated by the User ID Info in a link?
Re: User ID in HTML tags
Once you have added a JS file with the script provided in the link I posted in my last post. And then put the correct stuff in site description as shown in the tutorial then the USER ID will be available for other Javascript. That is all the tutorial does.
The VM notification tutorial, uses that USER ID, so this USER ID tutorial must be installed.
The VM notification won't work without the first tutorial.
Anyway. What I would recommend would be putting this in a Javascript File:
Which will put the user ID number inside any element with the className of 'uid' and the users Profile link inside any element with the className of 'proLink'. It is enclosed within a jQuery function so it runs only when the DOM is fully loaded.
So now, if you want to put the USER ID on the page anywhere you can put:
and if you want to put the user profile link anywhere you can put this:
I hope that makes a little more sense to ya
PS, check again who wrote the VM notifications script...
The VM notification tutorial, uses that USER ID, so this USER ID tutorial must be installed.
The VM notification won't work without the first tutorial.
Anyway. What I would recommend would be putting this in a Javascript File:
- Code:
$(function() {
$('.uid').html(uid);
$('.proLink').html('<a href="/u'+uid+'">Profile</a>');
});
Which will put the user ID number inside any element with the className of 'uid' and the users Profile link inside any element with the className of 'proLink'. It is enclosed within a jQuery function so it runs only when the DOM is fully loaded.
So now, if you want to put the USER ID on the page anywhere you can put:
- Code:
<span class="uid"></span>
and if you want to put the user profile link anywhere you can put this:
- Code:
<span class="proLink"></span>
I hope that makes a little more sense to ya
PS, check again who wrote the VM notifications script...
LGforum- Hyperactive
- Posts : 2265
Reputation : 264
Language : English
Location : UK
Re: User ID in HTML tags
It was you!!!LGforum wrote:PS, check again who wrote the VM notifications script...
Sorry for the mistake.
I haven't deleted either the script for all pages nor the script in the forum description. Anyway, I set up the script for the VM Notification right after the other scripts, but I'm now sure what went wrong if all the needed scripts were there.
Your explanation's clear enough to me! Thank you very much!
I guess it's good enough to inform users about their ID for any other purpose and future scripts to insert.
If I wanted to insert a link in a user control panel like the one presented in this tutorial, is it possible somehow to use that USER ID info for a direct link to the VM wall?
Thank you, LGForum!!
Page 1 of 1
Permissions in this forum:
You cannot reply to topics in this forum