Advanced search  

News:

CPG Release 1.6.26
Correct PHP8.2 issues with user and language managers.
Additional fixes for PHP 8.2
Correct PHP8 error with SMF 2.0 bridge.
Correct IPTC supplimental category parsing.
Download and info HERE

Pages: [1]   Go Down

Author Topic: Changing Background Color in display.php  (Read 8481 times)

0 Members and 1 Guest are viewing this topic.

David Bickle

  • Coppermine newbie
  • Offline Offline
  • Posts: 4
Changing Background Color in display.php
« on: April 21, 2012, 09:47:14 am »

Hello

My site is:
http://www.http://catps.co.uk/index.php

User: test
Password: test

I am attempting to change the background from gray to black in display.php.  I have searched the forum and found this post and follwoed the advice
http://forum.coppermine-gallery.net/index.php/topic,56725.0.html

However when I click on the image the whole image is black not the background. I have placed display.php below with the added sample.php in theme.php but possibly put it in the wrong place?  Can anyone go

Code: [Select]
<?php
/*************************
  Coppermine Photo Gallery
  ************************
  Copyright (c) 2003-2010 Coppermine Dev Team
  v1.0 originally written by Gregory Demar

  This program is free software; you can redistribute it and/or modify
  it under the terms of the GNU General Public License version 3
  as published by the Free Software Foundation.
  
  ********************************************
  Coppermine version: 1.5.3
  $HeadURL: https://coppermine.svn.sourceforge.net/svnroot/coppermine/trunk/cpg1.5.x/themes/dark_velvet/theme.php $
  $LastChangedBy: M4rkus $
  $Theme version 1.0
  $Date: 2010-04-20 11:00:00 +0100 (Di, 20. April 2010) $
**********************************************/

define('THEME_HAS_PROGRESS_GRAPHICS'1);

// HTML template for template sys_menu spacer
$template_sys_menu_spacer '<img src="themes/dark_velvet/images/grey_carret.gif" width="8" height="8" border="0" alt="" />';
// 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_MODEcpg_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: black; }
  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
}
?>
Logged

David Bickle

  • Coppermine newbie
  • Offline Offline
  • Posts: 4
Re: Changing Background Color in display.php
« Reply #1 on: April 21, 2012, 11:24:24 am »

Logged

Αndré

  • Administrator
  • Coppermine addict
  • *****
  • Country: de
  • Offline Offline
  • Gender: Male
  • Posts: 15764
Re: Changing Background Color in display.php
« Reply #2 on: April 23, 2012, 12:09:57 pm »

The mod stays the same, but maybe the code base is different in cpg1.4.x and cpg1.5.x. So please copy the function theme_display_fullsize_pic from themes/sample/theme.php to your theme's theme.php file if it doesn't exist. Then, find
Code: [Select]
body { margin: 0; padding: 0; background-color: gray; }and replace with
Code: [Select]
body { margin: 0; padding: 0; background-color: black; }
find
Code: [Select]
<body style="margin:0px; padding:0px; background-color: gray;">and replace with
Code: [Select]
<body style="margin:0px; padding:0px; background-color: black;">
Logged
Pages: [1]   Go Up
 

Page created in 0.022 seconds with 19 queries.