diff -urN src.orig/common_display.php src/common_display.php --- src.orig/common_display.php 2005-10-08 14:45:44.000000000 -0700 +++ src/common_display.php 2008-07-13 11:29:04.000000000 -0700 @@ -672,6 +672,12 @@ $preview = rig_encode_url_link($preview); + $georef = rig_get_pict_link($current_real_album, $file); + if ($georef) + { + $georef = " ".$georef['link']."(".$georef['shorttext'].")"; + } + // RM 20021101 important: the and the title must have the // immediately after without any new-line in between (most browsers would insert @@ -680,7 +686,7 @@ // extra space between rows or images. $link = rig_self_url($file); - $title = "
$pretty1
"; + $title = "
$pretty1$georef
"; $tooltip = "$html_image: $pretty2"; @@ -1013,6 +1019,12 @@ // url-encode filename $preview = rig_encode_url_link($preview); + $georef=rig_get_pict_link($current_real_album, $current_image); + + if ($georef) + { + echo $georef['link']; + } if (is_array($icon_info) && count($icon_info) > 2) { // if we have the size, use it in the img tag @@ -1027,6 +1039,11 @@ // just use the img name anyway echo "\"$pretty_image\""; } + if ($georef) + { + echo ""; + echo $georef['link'].$georef['longtext']."
"; + } } else if (strncmp($type, "video/", 6) == 0) { diff -urN src.orig/common_images.php src/common_images.php --- src.orig/common_images.php 2005-10-08 14:45:44.000000000 -0700 +++ src/common_images.php 2008-07-13 11:31:15.000000000 -0700 @@ -861,6 +861,55 @@ return $filetypes; } +//********************************************************************* +function rig_get_pict_link($album, $file) +//********************************************************************* +{ + global $abs_album_path; + global $georef_shorttext; + global $georef_longtext; + global $georef_link; + + # In case we get called more than once, cache the result + if ($georef_text) + { + return array('shorttext' => $georef_shorttext, 'longtext' => $georef_longtext, 'link' => $georef_link); + } + + $abs_link_file = $abs_album_path . rig_prep_sep($album) . rig_prep_sep(".rig_mapping"); + + # Rig mapping file is: Pic_Name|Short Link Text|Long Link Text| + + if (is_readable($abs_link_file)) + { + $handle = fopen($abs_link_file, "rt"); + while ($line = fgets($handle, 8192)) + { + if (preg_match('/([^|]*)\|([^|]*)\\|([^|]*)\|(.*)/', $line, $regs)) + { + // echo "$regs[1] + $regs[2] + $regs[3]
"; + if ($regs[1] == $file) + { + $georef_shorttext = $regs[2]; + $georef_longtext = $regs[3]; + $georef_link = $regs[4]; + return array('shorttext' => $georef_shorttext, 'longtext' => $georef_longtext, 'link' => $georef_link); + } + else + { + // echo "No Match $regs[1]
"; + } + } + else + { + rig_html_error("Error: can't process line from $abs_link_file: $line"); + } + } + } + + return NULL; +} + //----------------------------------------------------------------------- // end