Advanced search  

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]

Pages: [1]   Go Down

Author Topic: Display image name in popup box  (Read 3350 times)

0 Members and 1 Guest are viewing this topic.

nickweb

  • Coppermine newbie
  • Offline Offline
  • Posts: 3
Display image name in popup box
« 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
Logged

Joachim Müller

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 47844
  • aka "GauGau"
    • gaugau.de
Re: Display image name in popup box
« Reply #1 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
Logged

nickweb

  • Coppermine newbie
  • Offline Offline
  • Posts: 3
Re: Display image name in popup box
« Reply #2 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
Logged

Joachim Müller

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 47844
  • aka "GauGau"
    • gaugau.de
Re: Display image name in popup box
« Reply #3 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
Logged
Pages: [1]   Go Up
 

Page created in 0.018 seconds with 19 queries.