News: September 21st, 2019, The Tinyportal team is pleased to announce the release of ~~ TinyPortal 1.6.4! GET IT NOW!!!

Login  |  Register
HTML5 Icon HTML5 Icon
TP on Social Media
Welcome, Guest. Please login or register.
Did you miss your activation email?

September 22, 2019, 02:55:21 PM

Login with username, password and session length

Recent

Members
Stats
  • Total Posts: 188947
  • Total Topics: 20756
  • Online Today: 109
  • Online Ever: 629
  • (November 08, 2018, 01:36:54 PM)
Users Online
Users: 1
Guests: 82
Total: 83

Author Topic: A little coding help.  (Read 1889 times)

0 Members and 1 Guest are viewing this topic.

Offline Jpg

  • Hero Member
  • *****
  • Posts: 591
A little coding help.
« on: August 22, 2006, 04:46:23 PM »
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

  • Guest
Re: A little coding help.
« Reply #1 on: August 22, 2006, 05:56:53 PM »
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
Code: [Select]
global $scripturl, $ID_MEMBER;
echo '<a href="' . $scripturl . '?action=profile;u=' . $ID_MEMBER . '">Profile</a>';

Offline Jpg

  • Hero Member
  • *****
  • Posts: 591
Re: A little coding help.
« Reply #2 on: August 22, 2006, 06:36:54 PM »
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

  • Guest
Re: A little coding help.
« Reply #3 on: August 22, 2006, 06:38:53 PM »
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.

Offline Jpg

  • Hero Member
  • *****
  • Posts: 591
Re: A little coding help.
« Reply #4 on: August 22, 2006, 06:52:56 PM »
Cool. I can't wait.
Can't you post them now and then people can post more. Start making a list. ;)

JPDeni

  • Guest
Re: A little coding help.
« Reply #5 on: August 22, 2006, 07:54:28 PM »
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.