coppermine-gallery.com/forum

Support => cpg1.4.x Support => Older/other versions => cpg1.4 themes/skins/templates => Topic started by: Jmaj on November 27, 2008, 02:41:17 AM

Title: Changing the Background color
Post by: Jmaj on November 27, 2008, 02:41:17 AM
Hey,

Does anyone know where the file is to change the color of the BG is displayimage.php

Example:

http://coppermine-gallery.net/demo/cpg14x/displayimage.php?pid=268&fullsize=1


The color is gray, I wanna make it white

thanks
Title: Re: Changing the Background color
Post by: Joachim Müller on November 27, 2008, 10:04:59 AM
We can tell you how to change the background color of our site. However that would not help you much, as it depends on the theme you use. Therefor, posting a link to your gallery might help (we already know the URL of our demo). That's why board rules say to post links. There's even a list at the top of the page where you compose your messages that says so. There's a reason for that policy...

You might want to look into http://forum.coppermine-gallery.net/index.php/topic,24056.msg123520.html#msg123520, as questions similar to yours have been asked a million times already. Generic answer: color is being defined in the stylesheet that comes with your theme.

Title: Re: Changing the Background color
Post by: Jmaj on November 27, 2008, 03:59:32 PM
Oh okay.


And I found it, for future searches.

The answers is the:

includes/themes.inc.php

Look for the   <style type="text/css"> and edit the background color to what you want.
Title: Re: Changing the Background color
Post by: Hein Traag on November 27, 2008, 04:16:09 PM
Do not edit core files.. read the Joachims post more careful

QuoteGeneric answer: color is being defined in the stylesheet that comes with your theme.
Title: Re: Changing the Background color
Post by: Jmaj on November 27, 2008, 04:37:39 PM
I read the css before I posted the topic. I couldnt find the grey color and it's hex value.


I couldnt find it in the main css and my theme's css.

The source showed it as a embedded css, and that area is where I found it. Unless it's somewhere else.
Title: Re: Changing the Background color
Post by: Joachim Müller on November 27, 2008, 05:49:35 PM
As Hein suggested: do not edit include/themes.inc.php! Under no circumstances!

Any particular reason for not doing as I suggested:
Quote from: Joachim Müller on November 27, 2008, 10:04:59 AMTherefor, posting a link to your gallery might help
Title: Re: Changing the Background color
Post by: Gizmo on November 28, 2008, 12:54:55 PM
To change the background color of the popup fullsize image you need to copy the following code from the sample theme.php and paste it into your theme.php then change the sytling.

Copy from Sample theme.php and paste into your theme.php:

// 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
}


Locate and edit the background color to suit your needs.
body { margin: 0; padding: 0; background-color: gray; }

For instance, if you want it black, change "gray" to "black" or use the hexadecimal code.
body { margin: 0; padding: 0; background-color: black; }
or
body { margin: 0; padding: 0; background-color: #000000; }