howto change the full screen view howto change the full screen view
 

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

howto change the full screen view

Started by Lif3styl3, August 30, 2006, 02:29:28 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Lif3styl3

i want to change the fullscrren view of my own template,...
the fullscreen pop up consits out of this code:
<!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=utf-8" />
  <title>Lifes Hammer Fotogallerie: Bild anklicken, um das Fenster zu schließen!</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">
              <a href="javascript: window.close()"><img src="albums/userpics/10101/P1050680.JPG" width="1024" height="768"alt="P1050680.JPG" title="P1050680.JPGBild anklicken, um das Fenster zu schließen!" /></a><br />
          </div>
        </td>
      </tr>
    </table>
  </body>
</html>

I have to change the image part of the popup.
I don't know where and how cpg generates this popup.

I've found a javascript which seems to open the popup, but there i've got no oppertunity to change the look of the image i think.

Nibbler

Copy the popup function from themes/sample/theme.php to your custom theme and modify your 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
}

Lif3styl3

#2
ok the upper parts is clear,...
but where does the lower part belong to ?
______________________________________________________________________
Addon:
Ok, after looking at include/theme.php.inc
everyting was clear


Joachim Müller

Do not edit themes.inc.php, under no circumstances. Everything that could go into that file can as well (and even better) go into themes/yourtheme/theme.php

Lif3styl3

i haven't edited that file,....
i only read the the file and copied the needed content to my theme.php and then everytink was clear for me,....


Nibbler

You should copy from the sample theme as suggested.

Lif3styl3

i don't know which sample theme,.....

how its called ?

Joachim Müller

It's called "sample". You can't select it from the "choose a theme" dropdown on your page, but it is there - at least in the coppermine package you initially downloaded. It resides within the "themes" sub-folder of coppermine, as all other themes.

Lif3styl3

i've never seen that one,....

i've got only my template files there,...

i will take a look in the zip file
but where is the difference between theme.inc.php and sample theme,..
Is there any content which is not "free" for editing