PHP Web Host - Quality Web Hosting For All PHP Applications Clan Themes! We make clans look good!!
  Login or Register
 • Home • Downloads • Your Account • Forums • 

View next topic
View previous topic


Google
 
Web RavenPHPScripts (This Site)
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.
Author Message
TheShniz
Regular
Regular


Joined: Jan 27, 2004
Posts: 65

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

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 Back to top

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
Regular
Regular


Joined: Jan 27, 2004
Posts: 65

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

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
View user's profile Send private message
mikem
New Member
New Member


Joined: Sep 23, 2003
Posts: 15

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

Yes, that is some required code

Code:
global $user, $db, $cookie, $prefix
getusrinfo( $user );
cookiedecode( $user );
View user's profile Send private message
TheShniz
Regular
Regular


Joined: Jan 27, 2004
Posts: 65

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

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
View user's profile Send private message
TheShniz
Regular
Regular


Joined: Jan 27, 2004
Posts: 65

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

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
View user's profile Send private message
TheShniz
Regular
Regular


Joined: Jan 27, 2004
Posts: 65

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

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
View user's profile Send private message
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.

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
Forums ©
 

All logos and trademarks in this site are property of their respective owner.
The comments are property of their posters, all the rest © 2002-2011 by Raven

You can syndicate our news using the file xml

CSE HTML Validator Helped Clean up This Page! [Valid RSS] valid RSS 2.0 Valid robots.txt Stop Spam Harvesters, Join Project Honey Pot

Website engines core code is © copyright by PHP-Nuke but has been heavily patched and modified by myself and others.
PHP-Nuke is a free software released under the GNU/GPL.


:: fisubice phpbb2 style by Daz :: PHP-Nuke theme by www.nukemods.com ::
:: fisubice Theme Modified by the RavenNuke™ Team ::

:: W3C CSS Compliance Validation :: W3C HTML 4.01 Transitional Compliance Validation ::

zerosum