Ravens PHP Scripts: Forums
 

 

View next topic
View previous topic
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Ravens PHP Scripts And Web Hosting Forum Index -> phpnuke 7.3
Author Message
TheShniz
Regular
Regular



Joined: Jan 27, 2004
Posts: 65

PostPosted: Wed Jun 02, 2004 11:27 am Reply with quote

Perhaps this is the wrong forum, pleaz correct/move if so... but I'm trying 2 write a Module and I need 2 know the Username/UserID of the person viewing the Module. ie.) I'd like it taylored 2 that person, so I need 2 find out who it is. I've gone through a coup other Modules 2 C what others have done but didn't really come up w/ anything definitive. Can some1 offer some direction?

Thanx,
> TheShniz
 
View user's profile Send private message
mikem
New Member
New Member



Joined: Sep 23, 2003
Posts: 15

PostPosted: Wed Jun 02, 2004 1:07 pm Reply with quote

The Your_Account module checks the users table to verify if a user is Anonymous or registered and who they are logged as.

You are better off looking at a block's code that does this.
For instance, the code for the User_Info block is good to look at in order to find the code you need to query the users.

mikem
 
View user's profile Send private message
TheShniz







PostPosted: Wed Jun 02, 2004 1:43 pm Reply with quote

Yeah, I agree, that's what I've been doing... just not very familiar w/ all the variables & functions these filez R calling Shocked

Really just taking a shot in the dark. Is this all that's required (a guess)?

global $user, $cookie
cookiedecode($user);
$uname = $cookie[1];

My objective is 2 do this:
select * from whatever where username = $uname

Thanx,
> TheShniz
 
mikem







PostPosted: Wed Jun 02, 2004 2:15 pm Reply with quote

Yes, that is some required code

Code:
global $user, $db, $cookie, $prefix

getusrinfo( $user );
cookiedecode( $user );
 
TheShniz







PostPosted: Wed Jun 02, 2004 2:53 pm Reply with quote

Quick recap just 2 make sure, this is all I need 2 do:

global $user, $db, $cookie, $prefix
getusrinfo( $user );
cookiedecode( $user );

in order 2 access this:

select * from whatever where username = $user

Thanx!
> TheShniz
 
TheShniz







PostPosted: Thu Jun 03, 2004 10:14 am Reply with quote

Ok, tried it out... when I echo $user, I get:
MjpUaGVTaG5pejo2NjI2ZDFhY2ZlNjg1MTA5MWQzZTYxOTFiZjRkMGEzMjoxMDo6MDowOjA6MDo6NDA5Ng==

I'm gonna try using $uname this time w/ the $uname = $cookie[1];

Trial & Error Neutral Help!
> TheShniz
 
TheShniz







PostPosted: Thu Jun 03, 2004 10:31 am Reply with quote

Eureka, it worx! Ok, I'm happy now Laughing I just needed 2 use $uname instead of $user. Here's what I did:

global $user, $db, $cookie, $prefix
getusrinfo( $user );
cookiedecode( $user );
$uname = $cookie[1];

select * from whatever where username = $uname

I think I'm gonna have 2 sit down w/ the Cookie Decode function & C what other usable goodies R in there Cool

Thanx,
> TheShniz
 
Display posts from previous:       
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Ravens PHP Scripts And Web Hosting Forum Index -> phpnuke 7.3

View next topic
View previous topic
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum


Powered by phpBB © 2001-2007 phpBB Group
All times are GMT - 6 Hours
 
Forums ©