1) Script Title: Image Thumbnail Viewer II
2) Script URL (on DD): http://www.dynamicdrive.com/dynamici...nailviewer2.js
3) Describe problem: I am trying to enhance the viewer by adding a popup to the image title. I have tried several popup scripts and all fail more or less. The basic page is served by PHP. All the viewer file data is read from a mysql table. That part works fine. I have now added an anchor which is a php variable which contains the popup link and a info icon. If there is no info file, this link and icon is not displayed.However, it seems that the link is not being sent to the popup script, but is just linking to a new page.
You can see the problem here:
HTML Code:
http://http://watermeadowstudio.co.uk/gallery_nu.php?type=Seascapes&new=&name=&page=4
This is a test page, any of the nav links will take you to the live pages, you'll have to come back here to get to the demo page!
If you hover the mouse over the top two thumbnails which have associated image info files the enlarged image is displayed along with the title and other metadata. At the end of the meta data is an info icon which should link to a popup but it doesn't, it opens a new page. Below the viewer I have placed another icon for test purposes. This is outside of the Image Thumbnail Image Viewer II script but still served by php. Clicking this opens the popup. If you look at the "page source code" you will see that the working link is:
[
HTML Code:
<a href = 'notes/tempest_series.php' class='popup1'> <img src = 'images/info.png'>
the broken link is:
HTML Code:
<a href = "notes/tempest_series3.php" class="popup1"> <img src = "images/info.png"></a>
The difference is double and single quotes. The php code is identical in both cases so the choice of quotes is made by the php or the jarvascript
The "viewer link" is generated by
[
PHP Code:
while($row = mysql_fetch_array($data))
{
// This bit is not working properly - class=popup1 is not being passed to the j-query script
if ($row[PicNotes]) {
$icon = "<a href = \"notes/$row[PicNotes]\" class=\"popup1\"> <img src = \"images/info.png\"> </a>";
}else{
$icon='';}
// Display LHS Thumbnail and Viewer Pic Data
echo "<a href='images/".$row['vfile']."' rel='enlargeimage' rev='targetdiv:loadarea' title='<b>".$row['Title']."</b><br />".$row['Medium']." ".$row['iw']." x ".$row['ih']." cm. .$icon'><img border='1' src='images/".$row['tnfile']." ' alt=' ' width='".$row['tnx']."' height='".$row['tny']."' class='tn' /></a><br />";
}
The working link is generated by
PHP Code:
$tmp = "tempest_series.php";
echo "<a href = 'notes/$tmp' class='popup1'> <img src = 'images/info.png'> </a>";
I tried replacing the "$icon" with hard code but the results are the same
Using single quotes or not escaping the double quotes causes the thumbnail display to garble of the whole script to crash.
The other point of note is that the right hand thumbnail page source, which has not been modified yet, looks very different.
Using curly braces doesn't help.
I have only just upgraded this page to the new (2010) version of ITNV II. The results were the same using the original (2007) code.
Please, can anybody spot the error.
Bookmarks