The forum of the forums
Would you like to react to this message? Create an account in a few clicks or log in to continue.

User ID in HTML tags

2 posters

Go down

In progress User ID in HTML tags

Post by AnaMi Mon Jan 02 2012, 16:31

Hi! Hello
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.

Wink Thank you for your help!


Last edited by AnaMi on Mon Jan 02 2012, 16:53; edited 2 times in total
AnaMi
AnaMi
Forumember

Female Posts : 46
Reputation : 2
Language : Spanish, English and Rubbish
Location : [404 - Not Found]

http://english4fun.freeforo.com

Back to top Go down

In progress Re: User ID in HTML tags

Post by Guest Mon Jan 02 2012, 16:39

I'm afraid it's not possible. Sad
avatar
Guest
Guest


Back to top Go down

In progress Re: User ID in HTML tags

Post by AnaMi Mon Jan 02 2012, 16:52

Aww! Sad I see. So it's impossible to create a link for the user's visitor messages, isn't it? Confused

Thank you anyway, Gassy! Hello
Have a fantastic day!
AnaMi
AnaMi
Forumember

Female Posts : 46
Reputation : 2
Language : Spanish, English and Rubbish
Location : [404 - Not Found]

http://english4fun.freeforo.com

Back to top Go down

In progress Re: User ID in HTML tags

Post by LGforum Mon Jan 02 2012, 17:14

LGforum
LGforum
Hyperactive

Male Posts : 2265
Reputation : 264
Language : English
Location : UK

Back to top Go down

In progress Re: User ID in HTML tags

Post by AnaMi Mon Jan 02 2012, 18:07

Thank you, LGForum! ( Embarassed Sorry, I don't know your actual name Razz ) You're very kind! flower

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. Razz
Yeah, I'm an unlucky one. lol!

Is there a possibility to use the tag generated by the User ID Info in a link?
AnaMi
AnaMi
Forumember

Female Posts : 46
Reputation : 2
Language : Spanish, English and Rubbish
Location : [404 - Not Found]

http://english4fun.freeforo.com

Back to top Go down

In progress Re: User ID in HTML tags

Post by LGforum Mon Jan 02 2012, 20:57

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:
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 Wink

PS, check again who wrote the VM notifications script...
LGforum
LGforum
Hyperactive

Male Posts : 2265
Reputation : 264
Language : English
Location : UK

Back to top Go down

In progress Re: User ID in HTML tags

Post by AnaMi Mon Jan 02 2012, 22:19

LGforum wrote:PS, check again who wrote the VM notifications script...
:wouhou: It was you!!! User ID in HTML tags 3016322546
Razz 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. Very Happy

Your explanation's clear enough to me! Wink 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?

Very good Thank you, LGForum!! bye
flower
AnaMi
AnaMi
Forumember

Female Posts : 46
Reputation : 2
Language : Spanish, English and Rubbish
Location : [404 - Not Found]

http://english4fun.freeforo.com

Back to top Go down

Back to top

- Similar topics

 
Permissions in this forum:
You cannot reply to topics in this forum