| Author |
Message |
kskdevil
Nuke Cadet


Joined: Aug 25, 2004
Posts: 6
|
Posted:
Mon Aug 30, 2004 6:56 am |
  |
I was wondering how i would add "nuke tags" to messages/news posts.
For instance if i wanted it to say Welcome <username> site description....
i know the tag is something like $theuser but it displays as $theuser and i want it to be 'translated'. so how would i do that? |
|
|
   |
 |
simrin
Support Mod


Joined: Jul 17, 2003
Posts: 520
Location: In front of a computer, who wants to know
|
Posted:
Mon Aug 30, 2004 7:14 am |
  |
There is no tag for username as far as I know. You have to decode the user cookie and pull the username out. I believe it is at index 1.
Hence:
| Code: |
global $user;
cookiedecode($user);
$username = $cookie[1];
|
My index may be wrong I know uid is 0 but I can't remember the others.
You then have to use that in the code that displays what you are looking for ie.
| Code: |
print "<title> Welcome " . $username . " to Nukecops, Enjoy your visit</title>";
|
|
_________________ NC Support Mod
Are you there? No I am a figment of your imagination.
www.hostileguild.net |
|
     |
 |
kskdevil
Nuke Cadet


Joined: Aug 25, 2004
Posts: 6
|
Posted:
Mon Aug 30, 2004 7:24 am |
  |
so where would i add the code?
| Code: |
global $user;
cookiedecode($user);
$username = $cookie[1]; |
or do i not need to add it |
|
|
   |
 |
simrin
Support Mod


Joined: Jul 17, 2003
Posts: 520
Location: In front of a computer, who wants to know
|
Posted:
Mon Aug 30, 2004 7:29 am |
  |
It depends what you are trying to do. A lot of files have done this already. What exactly are you trying to do? |
_________________ NC Support Mod
Are you there? No I am a figment of your imagination.
www.hostileguild.net |
|
     |
 |
kskdevil
Nuke Cadet


Joined: Aug 25, 2004
Posts: 6
|
Posted:
Mon Aug 30, 2004 7:32 am |
  |
You know this site has a message box at the top saying "useful tolls....." well i want to display the username in one of those boxes. |
|
|
   |
 |
simrin
Support Mod


Joined: Jul 17, 2003
Posts: 520
Location: In front of a computer, who wants to know
|
Posted:
Mon Aug 30, 2004 7:39 am |
  |
You just need to find the module that has that code in it and have it display the username then and if you don't have access to the username you need to use the above code to get it. You can also (if you already have the user_id) do a query out of the user table. |
_________________ NC Support Mod
Are you there? No I am a figment of your imagination.
www.hostileguild.net |
|
     |
 |
kskdevil
Nuke Cadet


Joined: Aug 25, 2004
Posts: 6
|
Posted:
Mon Aug 30, 2004 8:12 am |
  |
do u know what module displays the Messages? |
|
|
   |
 |
simrin
Support Mod


Joined: Jul 17, 2003
Posts: 520
Location: In front of a computer, who wants to know
|
Posted:
Mon Aug 30, 2004 8:47 am |
  |
Still not sure which feature you are talking about so not really  |
_________________ NC Support Mod
Are you there? No I am a figment of your imagination.
www.hostileguild.net |
|
     |
 |
kskdevil
Nuke Cadet


Joined: Aug 25, 2004
Posts: 6
|
Posted:
Mon Aug 30, 2004 9:18 am |
  |
Well eh the "Administration Menu > Messages" thing thats wot i'm talking about. |
|
|
   |
 |
kskdevil
Nuke Cadet


Joined: Aug 25, 2004
Posts: 6
|
Posted:
Mon Aug 30, 2004 10:38 am |
  |
Nevermind i found it  |
|
|
   |
 |
|
|