Bug 0000684: History [Search] - Add a thumbnail display.

git-svn-id: http://piwigo.org/svn/trunk@1991 68402e56-0260-453c-a942-63ccdbb3a9ee
This commit is contained in:
vdigital
2007-04-29 19:04:57 +00:00
parent 24bbf9758d
commit f1494f1893
2 changed files with 67 additions and 5 deletions
+35 -5
View File
@@ -413,7 +413,10 @@ SELECT
id,
IF(name IS NULL, file, name) AS label,
filesize,
high_filesize
high_filesize,
file,
path,
tn_ext
FROM '.IMAGES_TABLE.'
WHERE id IN ('.implode(',', array_keys($image_ids)).')
;';
@@ -421,7 +424,10 @@ SELECT
$label_of_image = array();
$filesize_of_image = array();
$high_filesize_of_image = array();
$file_of_image = array();
$path_of_image = array();
$tn_ext_of_image = array();
$result = pwg_query($query);
while ($row = mysql_fetch_array($result))
{
@@ -436,6 +442,10 @@ SELECT
{
$high_filesize_of_image[ $row['id'] ] = $row['high_filesize'];
}
$file_of_image[ $row['id'] ] = $row['file'];
$path_of_image[ $row['id'] ] = $row['path'];
$tn_ext_of_image[ $row['id'] ] = $row['tn_ext'];
}
// echo '<pre>'; print_r($high_filesize_of_image); echo '</pre>';
@@ -551,9 +561,29 @@ SELECT
)
);
$image_string = '<a href="'.$picture_url.'">';
$image_string.= '('.$line['image_id'].')';
// <a class="thumbnail" href="#thumb">(1258)<span><img src="./galleries/category/thumbnail/th-dsc1258.png"></span></a>
$element = array(
'id' => $line['image_id'],
'file' => $file_of_image[$line['image_id']],
'path' => $path_of_image[$line['image_id']],
'tn_ext' => $tn_ext_of_image[$line['image_id']],
);
$image_string = '';
if (!isset($conf['history_no_thumb']) or $conf['history_no_thumb']) {
$thumb_mode = "over";
if (isset($conf['history_no_hover']) and $conf['history_no_hover']) {
$thumb_mode = "thumbnail";
}
$image_string = '<a class="'.$thumb_mode.'" href="#thumb">'
.'('.$line['image_id'].') <span><img src="'
. get_thumbnail_url( $element )
.'"></span></a><a href="'.$picture_url.'">';
}
else {
$image_string= '<a href="'.$picture_url.'">';
$image_string.= '('.$line['image_id'].')';
}
if (isset($label_of_image[$line['image_id']]))
{
$image_string.= ' '.$label_of_image[$line['image_id']];
+32
View File
@@ -203,3 +203,35 @@ ul.tabsheet li {
border-radius: 6px 6px 0px 0px; /* round corners with CSS3 compliant browsers */
padding: 5px 2em 2px 2em;
}
.over{
position: relative;
z-index: 0;
}
.over:hover{
background-color: transparent;
z-index: 50;
}
.over span{ /*CSS for enlarged image*/
position: absolute;
background-color: #eee;
padding: 5px;
left: -1000px;
border: 1px solid #69c;
visibility: hidden;
color: black;
text-decoration: none;
}
.over span img{ /*CSS for enlarged image*/
border-width: 0;
padding: 2px;
}
.over:hover span{ /*CSS for enlarged image on hover*/
visibility: visible;
top: 0;
left: 60px; /*position where enlarged image should offset horizontally */
}