You are missing our premiere tool bar navigation system! Register and use it for FREE!

NukeCops  
•  Home •  Downloads •  Gallery •  Your Account •  Forums • 
Readme First
- Readme First! -

Read and follow the rules, otherwise your posts will be closed
Modules
· Home
· FAQ
· Buy a Theme
· Advertising
· AvantGo
· Bookmarks
· Columbia
· Community
· Donations
· Downloads
· Feedback
· Forums
· PHP-Nuke HOWTO
· Private Messages
· Search
· Statistics
· Stories Archive
· Submit News
· Surveys
· Theme Gallery
· Top
· Topics
· Your Account
Who's Online
There are currently, 57 guest(s) and 0 member(s) that are online.

You are Anonymous user. You can register for free by clicking here
Nuke Cops :: View topic - $userdata['user_id'] is empty [ ]
 Forum FAQ  •  Search  •   •  Memberlist  •  Usergroups   •  Register  •  Profile •    •  Log in to check your private messages  •  Log in

 
Post new topic  Reply to topicprinter-friendly view
View previous topic Log in to check your private messages View next topic
Author Message
Xyberian
Colonel
Colonel


Joined: Mar 14, 2004
Posts: 1921

Location: Behind you

PostPosted: Sat Feb 19, 2005 11:41 pm Reply with quoteBack to top

First of all, I'd like to apologize my post because I don't know this forum is the appropriate place.

I ported WebLog MOD developed by phpbb2 stand-alone.
The funny thing (actually not funny, series) is that $userdata['user_id'] is empty in phpnuke 7.6 with ChatServ's security patch.
On the other hand, I ported it to phpnuke 76. with no security patches. It works perfectly.

My qeustion is,... how can I get the $userdata['user_id'] in Forums/index.php ? Please HELP ME~~~

_________________
NukeKorea Dev. Network.
NukeKorea Laboratories
Find all posts by XyberianView user's profileSend private messageVisit poster's website
Evaders99
Site Admin
Site Admin


Joined: Aug 17, 2003
Posts: 12383


PostPosted: Sun Feb 20, 2005 12:18 am Reply with quoteBack to top

Same as I PM'd you:

Basically you can populate that variable like this:

Code:

    $user = base64_decode($user);
    $cookie = explode(":", $user);
    $sql = "SELECT user_id FROM ".$user_prefix."_users WHERE username='$cookie[1]'";
    $result = $db->sql_query($sql);
    $row = $db->sql_fetchrow($result);
    $userdata['user_id'] = $row['user_id'];

_________________
Helping those that help themselves
Read FIRST or DIE!

"Fighting is terrible, but not as terrible as losing the will to fight."
Star Wars Rebellion Network - Need Help? Evaders Squadron Coding
Find all posts by Evaders99View user's profileSend private messageVisit poster's websiteAIM Address
Xyberian
Colonel
Colonel


Joined: Mar 14, 2004
Posts: 1921

Location: Behind you

PostPosted: Sun Feb 20, 2005 12:43 am Reply with quoteBack to top

Thank you evader.
Your suggestion and code are what I thought. I was looking for another way to get that while you were posting.

Yes, your code works.
I reached a conclusion that there is no way to get $userdata array except populating from DB user field, in my security patched cases.

Thank you so much for quick replying.
I will post the whole Blog MOD package which lets all nukecops vistiors use it.

_________________
NukeKorea Dev. Network.
NukeKorea Laboratories
Find all posts by XyberianView user's profileSend private messageVisit poster's website
edogs
Lieutenant
Lieutenant


Joined: Sep 10, 2003
Posts: 172

Location: Russia

PostPosted: Wed May 18, 2005 9:19 am Reply with quoteBack to top

Evaders99 wrote:
Same as I PM'd you:

Basically you can populate that variable like this:

Code:

    $user = base64_decode($user);
    $cookie = explode(":", $user);
    $sql = "SELECT user_id FROM ".$user_prefix."_users WHERE username='$cookie[1]'";
    $result = $db->sql_query($sql);
    $row = $db->sql_fetchrow($result);
    $userdata['user_id'] = $row['user_id'];

It's bad solution.
Partially it's a bit of unsecurity here, but anyway, no sense to duplicate functions of php-nuke API.
Partially it's wrong because you'll never know which format $user variable will happend up to the this moment.
use instead
global $user;
$userdata=getusrinfo($user);

_________________
You always welcome to use our paid services and get something professinally made for your php-nuke. Optimization, module/block creation etc...
Find all posts by edogsView user's profileSend private messageVisit poster's websiteICQ Number
Xyberian
Colonel
Colonel


Joined: Mar 14, 2004
Posts: 1921

Location: Behind you

PostPosted: Wed May 18, 2005 11:52 am Reply with quoteBack to top

using global variables are much more worse.
That issuse was already settle down 1.5 months ago.

_________________
NukeKorea Dev. Network.
NukeKorea Laboratories
Find all posts by XyberianView user's profileSend private messageVisit poster's website
edogs
Lieutenant
Lieutenant


Joined: Sep 10, 2003
Posts: 172

Location: Russia

PostPosted: Wed May 18, 2005 12:20 pm Reply with quoteBack to top

Xyberian wrote:
using global variables are much more worse.
That issuse was already settle down 1.5 months ago.

Can't understand why you post it Question

_________________
You always welcome to use our paid services and get something professinally made for your php-nuke. Optimization, module/block creation etc...
Find all posts by edogsView user's profileSend private messageVisit poster's websiteICQ Number
Display posts from previous:      
Post new topic  Reply to topicprinter-friendly view
View previous topic Log in to check your private messages View next 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



Powered by phpBB © 2001, 2005 phpBB Group

Ported by Nuke Cops © 2003 www.nukecops.com
:: FI Theme :: PHP-Nuke theme by coldblooded (www.nukemods.com) ::
Powered by · TOGETHER TEAM srl ITALY http://www.togetherteam.it · DONDELEO E-COMMERCE http://www.DonDeLeo.com
Web site engine's code is Copyright © 2002 by PHP-Nuke. All Rights Reserved. PHP-Nuke is Free Software released under the GNU/GPL license.
Page Generation: 0.208 Seconds - 161 pages served in past 5 minutes. Nuke Cops Founded by Paul Laudanski (Zhen-Xjell)
:: FI Theme :: PHP-Nuke theme by coldblooded (www.nukemods.com) ::