open thumbnail double click in a new explorer window open thumbnail double click in a new explorer window
 

News:

cpg1.5.48 Security release - upgrade mandatory!
The Coppermine development team is releasing a security update for Coppermine in order to counter a recently discovered vulnerability. It is important that all users who run version cpg1.5.46 or older update to this latest version as soon as possible.
[more]

Main Menu

open thumbnail double click in a new explorer window

Started by ranpergamin, February 02, 2005, 09:58:12 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

ranpergamin


Hi all,

I am trying to modify the gallery, that when a picture is pressed the link will open in a new window and not the same, How do I do that ?

------------------------------------------------------------------------------------------
function display_thumbnails($album, $cat, $page, $thumbcols, $thumbrows, $display_tabs)
{
global $CONFIG, $AUTHORIZED, $HTTP_GET_VARS;
global $album_date_fmt, $lang_display_thumbnails, $lang_errors, $lang_byte_units;

$thumb_per_page = $thumbcols * $thumbrows;
$lower_limit = ($page-1) * $thumb_per_page;

$pic_data = get_pic_data($album, $thumb_count, $album_name, $lower_limit, $thumb_per_page);

$total_pages = ceil($thumb_count / $thumb_per_page);

$i = 0;
if (count($pic_data) > 0) {
foreach ($pic_data as $key => $row) {
$i++;

$pic_title =$lang_display_thumbnails['filename'].$row['filename']."\n".
$lang_display_thumbnails['filesize'].($row['filesize'] >> 10).$lang_byte_units[1]."\n".
$lang_display_thumbnails['dimensions'].$row['pwidth']."x".$row['pheight']."\n".
$lang_display_thumbnails['date_added'].localised_date($row['ctime'], $album_date_fmt);

$pic_url = get_pic_url($row, 'thumb');
if (!is_image($row['filename'])) {
$image_info = getimagesize($pic_url);
$row['pwidth'] = $image_info[0];
$row['pheight'] = $image_info[1];
}

$image_size = compute_img_size($row['pwidth'], $row['pheight'], $CONFIG['thumb_width']);

$thumb_list[$i]['pos'] = $key < 0 ? $key : $i - 1 + $lower_limit;
$thumb_list[$i]['image'] = "<img src=\"" . $pic_url . "\" class=\"image\" {$image_size['geom']} border=\"0\" alt=\"{$row['filename']}\" title=\"$pic_title\">";
$thumb_list[$i]['caption'] = $row['caption_text'];
$thumb_list[$i]['admin_menu'] = '';
$thumb_list[$i]['aid'] = $row['aid'];
}
theme_display_thumbnails($thumb_list, $thumb_count, $album_name, $album, $cat, $page, $total_pages, is_numeric($album), $display_tabs);
} else {
theme_no_img_to_display($album_name);
}
}
------------------------------------

Cheers
Ran

Joachim Müller

edit themes/yourtheme/theme.php, find// HTML template for thumbnails displayand within this section, replace<a href="{LINK_TGT}">{THUMB}<br /></a>with<a href="{LINK_TGT}" target="_blank">{THUMB}<br /></a>
Making every page open in a new window is not recommended though - users know how to do a rightclick-"open link in new window". Forcing them to open a new window will make them leave your site - at least I would in the very moment an unneeded new window pops up. Also you should bear in mind that there a lot of opo-up blockers around your new "feature" will fall victim to.

Joachim