Welcome to Geeklog Wednesday, December 13 2017 @ 09:40 pm EST


Status: offline

squatty

Forum User
Full Member
Registered: 21/01/2002
Posts: 269
Recently I posted a comment in regards to wrapping custom scripts inside of Geeklog. I soon discovered that the simplest way to wrap anything within Geeklog is to include calls to COM_siteHeader() and COM_siteFooter. This approach has proven to work time and time again. However, I recently came across one script that I can’t for the life of me figure out how to wrap? Upon hitting the page, the following error message occurs:

Call to a member function on a non-object in D:Apache GroupApachehtdocsgeeklogsystemlib-database.php on line 141

Standard PHP documentation hasn’t gotten me very far so I’ve decided to once again call upon the Geeklog community! Can someone out there point me in the right direction as to how I can fix the problem? So far I’ve tried simple things like commenting out line 141 on lib-database.php (which I’m sure is a bad idea). The result was the same error displaying further down on line 311 of lib-database.php. Many Thanks, Danny


In a world without walls and fences, who needs Windows and Gates?

Status: offline

squatty

Forum User
Full Member
Registered: 21/01/2002
Posts: 269
Maybe I should have posted this in the Help section? Anyway, here's an update. I still need help! I admit I'm no PHP guru but, I'm smart enough to try and debug. I downloaded and installed DBG PHP Debugger and Maguma PHP4EE Studio Light in order to look under the covers and all I got was the same "Call to a member function on a non-object" error message. In general what does this error mean? Any assistance would be much appreciated.
In a world without walls and fences, who needs Windows and Gates?

Status: offline

squatty

Forum User
Full Member
Registered: 21/01/2002
Posts: 269
In thinking the problem was Win32 related I decided to scrip my XP install of Geeklog in place of Linux. I'm still getting the same error:

Warning: Cannot add header information - headers already sent by (output started at /usr/products/apache/htdocs/music/index.php:278) in /usr/products/apache/htdocs/geeklog/system/lib-sessions.php on line 133

Warning: Cannot add header information - headers already sent by (output started at /usr/products/apache/htdocs/music/index.php:278) in /usr/products/apache/htdocs/geeklog/system/lib-sessions.php on line 145

Fatal error: Call to a member function on a non-object in /usr/products/apache/htdocs/geeklog/system/lib-database.php on line 141

Not sure where else to turn?


In a world without walls and fences, who needs Windows and Gates?

ConXioN

Anonymous
"In thinking the problem was Win32 related"
It 'w0rks' like that on my debian too 8)

"Warning: Cannot add header information - headers already sent by (output started at /usr/products/apache/htdocs/music/index.php:278) in /usr/products/apache/ htdocs/geeklog/system/lib-sessions.php on line 133

Warning: Cannot add header information - headers already sent by (output started at /usr/products/apache/htdocs/music/index.php:278) in /usr/products/apache/ htdocs/geeklog/system/lib-sessions.php on line 145"
Like you already know, the document has head and body. But in PHP you have to be careful with the way you do stuff. The second you start WRITING something visible on the document, the server assumes you're done with the header and sends the header on it's way. Now if you try to write for example cookies (that belong to headers), it generates that error. As the header is already on it's way, you cannot add anything to it anymore.. There are 2 ways to cope with that. If the cookies etc aren't really needed, then comment it out and find the solution later, or then walk backwards the documents until you find the spot you wrote something and then either try to move it further or then move the cookies upper in the process..

"Fatal error: Call to a member function on a non-object in /usr/products/apache/htdocs/geeklog/system/lib-database.php on line 141"
Najs. I have embedded phpBB2 in the Geeklog and I get this error every time I try to change the theme on phpBB or try to view groups in it.

Not sure where else to turn?

Yeah tell me about it 8) The internet seems to be full of ppl with this problem but can someone tell me what this mysterious error means!. Would be a lot easier to debug it if I had a clue about what I'm looking for..

ConXioN

Anonymous
Ok I got it now few minutes after posting here 8) I added following to the Function DB_query
$_DB = New database('dbhost','dbname','dbuser','dbpass','COM_errorLog');


I got rid of the error but got another one so I wiped the above away and added : include_once('/path/to/geeklog/public_html/lib-common.php');
to the files I got the "Call to a member function on a non object" error. Works fine now 8)

handelaar

Anonymous
For the record (and so the answer appears in the archive), the problem with Win32 was that your slashes were the wrong way around. You want d:/directory/path, not d:\directory\path as is normal for Win32. It's a PHP thing.

All times are EST. The time is now 09:40 pm.

  • Normal Topic
  • Sticky Topic
  • Locked Topic
  • New Post
  • Sticky Topic W/ New Post
  • Locked Topic W/ New Post
  •  View Anonymous Posts
  •  Able to post
  •  Filtered HTML Allowed
  •  Censored Content