forum.coppermine-gallery.net

Support => cpg1.3.x Support => Older/other versions => cpg1.3 Miscellaneous => Topic started by: nickweb on August 20, 2004, 12:25:18 am

Title: Display image name in popup box
Post by: nickweb on August 20, 2004, 12:25:18 am
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
Title: Re: Display image name in popup box
Post by: Joachim Müller on August 20, 2004, 08:54:05 am
edit displayimage.php, find
Code: [Select]
            $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)
Code: [Select]
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
Title: Re: Display image name in popup box
Post by: nickweb on August 20, 2004, 10:53:59 am
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
Title: Re: Display image name in popup box
Post by: Joachim Müller on August 21, 2004, 03:58:07 am
make the above modification look like this:
Code: [Select]
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:
Code: [Select]
<?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