[Map Module] Custom Infowindow

yschwartz

Joined: 2006-03-15
Posts: 5
Posted: Wed, 2006-03-15 02:21

Thanks to all the developers for their time and effort in the development of Gallery1 Gallery2 and the Google Maps Module.

My issue is as follows:

Long story short I blew up my Gallery that I had running for years and had to rebuild from scratch march 1st 06.

When I got everything up and running and new albums created I got the Maps module working, the problem is when you click an Icon on the map and it brings up the "infowindow" it shows the date as the albums created date as per the code in my .inc file (Last line see +created+):

<?php"
$map['WindowType']="single";
$map['extramap'] = "";
$map['infowindow']="''
+'<div style=\"width:200px\"><a
href=\"'+itemLink+'\">'+title+'</a><br/>'
+'<a href=\"'+itemLink+'\"><img src=\"'+thumbLink+'\"
width=\"'+thw+'\" height=\"'+thh+'\" alt=\"'+title+'\" style=\"max-width:200px;max-height:200px;\"/></a>'
+'<br/><font color=black><b>Date:</b> '+created+'</font>'";

I tried editing the Album display date under each album but the infowindow still only displays the albums created date not the display date or the date from the picture, EXIF or assigned by editing each item.

I edited my .inc file from +created+ to +date+ but I guess that isnt the right tag to display the Items capture date and all my Icons went away. I changed this from +created+ to +title+ and now it shows the Item Title so I know I edited the .inc file properly but cant figure out what tag to use for it to display the Items capture date or the Albums display date.

Please advise what tag I need to use in order to display the Albums Display date or the items capture date, or if there is an easy way to edit the Albums create date either way I have pictures from before 2000 that show the date as 03.08.06 since that is when I recreated the album.

Once again thanks to everyone involved in the development and support for this amazing project.

Yonatan Z. Schwartz

System Info

Gallery version = 2.1-rc-1a core 1.0.28
PHP version = 5.0.4 apache2handler
Webserver = Apache/2.0.54 (Unix) DAV/2 PHP/5.0.4
Database = mysql 4.0.21
Toolkits = Exif, Ffmpeg, NetPBM
Operating system = SunOS ultra60 5.9 Generic sun4u
Browser = Mozilla/5.0 (Macintosh; U; PPC Mac OS X Mach-O; en-US; rv:1.8.0.1) Gecko/20060111 Firefox/1.5.0.1

 
galmoid

Joined: 2005-11-07
Posts: 364
Posted: Wed, 2006-03-15 03:16

My infowindows all display the exif date for items (photos). Maybe
your items have not exif data? I would expect the date would then
reflect the file creation date.
The "tags" you are attempting to use are actually javascript variables
and since 'date' is not declared.
Maybe "Edit Album"/" Album Date and Time" in Gallery admin might help.

 
yschwartz

Joined: 2006-03-15
Posts: 5
Posted: Wed, 2006-03-15 04:12

90% of my photos have EXIF data and I have verified by running the maintenance to refresh capture dates that it does extract the EXIF data from each image that does have info, for those that dont have EXIF data I have set each individual items under Edit Photo/ Photo Date and Time, when viewing individual items looking at the EXIF data at the bottom of each image it reflects the accurate capture date. I have tried setting the capture Date/Time on both the individual items (Photos) as well as the Album Date and Time under Edit Album/ Album Date and Time and still the infowindow only displays the album creation date.

 
Termitenshort
Termitenshort's picture

Joined: 2005-10-09
Posts: 1894
Posted: Wed, 2006-03-15 07:56

The timestamp is "gathered" in the ShowMap.inc file for each item, there is a function called $entity->getOriginationTimestamp (or something similar)

This is a function built-in to the gallery and I'm not sure if changing it would correct the problem. There might be another function in the API that permit to get other dates for the items.

I will look into it but that should give you a good starting point to look throught. The infowindow template does nothing else but displaying the date gathered during the code interpretation :-)

See you!
-------------------------
The Termite :-)

 
yschwartz

Joined: 2006-03-15
Posts: 5
Posted: Wed, 2006-03-15 15:57

Many thanks Termiteshort,

The Original ShowMap.inc had

$pointHash[$theid]['created']=strftime($dateFormat, $entity->getCreationTimestamp());

I changed it to

$pointHash[$theid]['created']=strftime($dateFormat, $entity->getoriginationTimestamp());

and now it pulls the Origination Time stamp for each album as opposed to the Creation Time Stamp which is what I wanted...

 
galmoid

Joined: 2005-11-07
Posts: 364
Posted: Wed, 2006-03-15 15:59

I added coordinates to an album and checked the date. I then
changed the date via Edit Album. The new date is what now appeared
in the infowindow. Are your dates changing/displaying as you expect
outside of The Map Module?

 
yschwartz

Joined: 2006-03-15
Posts: 5
Posted: Wed, 2006-03-15 16:18

Yes when I go to "Edit Album" and update the "Album Date & Time" than go back to the main Album page below the Album it reflects the new Date/Time I just manually entered, However when I go to the Google Map view and click an icon and bring up the infowindow it would not reflect this new Date/Time, I tried refreshing my browser just in case it was cached as well as using a machine that had never been to this website to insure it would not be cached and still it would not display this new date.

I than updated my ShowMap.inc from:

$pointHash[$theid]['created']=strftime($dateFormat, $entity->getCreationTimestamp());

to:

$pointHash[$theid]['created']=strftime($dateFormat, $entity->getoriginationTimestamp());

and now when I update the Album Date/Time under Edit Album it reflects on the infowindow.

I am not sure what is causing this behavior on my install as opposed to yours, or anyone elses, but it is working for me now.

 
galmoid

Joined: 2005-11-07
Posts: 364
Posted: Wed, 2006-03-15 16:33

I just noticed (sorry for not paying attention) that you are running
Gallery 2.1 (I am still running 2.0.x). I must assume something has
changed between the two. Maybe others running 2.1 would take a moment
to check if their installation(s) exhibit the same behavior that you
have experienced. Please. It may be that nobody else has noticed it; but,
it exists for everybody on 2.1

 
Termitenshort
Termitenshort's picture

Joined: 2005-10-09
Posts: 1894
Posted: Wed, 2006-03-15 16:48
galmoid wrote:
I just noticed (sorry for not paying attention) that you are running
Gallery 2.1 (I am still running 2.0.x). I must assume something has
changed between the two.

Yes all function names for the ItemId have changed ... It took me while to tranpose one into the other ands I guess I didn't do this one right :-(

See you !

 
yschwartz

Joined: 2006-03-15
Posts: 5
Posted: Wed, 2006-03-15 17:05

Sweet I'm not crazy (or at least not in regards to this problem)

Thanks again for all your help.