Welcome to Geeklog, Anonymous Saturday, November 30 2024 @ 05:36 am EST

Geeklog Forums

number_format() expects parameter 1 to be double


Will

Anonymous
I've got a new problem with an old Geeklog site. I think it's running version 1.41.

Site is here:

http://longpointbayanglersassociation.ca/

This site has run without any problems for years. Today the site owner contacted me and said that everytime he tries to do anything, he gets this error:

2 - number_format() expects parameter 1 to be double, string given @ /home/longpoint/www/www/lib-common.php line 6061

I have confirmed that this is the case. When logging in, it gives the error but does seem to log you in. At least, my name appears in the "Who's Online?" section. The front page renders perfectly too. But if you click on anything on it, you get the above error.

The site owner swears he hasn't modified any code, just used the admin functions to post new content. This problem is over my head. Anyone have any ideas? I uploaded the site's files again in case something was corrupted, didn't seem to help.

I'll upgrade if it will solve the problem, but if it won't, I'd rather not. As I said, this site ran flawlessly for years until this morning.

Anyway, thanks for any help.
 Quote

Will

Anonymous
I just realized that the site works for users who aren't logged in. For anyone logged in, though, it works as described above. Unfortunately the forum requires logins.

Is there a way I could just reset the user data, but without being logged in? Must be something screwed up with the user profiles. If I could get it back to a default state so I could at least log in as admin it would probably suffice.
 Quote

Status: offline

Dirk

Site Admin
Admin
Registered: 01/12/02
Posts: 13073
Location:Stuttgart, Germany
Quote by: Anonymous

I just realized that the site works for users who aren't logged in.


Yep, I poked around a bit and couldn't see anything wrong.

Which Geeklog version is that? Actually, I found some hints that the site may actually be running on glFusion ...

bye, Dirk
 Quote

Will

Anonymous
It's Geeklog 1.4, according to the index.php file. The client needed a forum and there wasn't one integrated at the time. I thought I had just installed a plug-in but maybe I did use glfusion if it had the forum built in. I can't remember, I'm afraid.

I looked at the user table, wondering if some new user had managed to enter screwed up data. Last user to register (241 total) was on the 24th of August, and the site didn't start to fail until the 30th, so that theory is busted. I also tried temporarily removing the "if" statement that was triggering the error, but that's not good, you just get the same error a few lines down.

Anyway, any advice on what I should do? Ever seen that error message before?
 Quote

Status: offline

Dirk

Site Admin
Admin
Registered: 01/12/02
Posts: 13073
Location:Stuttgart, Germany
Quote by: Anonymous

Anyway, any advice on what I should do? Ever seen that error message before?


Doesn't ring a bell.

The oldest Geeklog version I have at hand is 1.5.1, and there's only one call to number_format() in lib-common.php - in the function COM_numberFormat(), which unfortunately is called from a lot of places all over Geeklog. So it's hard to say where the real cause of the problem is.

Do you know enough PHP to be able to print out the value of $number, i.e. the first parameter for number_format() it's complaining about?

bye, Dirk
 Quote

Will

Anonymous
The error message has this at the beginning:

array(5) {
["number"]=>
string(3) "n/a"

So I'm guessing "n/a" is your answer. The rest of the screen is just printing out my configuration options, none of which are unexpected.

Should I just upgrade to 1.81 and cross my fingers? I've already backed up the database. I was just slightly worried about applying an upgrade when the site is already malfunctioning, don't want to FUBAR it entirely. But I don't see what else to do.

Thank you very much for taking the time to help me, by the way.
 Quote

Status: offline

Dirk

Site Admin
Admin
Registered: 01/12/02
Posts: 13073
Location:Stuttgart, Germany
Quote by: Anonymous

The error message has this at the beginning:

array(5) {
["number"]=>
string(3) "n/a"

So I'm guessing "n/a" is your answer.


That's a hint. In the Admin's block, all the options have a number after them, e.g. Stories (935), i.e. there are 935 stories accessible for the current user. For some options, there's no useful number to display, so we put "N/A" there.

Now, Geeklog always uses the uppercase N/A, but I think I've seen plugins use a lowercase n/a. So maybe this is coming from some plugin? You could try searching through the plugin language files if you find one that uses n/a.

HTH

bye, Dirk
 Quote

Will

Anonymous
I think the problem is fixed. I reinstalled with the latest version of glFusion and the problem went away.

Thanks so much for telling me that was glFusion, by the way. I think this was the only site I'd ever used glFusion for and I had completely forgotten that. I would have been applying geeklog upgrades and no doubt messing up the site worse than before if you hadn't clued me in.
 Quote

All times are EST. The time is now 05:36 am.

  • 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