1
C6_chus
How do I get UID in a foreign block
  • 2006/11/8 14:15

  • C6_chus

  • Just popping in

  • Posts: 10

  • Since: 2006/9/12


Hy all,

first of all I want to thank you that you read my post and are willing to help me .

I´m trying to make an block for my clan site where I'm in the need of the uid of the current user.
My problem is that the block is an "system_block_dummy" that includes an php from an vwar app (nextactions.php).

I not sure how to get the uid of the current user, i tried to get the cookie but seams like cookie is somehow reseted cause I get now data from it.
Later i tried to get it with "$xoopsUser->getVar" but seems somehow that object $xoopsUser doesent exist. If included mainfile and common.php but didnt realy help.

Think Im doing something completly wrong.

2
m0nty
Re: How do I get UID in a foreign block
  • 2006/11/8 15:05

  • m0nty

  • XOOPS is my life!

  • Posts: 3337

  • Since: 2003/10/24


i'm not sure about in blocks.. but in files, if you want to use $xoopsUser then it has to be globally declared before you use it.

global $xoopsUser;

3
C6_chus
Re: How do I get UID in a foreign block
  • 2006/11/8 16:09

  • C6_chus

  • Just popping in

  • Posts: 10

  • Since: 2006/9/12


Well, yes I forgott to mention.

If I open the script from outside a block as normal site, it works fine as I can use all vars in $GPC and function $xoopsUser works.

It just doesent work in the block.

For example simple script.
print_r($_COOKIE);
?>

Opened from outside I works fine an prints hole array, starting with Array ( [forum_read] =>

Same script form whithin the block.
Array ( )

Login

Who's Online

265 user(s) are online (231 user(s) are browsing Support Forums)


Members: 0


Guests: 265


more...

Donat-O-Meter

Stats
Goal: $100.00
Due Date: Nov 30
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $100.00
Make donations with PayPal!

Latest GitHub Commits