1
rlankford
Shortest Path to Current Xoops User
  • 2007/8/30 13:48

  • rlankford

  • Not too shy to talk

  • Posts: 158

  • Since: 2004/8/27


This'll probably be a strange question, but here goes...

I would like to know the absolute shortest path to knowing the uid of the the currently signed on XOOPS User. I am not looking for something like this:

require_once("mainfile.php");
echo 
$_SESSION['xoopsUserId']);


Yes, that's very short (in that it is only 2 lines of code), but is it really? Loading in mainfile.php causes lots of XOOPS plumbing to load in the background. That is not desirable (in my case), so I, instead, would like to do the following:

1) Attach to the database.
2) Read in the session information.
3) Determine who the currently logged in user is based on that session information.

I've been trying to piece this together for the past few minutes myself but keep including more and more 'stuff' in that ends up not being any different than just including mainfile.php in the first place (which, again, isn't desirable for me).

Even if I had to hard code some value in (db type, root name, root password, etc.), I wouldn't mind...just as long as I could get the session's uid without having to have the entire XOOPS API loaded to do so.

Hopefully, at least one of you out there will find this interesting enough to help me out!

Thanks!

2
rlankford
Re: Shortest Path to Current Xoops User
  • 2007/8/30 14:33

  • rlankford

  • Not too shy to talk

  • Posts: 158

  • Since: 2004/8/27


I'm probably going about this all wrong (I'm *sick* of staring at this!). Here's my 'real' problem.

I'm trying to integrate ImageManager and FileManger into TinyMCe. Then, I'd like to set it up so that when you upload files, you are doing so into user specific directories. Sounds simple, right? I've actually got everything running just fine on my local computer. When I try to get this running in my server environment, I get problems. It's the strangest thing, and I am literally at my wits end at this point.

So here's the deal: My local machine is the has a slightly different version of PHP running (PHP version 5.2.1 vs. 5.2.3 on the servers. On the servers, when I try to run ImageManager or FileManager, I get the error that you can read about in this forum thread.

I'm stuck because if I include mainfile.php, I'm stuck with errors on 5.2.3. If I don't include it, I can't set up the user specific directories.

Maybe I should try to downgrade the server's php version to see if that makes any difference. Any and all ideas or suggestions is greatly appreciated.

3
rlankford
Re: Shortest Path to Current Xoops User
  • 2007/8/30 17:38

  • rlankford

  • Not too shy to talk

  • Posts: 158

  • Since: 2004/8/27


I figured out the answer to my problem. It seems that when the inline debug mode is activated in Xoops, it appends some HTML to the bottom of whatever PHP response streams go out from the server.

In the case of Tiny's Image and File Managers, this interfered with the 'language' scripts. Language.php was being called, but through the use of PHP's header statement, the stream being returned was actually a javascript document. With inline debug mode activated, some HTML was dropped in at the end of the javascript with no way to provide any context to it (in other words, the javascript parser doesn't know that the xoopslogger html is html and thinks of it as very poorly written javascript instead).

So the answer to all this was for me to turn off debug mode on my server!

---just living and learning :)

4
suico
Re: Shortest Path to Current Xoops User
  • 2007/8/30 17:46

  • suico

  • Friend of XOOPS

  • Posts: 374

  • Since: 2003/7/24


Thanks for sharing the final answer even though we couldn't help you.
Yogurt Social Network Service
Visit:http://www.marcellobrandao.eti.br/

Login

Who's Online

180 user(s) are online (142 user(s) are browsing Support Forums)


Members: 0


Guests: 180


more...

Donat-O-Meter

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

Latest GitHub Commits