Location and Custom data

I noticed these two fields for albums: Location and Custom data.

What are they for?

Location, yes well, some dort of location I'm sure. So, what, GPS coords? In what format then? Or a description of sorts? And how will this data be used by, say, the google maps plugin?

Custom data, I suppose some sort of... data... that is... custom? Custom as in nonstandard, or custom as in additional? What does zenphoto expect me to put there? And in what format? How will it be used and by what?

I tried putting in some random gunk in those fields, and I didn't see anything after saving. No errors, but also not seeing the data anywhere. I'm using my own theme, and it in itself isn't picking up those fields afaik, but nothing else seems to either...

Long story short: what are they for?

Comments

  • acrylian Administrator
    They are legacy fields there from the beginning and there is no actual expected usage. You can use them for anything you like.

    Since on the front end no one will see how they are named on the backend it does not matter. On our site we use the location field on the themes and showcase galleries to store the url to the theme or showcase site.
  • Okay, so basically they could be renamed to "custom field 1" and "custom field 2", with the only oddity remaining is that one is arbitrarily singleline, and the other is multiline.

    Am I correct in understanding that I can enter absolutely anything I like in those fields? If so, I might have a use for it.

    That is of course, you say they are legacy fields. But being legacy, are they deprecated as well, or are they here to stay?
  • acrylian Administrator
    With legacy I just meant they are there forever. They will not be removed.
  • I am considering storing one ore more external URLs in the custom data field, so that the image can be licensed. The theme I am experimenting with didn't support it, so I had to add following code in image.php:

    if (getImageData('custom_data')!='') {
        $customData = getImageData('custom_data');
        echo '<h2>' . gettext('License'). '</h2>';
        $arrayOfLines = explode("\n",
            str_replace(array("\r\n","\n\r","\r"),"\n",$customData)
        );
        foreach ($arrayOfLines as $line) {
            if (strpos($line, 'http') === 0) {
                echo '<a href="'.$line.'">'.gettext('License this image').'</a>';
            }
        }
    }
    

    Location field would have the advantage that you can set it in Lightroom and it then gets imported automatically, saving time and keeping the data stored locally.

  • acrylian Administrator

    You can also use the short cutgetImageCustomData(). Or even in the core object mode $_zp_current_image->getCustomData().

    If the licence urls are known and always the same you could also assign a specific tag and just print the lines if it is assigned. If these url differ per image your way is probably the best.

Sign In or Register to comment.