Display image name in popup box Display image name in popup box
 

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

Display image name in popup box

Started by nickweb, August 20, 2004, 12:25:18 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

nickweb

Hi, is there anyway i can add a small link into displayimage.php just underneath the image that will popup a new box (no toolbars, no resize etc) and say something like "test to do stuff blah blah filename" ??

where filename is the filename of the image or item that has just been viewed in displayimage.php?

And is there a way to further customise this and only display it in certain categories? (i have 2 major categories, with several sub categories, and want it to display in cat 1 and all tis ub categories, but not cat 2 or its sub categories..)

Thanks in advance!! :)

Nick

www.nick-web.co.uk

Joachim Müller

edit displayimage.php, find            $pic_html = "<a href=\"javascript:;\" onClick=\"MM_openBrWindow('displayimage.php?pid=$pid&fullsize=1','" . uniqid(rand()) . "','scrollbars=yes,toolbar=yes,status=yes,resizable=yes,width=$winsizeX,height=$winsizeY')\">";
            $pic_title = $lang_display_image_php['view_fs'] . "\n==============\n" . $pic_title;
            $pic_html .= "<img src=\"" . $picture_url . "\" class=\"image\" border=\"0\" alt=\"{$lang_display_image_php['view_fs']}\" /><br />";
            $pic_html .= "</a>\n";
        } else {
            $pic_html = "<img src=\"" . $picture_url . "\" {$image_size['geom']} class=\"image\" border=\"0\" /><br />\n";
        }
and add after it (in a new line)if ($cat != 2) {
$pic_html .= "<a href=\"javascript:;\" onClick=\"MM_openBrWindow('yourpopupfile.php','" . uniqid(rand()) . "','scrollbars=yes,toolbar=yes,status=yes,resizable=yes,width=$winsizeX,height=$winsizeY')\">";
}
(not tested though).

GauGau

nickweb

excelent! Any ideas what i put in yourpopupfile.php to displayu the image name?

Would i require to create a string before the popup is called??

Thanks!! :))
Nick

Joachim Müller

make the above modification look like this:if ($cat != 2) {
$pic_html .= "<a href=\"javascript:;\" onClick=\"MM_openBrWindow('yourpopupfile.php?file=$picture_url','" . uniqid(rand()) . "','scrollbars=yes,toolbar=yes,status=yes,resizable=yes,width=$winsizeX,height=$winsizeY')\">";
}
and let your file "yourpopup.php have this content:<?php
print $_REQUEST['file'];
?>

I can't help you any further, as I won't start teaching you PHP - if you need to have a customized php page, then you will have to learn php.

GauGau