Mystical theme_display_fullsize_pic Mystical theme_display_fullsize_pic
 

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

Mystical theme_display_fullsize_pic

Started by sigalarm, June 04, 2005, 07:15:28 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

sigalarm

I have noticed in displayimage.php that it first checks for theme_display_fullsize_pic before executing the default behavior. I am trying to find a way to change the way the popup window works to add a bit of image data in there, without having to hack on displayimage.php.

Any suggestions on how theme_display_fullsize_pic works? Or is it considered "ok" to make changes to theme_display_fullsize_pic?

Thanks, new to Coppermine, but I am already impressed by what it can do.

sigalarm.

Joachim Müller

edit displayimage.php, find<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title><?php echo $CONFIG['gallery_name'?>: <?php echo $lang_fullsize_popup['click_to_close'];
    
?>
</title>
<meta http-equiv="content-type" content="text/html; charset=<?php echo $CONFIG['charset'] == 'language file' $lang_charset $CONFIG['charset'?>" />
<link rel="stylesheet" href="<?php echo $THEME_DIR ?>style.css" />
<script type="text/javascript" src="scripts.js"></script>
</head>
<body scroll="auto" marginwidth="0" marginheight="0">
<script language="JavaScript" type="text/JavaScript">
adjust_popup();
</script>

<table width="100%" height="100%" border="0" cellpadding="0" cellspacing="2">
<td align="center" valign="middle">
  <table cellspacing="2" cellpadding="0" style="border: 1px solid #000000; background-color: #FFFFFF;">
   <td>
<?php
    
if (isset($HTTP_GET_VARS['picfile'])) {
        if (!
GALLERY_ADMIN_MODEcpg_die(ERROR$lang_errors['access_denied'], __FILE____LINE__);

        
$picfile $HTTP_GET_VARS['picfile'];
        
$picname $CONFIG['fullpath'] . $picfile;
        
$imagesize = @getimagesize($picname);
        echo 
"<a href=\"javascript: window.close()\"><img src=\"" path2url($picname) . "\" $imagesize[3] class=\"image\" border=\"0\" alt=\"\" title=\"$picfile\n" $lang_fullsize_popup['click_to_close'] . "\"/></a><br />\n";
    } elseif (isset(
$HTTP_GET_VARS['pid'])) {
        
$pid = (int)$HTTP_GET_VARS['pid'];
        
$sql "SELECT * " "FROM {$CONFIG['TABLE_PICTURES']} " "WHERE pid='$pid$ALBUM_SET";
        
$result db_query($sql);

        if (!
mysql_num_rows($result)) cpg_die(ERROR$lang_errors['non_exist_ap'], __FILE____LINE__);

        
$row mysql_fetch_array($result);
        
$pic_url get_pic_url($row'fullsize');
        
$geom 'width="' $row['pwidth'] . '" height="' $row['pheight'] . '"';
        echo 
"<a href=\"javascript: window.close()\"><img src=\"" $pic_url "\" $geom class=\"image\" border=\"0\" alt=\"\" title=\"" htmlspecialchars($row['filename']) . "\n" $lang_fullsize_popup['click_to_close'] . "\"></a><br />\n";
    }

    
?>

   </td>
  </table>
</td>
</table>
</body>
</html>
and add whatever you want to it: it's the code that builds the full-size pop-up

sigalarm

Thank you much, I started poking at that part already, I just wondered if the feature to have the theme override this behavior was implemented yet or not.

Siggy

Joachim Müller

hasn't been implemented, your contrib would be welcome.