Hello.
I am putting together a php photo gallery and have a field in the mysql database called photoKeywords. This contains some comma delimited keywords for each photo. eg. Cityname, Countryname, Peoplename
I have created a search page that displays all the photos, captions and keywords that match the search criteria. This works great but I would like to be able to click on a keyword shown beside a photo and rerun the search, finding all the other photos with that keyword.
To do this I need to change "Cityname, Countryname, Peoplename" into
<a href="viewerTags.php?tag=%25Cityname%25">Cityname</a><a href="viewerTags.php?tag=%25Countryname%25">Countryname</a><a href="viewerTags.php?tag=%25Peoplename%25">Peoplename</a>
I currently use the following code to display the thumbnails.
<?php
$counter = 0;
if ($totalRows_thumbs > 0)
{while($row_thumbs = mysql_fetch_assoc($thumbs)){
$counter = $counter + 1;
$thumbs1.= '<div class="comment">';
$thumbs1.= '</div>';
$thumbs1.= '<div class="commentmain">';
$thumbs1.= '<div class="photoinfo">';
$thumbs1.= 'Photo ID: ' . $row_thumbs['photoID'] . '<br />';
$thumbs1.= 'Caption: ' . $row_thumbs['photoCaption'] . '<br />';
$thumbs1.= 'Keywords: ' . $row_thumbs['photoKeywords'] . '<br />';
$thumbs1.= 'EXIF Info: Hover mouse over image <br />';
$thumbs1.= 'Gallery Name: ' . $row_thumbs['photoGallery'] . '<br /><br />';
$thumbs1.= '<a href="viewerDynamic.php?id=' . $row_thumbs['photoID'] . '&gallery=' . $row_thumbs['photoGallery'] . '">View large image in original gallery</a>';
$thumbs1.= '</div>';
$thumbs1.= '<a href="viewerDynamic.php?id=' . $row_thumbs['photoID'] . '&gallery=' . $row_thumbs['photoGallery'] . '"> <img class="image" src="thumbs/' . $row_thumbs['photoID'] . '" alt="' . $row_thumbs['photoExif'] . '" title="' . $row_thumbs['photoExif'] .'"></img></a>';
$thumbs1.= '</div>';
};
}else{
$thumbs1.= '<br >There are no photos that meet your criteria.<br />';
$thumbs1.= 'Please <a href="index.php">try again</a><br /><br >';
}
?>
<?php echo $thumbs1; ?>
Can I perform that change I mention above in this line:
$thumbs1.= 'Keywords: ' . $row_thumbs['photoKeywords'] . '<br />';
or should I give up now!
Thanks for taking the time to read this.
Alex
I am putting together a php photo gallery and have a field in the mysql database called photoKeywords. This contains some comma delimited keywords for each photo. eg. Cityname, Countryname, Peoplename
I have created a search page that displays all the photos, captions and keywords that match the search criteria. This works great but I would like to be able to click on a keyword shown beside a photo and rerun the search, finding all the other photos with that keyword.
To do this I need to change "Cityname, Countryname, Peoplename" into
<a href="viewerTags.php?tag=%25Cityname%25">Cityname</a><a href="viewerTags.php?tag=%25Countryname%25">Countryname</a><a href="viewerTags.php?tag=%25Peoplename%25">Peoplename</a>
I currently use the following code to display the thumbnails.
<?php
$counter = 0;
if ($totalRows_thumbs > 0)
{while($row_thumbs = mysql_fetch_assoc($thumbs)){
$counter = $counter + 1;
$thumbs1.= '<div class="comment">';
$thumbs1.= '</div>';
$thumbs1.= '<div class="commentmain">';
$thumbs1.= '<div class="photoinfo">';
$thumbs1.= 'Photo ID: ' . $row_thumbs['photoID'] . '<br />';
$thumbs1.= 'Caption: ' . $row_thumbs['photoCaption'] . '<br />';
$thumbs1.= 'Keywords: ' . $row_thumbs['photoKeywords'] . '<br />';
$thumbs1.= 'EXIF Info: Hover mouse over image <br />';
$thumbs1.= 'Gallery Name: ' . $row_thumbs['photoGallery'] . '<br /><br />';
$thumbs1.= '<a href="viewerDynamic.php?id=' . $row_thumbs['photoID'] . '&gallery=' . $row_thumbs['photoGallery'] . '">View large image in original gallery</a>';
$thumbs1.= '</div>';
$thumbs1.= '<a href="viewerDynamic.php?id=' . $row_thumbs['photoID'] . '&gallery=' . $row_thumbs['photoGallery'] . '"> <img class="image" src="thumbs/' . $row_thumbs['photoID'] . '" alt="' . $row_thumbs['photoExif'] . '" title="' . $row_thumbs['photoExif'] .'"></img></a>';
$thumbs1.= '</div>';
};
}else{
$thumbs1.= '<br >There are no photos that meet your criteria.<br />';
$thumbs1.= 'Please <a href="index.php">try again</a><br /><br >';
}
?>
<?php echo $thumbs1; ?>
Can I perform that change I mention above in this line:
$thumbs1.= 'Keywords: ' . $row_thumbs['photoKeywords'] . '<br />';
or should I give up now!
Thanks for taking the time to read this.
Alex