TP-Docs
HTML5 Icon HTML5 Icon HTML5 Icon
TP on Social Media

Recent

Welcome to TinyPortal. Please login or sign up.

Members
Stats
  • Total Posts: 195,996
  • Total Topics: 21,327
  • Online today: 697
  • Online ever: 8,223 (February 19, 2025, 04:35:35 AM)
Users Online
  • Users: 0
  • Guests: 233
  • Total: 233

A little coding help.

Started by Jpg, August 22, 2006, 11:46:23 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Jpg

Well I need help with coding and it seems people will get mad if I pm them...lol... well here's my question...[Hard to explain]

I need a function to change a link using the user's #.
"U=[Users Number]"

Such as...

http://tinyportal.co.uk/smf/index.php?action=profile;u=1 <-this number.

But I want it so the member that clicks the link to go to theirs.

It's pretty hard to explain. :\

Thank you in advance.

JPDeni

Where is this going to go? In a phpbox? And, basically, what you want is to make a link so that the user can access his or her own profile.

Anyway, what you want is the variable $ID_MEMBER, and you have to set it as global. To print a link to the user's profile, use

global $scripturl, $ID_MEMBER;
echo '<a href="' . $scripturl . '?action=profile;u=' . $ID_MEMBER . '">Profile</a>';

Jpg

Ok thank you. I wasn't gonna use it for the profile but you just showd me how to do what I'm gonna do.
BTW Is there any list of variables to help people in their coding?

JPDeni

I wish there was. When I run across something that I need, I start doing a search in the files. I'm starting to keep a list of them for myself. When I have enough collected to be of any use, I'll post it.

Jpg

Cool. I can't wait.
Can't you post them now and then people can post more. Start making a list. ;)

JPDeni

I'll make something that someone other than me can read. I use my own little shorthand that no one else would be able to understand.

This website is proudly hosted on Crocweb Cloud Website Hosting.