coppermine-gallery.com/forum

Support => Older/other versions => cpg1.3.x Support => Topic started by: Col. Kurtz on August 28, 2005, 12:56:15 AM

Title: Full size view without javascript?
Post by: Col. Kurtz on August 28, 2005, 12:56:15 AM
Hi, I implemented the gallery into serendipity blog software. To do this I had to delete all headers in the template.html file. I also had to delete the javascript, and now of course its not working anymore. Can I replace this with normal links, that open a new window? If yes: how?
Title: Re: Full size view without javascript?
Post by: Col. Kurtz on August 28, 2005, 10:39:03 PM
no one?
Title: Re: Full size view without javascript?
Post by: kegobeer on August 29, 2005, 12:46:06 AM
Look in displayimage.php and search for

$pic_html = "<a href=\"javascript:;\" onClick=\"MM_openBrWindow('displayimage.php?pid=$pid&fullsize=1','" . uniqid(rand()) . "','scrollbars=yes,toolbar=yes,status=yes,resizable=yes,width=$winsizeX,height=$winsizeY')\">";

change to

//$pic_html = "<a href=\"javascript:;\" onClick=\"MM_openBrWindow('displayimage.php?pid=$pid&fullsize=1','" . uniqid(rand()) . "','scrollbars=yes,toolbar=yes,status=yes,resizable=yes,width=$winsizeX,height=$winsizeY')\">";
$pic_html = "<a href='displayimage.php?pid=$pid&fullsize=1'";


Now, open your theme's theme.php file and add this:

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

<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>';
    if (isset($HTTP_GET_VARS['picfile'])) {
        if (!GALLERY_ADMIN_MODE) cpg_die(ERROR, $lang_errors['access_denied'], __FILE__, __LINE__);

        $picfile = $HTTP_GET_VARS['picfile'];
        $picname = $CONFIG['fullpath'] . $picfile;
        $imagesize = @getimagesize($picname);
        echo '<img src="', path2url($picname), '"', $imagesize[3], ' class="image" border="0" alt="" title="', $picfile, '"/><br />
        ';
    } 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 '<img src="', $pic_url, '"', $geom, ' class="image" border="0" alt="" title="', htmlspecialchars($row['filename']), '"><br />
        ';
    }
echo '
   </td>
  </table>
</td>
</table>
</body>
</html>';
}


Why did you have to delete the javascript link?  If you add the javascript link to whatever blog template you have, then the popup and rest of the functions will work.  Without it, the slideshow and other stuff won't work.
Title: Re: Full size view without javascript?
Post by: Col. Kurtz on August 29, 2005, 08:13:29 AM
Ok I followed the instructions given from the s9y developer on the s9y support forums. http://www.s9y.org/forums/viewtopic.php?p=2321#2321
It says to remove all the headers in the template.html file, so this includes the javascript line.

I´ve added script into my blogs header, and I tried your code. Both show a bigger version of the pic, but the blog´s layout is still around and messing with the pic, because now the imagesize is larger than it should be. screwing up the tables.

Here´s the version with your code.http://test.hohle-phrasen.de/cm If you click on to the larger version you´ll see what I mean.
Title: Re: Full size view without javascript?
Post by: kegobeer on August 29, 2005, 03:19:43 PM
Provide a direct link to a problem area.

If you added the javascript into your header, you don't need to do any Coppermine code alteration.
Title: Re: Full size view without javascript?
Post by: Col. Kurtz on August 29, 2005, 10:01:36 PM
Ok so I entered the correct javascript into the blog´s template:

go there: http://www.scbayer.hohle-phrasen.de/cpg/displayimage.php?album=2&pos=0
click on the image. see what happens.

something similar happened when I used your code, but then it opened in the same frame, not in a new window.
Title: Re: Full size view without javascript?
Post by: Joachim Müller on August 30, 2005, 07:23:34 AM
the unique id is not there, the fullsize get's opened with this url: http://www.scbayer.hohle-phrasen.de/cpg/displayimage.php?pid=80&fullsize=1
Hard to say what went wrong without seing the full code, after all this is a mod of the mod...
Title: Re: Full size view without javascript?
Post by: Col. Kurtz on August 30, 2005, 07:40:20 AM
is there any way to open just the image in a new window < a href="pictureURL"target="_blank"> [or whatever] and not the displayimage.php? I think the way this is included, every php will show the headers, footers and tables of the blog, and with the fullsizeimage the tables get into trouble.
Title: Re: Full size view without javascript?
Post by: Joachim Müller on August 30, 2005, 08:18:14 AM
sure, you could use get_pic_url($CURRENT_PIC_DATA, 'fullsize')
Title: Re: Full size view without javascript?
Post by: Col. Kurtz on August 30, 2005, 10:35:57 AM
could you please suggest the code for $pic_html = ?
because I get some error messages.
sorry but Im stupid.

I really appreciate your help!
Title: Re: Full size view without javascript?
Post by: Col. Kurtz on August 31, 2005, 10:02:08 PM
Ive tried various modifications, but I run into errors all the time. But I did not find a way to show the fullsize image. I found a way to show the intermediate pictures, but thats not what I want.