coppermine-gallery.com/forum

Support => cpg1.4.x Support => Older/other versions => cpg1.4 themes/skins/templates => Topic started by: junkyfungus on December 07, 2006, 06:47:48 AM

Title: Change Image fullsize background color to image?!
Post by: junkyfungus on December 07, 2006, 06:47:48 AM
http://forum.coppermine-gallery.net/index.php?topic=35018.msg164320#msg164320

Hi I've read this topic, but have a question in regards to it. I am using classic theme and want to change the background color to an image of the full size pic. Sami said:
Quote from: Sami on August 16, 2006, 04:39:41 PM
copy theme_display_fullsize_pic function form themes\sample\theme.php to theme.php ,if you don't have it already
and then change the background-color: defined under body style to your color
but not being to smart does this mean copy just that line into themes\classic\theme.php or should I be copying anything else too? If xomeone could display the code for me that would be great.

www.aerosolwarzone.com/gallery


Title: Re: Change Image fullsize background color to image?!
Post by: junkyfungus on December 07, 2006, 07:13:28 AM
OOOPS sorry about not posting this on the right board.

And just to make it a little clearer... I want to add the brick wall I have as the background to the gallery as the background to the full size image. Is that possible?
Title: Re: Change Image fullsize background color to image?!
Post by: Joachim Müller on December 07, 2006, 07:24:53 AM
Copy // Display the full size image
function theme_display_fullsize_pic()
{
    global $CONFIG, $THEME_DIR, $ALBUM_SET;
    global $lang_errors, $lang_fullsize_popup, $lang_charset;

    if (isset($_GET['picfile']))
    {
        if (!GALLERY_ADMIN_MODE) cpg_die(ERROR, $lang_errors['access_denied'], __FILE__, __LINE__);

    $picfile = $_GET['picfile'];
    $picname = $CONFIG['fullpath'] . $picfile;
    $imagesize = @getimagesize($picname);
    $imagedata = array('name' => $picfile, 'path' => path2url($picname), 'geometry' => $imagesize[3]);
    }
    elseif (isset($_GET['pid']))
    {
    $pid = (int)$_GET['pid'];
    $sql = "SELECT * " . "FROM {$CONFIG['TABLE_PICTURES']} " . "WHERE pid='$pid' $ALBUM_SET";
    $result = cpg_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'] . '"';
    $imagedata = array('name' => $row['filename'], 'path' => $pic_url, 'geometry' => $geom);
    }

?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
  <head>
  <meta http-equiv="content-type" content="text/html; charset=<?php echo $CONFIG['charset'] == 'language file' $lang_charset $CONFIG['charset'?>" />
  <title><?php echo $CONFIG['gallery_name'?>: <?php echo $lang_fullsize_popup['click_to_close'];
      
?>
</title>
  <script type="text/javascript" src="scripts.js"></script>
  <style type="text/css">
  body { margin: 0; padding: 0; background-color: gray; }
  img { margin:0; padding:0; border:0; }
  #content { margin:0 auto; padding:0; border:0; }
  table { border:0; height:100%; width:100%; border-collapse:collapse}
  td {         vertical-align: middle; text-align:center; }
  </style>
  </head>
  <body>
    <script language="JavaScript" type="text/JavaScript">
      adjust_popup();
    </script>
    <table>
      <tr>
            <td>
          <div id="content">
              <?php     echo  '<a href="javascript: window.close()"><img src="'
                
htmlspecialchars($imagedata['path']) . '" '
                
$imagedata['geometry']
                . 
'alt="'
                
htmlspecialchars($imagedata['name'])
                . 
'" title="'
                
htmlspecialchars($imagedata['name'])
                . 
"\n" $lang_fullsize_popup['click_to_close']
                . 
'" /></a><br />' ."\n";
               
?>

          </div>
        </td>
      </tr>
    </table>
  </body>
</html>
<?php
}
from themes/sample/theme.php (the whole function definition) and paste it into themes/yourtheme/theme.php into a new line before?>and then edit as you see fit.
Title: Re: Change Image fullsize background color to image?!
Post by: junkyfungus on December 07, 2006, 07:27:52 AM
Most excellent. I thought that is what I should do, but before I go messing things up it's a good idea to ask. Thanks so much for the lightning fast response. ;D
Title: Re: Change Image fullsize background color to image?!
Post by: junkyfungus on December 07, 2006, 07:39:44 AM
Worked like a charm.  Thanks again. I guess you can mark this solved