php error in "On this day" widget on home

TalkBug Collectors

Join LibraryThing to post.

php error in "On this day" widget on home

This topic is currently marked as "dormant"—the last message is more than 90 days old. You can revive it by posting a reply.

1koffieyahoo
Jun 27, 2008, 12:18 am

When loading home I get the following error in the "on this day" widget:

Warning: Cannot modify header information - headers already sent by (output started at /var/www/html/home.php:67) in /var/www/html/inc_authorphp.php on line 403

2conceptDawg
Jun 27, 2008, 5:20 am

hm. That's a new one. I haven't touched that code in the last few days. Odd, that. But I'll have a look.

3conceptDawg
Jun 27, 2008, 5:23 am

Are you still seeing an error? I'm not seeing one, even when signed into your account. If you are still seeing the error then what settings are you using for the 'on this day' module?

4koffieyahoo
Edited: Jun 27, 2008, 8:56 pm

No, it disappeared after about an hour or two.

My settings now apparently are: 3 events, oldest first, but I recall that the last time I played with it I changed it to 10 events, oldest first... weird.

ETA: even when I set it to 10 events I only see three, but that may have to do with the number of events there are for today?

5conceptDawg
Jun 28, 2008, 1:26 am

Yeah, it is entirely possible that there were only 3 events for the day in question.

6boekerij
Edited: Jul 6, 2008, 6:09 pm

> 3

At present, the entire "On this day" section reads :

-----
Warning: array_filter(): The first argument should be an array in /var/www/html/ajax_home_onthisday.php on line 107
Warning: Invalid argument supplied for foreach() in /var/www/html/ajax_home_onthisday.php on line 143

Born
-----

This--i.e. : getting warnings only instead of anything else--is going on for a week at least now.

--
edited to correct text colour

7rsterling
Jul 6, 2008, 6:52 pm

This is also happening when I log on to the French site (but not the English one):

Warning: array_filter(): The first argument should be an array in /var/www/html/ajax_home_onthisday.php on line 107
Warning: Invalid argument supplied for foreach() in /var/www/html/ajax_home_onthisday.php on line 143
Born

Is the coding for the homepage different on the different language sites, or could it be something about different language versions of CK?

8rsterling
Edited: Jul 6, 2008, 7:02 pm

7 - same problem on the Spanish site. And the Italian one, the Danish one, and the Dutch one.
German is working fine, but there's only one date (which goes some way towards confirming my suspicion that it's something to do with connecting to different language versions of CK).
Finnish is fine too, but it pulls up different and fewer births and deaths than the English site.

9conceptDawg
Jul 6, 2008, 11:35 pm

This should be corrected. I also added some date localization to the module so it should show you the day based on where YOU are instead of LT local time (I hope).

10rsterling
Jul 6, 2008, 11:52 pm

Do you mean it's supposed to be fixed now? I'm still getting the same error message on the French, Spanish, Italian, and Dutch sites.
(the www.librarything.dk site isn't coming up at all, though)

When there's no information in the local CK (if indeed that's the source of the error), can you just display something like a "No data; help contribute data on CK" message?

On the new date localization thing: for most non-English languages, the day should come before the month, otherwise it looks like it means July 2007, instead of July 7th. Also, how do you calculate where someone is, by IP, by language? I hope it's by IP, because otherwise you've got a pretty wide time/date difference across French speakers in Quebec vs. France, or UK English-speakers vs. Australians vs. USians, and many more.

11conceptDawg
Jul 7, 2008, 12:05 am

No...I haven't pushed it to the live server yet. In the next few minutes, after I finish writing some more Talk updates.

12koffieyahoo
Edited: Jul 7, 2008, 12:13 am

how do you calculate where someone is, by IP, by language?

I assume, since it's all JavaScript basically, that it simply asks your computer for the current date?

13conceptDawg
Jul 7, 2008, 12:21 am

Yes. It's based on your computer date/time.

14timspalding
Jul 7, 2008, 12:31 am

Chris is joking. That said, between time and browser language, you could at least eliminate some possibilities.

15conceptDawg
Jul 7, 2008, 12:56 am

No joking. I'm getting your timezone information from your machine in order to display the correct offset. It's not perfect but it should be pretty good for 95%+ of the people out there.

Also, librarything.dk isn't one of our domains.
dk.librarything.com is the correct address. It seems to be working correctly.

16rsterling
Jul 7, 2008, 1:23 am

15 - dk: ah, that would be why...

17timspalding
Jul 7, 2008, 1:46 am

Wow. Not joking. I'm impressed. (Although I thought he was using timezone to guess at *location*, which is different.)

18rsterling
Edited: Jul 7, 2008, 11:33 am

This all seems to be working now, and all to have the same results (all based now on the English CK?).

Now that the error is fixed, is there any chance of changing the date format from MMMM DD to DD MMMM - at least on the non-English sites? Seriously, even as a native English speaker, when I looked at the French page, I thought, "huh, July 2007? Why would it say that?"