forum.coppermine-gallery.net
Support => cpg1.3.x Support => Older/other versions => cpg1.3 Miscellaneous => Topic started by: ranpergamin on February 02, 2005, 09:58:12 am
-
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
-
edit themes/yourtheme/theme.php, find
// HTML template for thumbnails display
and 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