photo / openphoto-wordpress

A WordPress plugin for OpenPhoto
http://theopenphotoproject.org
22 stars 8 forks source link

First photo displays 2 thumbnails and automatically collapses the "info" section #5

Closed jmathai closed 12 years ago

jmathai commented 12 years ago

The first photo is displayed using two thumbnails. Clicking "show" displays and then immediately collapses the extra information.

This doesn't happen when a tag is specified. Unsure if it's an issue isolated on my host.

randyhoyt commented 12 years ago

I suspect the problem is a specific piece of data. When you specify a tag, the offending data might not appear in the list. Can you send me the web address of that OpenPhoto installation? Then I can try it in my environment and see if I can reproduce it pulling in the same data.

jmathai commented 12 years ago

Yes, looks like intval($photo->dateUploaded) isn't guaranteed unique. I have two that wind up with the same value. Can we use $photo->id even though it's alphanumeric or does it have to be numeric? If it needs to be numeric we can try to use a combination of values since we don't have a numeric id.

randyhoyt commented 12 years ago

Good catch. It seems it does need to be a number. Since the $photos variable we're looping through is an array of objects, I think we can use the index of the array as the number. @randyjensen, any reason you can think of that this won't work to get a $unique_id for each photo?

foreach( $photos as $unique_id => $photo ) {
randyjensen commented 12 years ago

I think using $unique_id can definitely work. I'll update this now.