Full size view without javascript? Full size view without javascript?
 

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

Main Menu

Full size view without javascript?

Started by Col. Kurtz, August 28, 2005, 12:56:15 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Col. Kurtz

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?


kegobeer

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.
Do not send me a private message unless I ask for one.  Make your post public so everyone can benefit.

There are no stupid questions
But there are a LOT of inquisitive idiots

Col. Kurtz

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.

kegobeer

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.
Do not send me a private message unless I ask for one.  Make your post public so everyone can benefit.

There are no stupid questions
But there are a LOT of inquisitive idiots

Col. Kurtz

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.

Joachim Müller

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...

Col. Kurtz

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.

Joachim Müller

sure, you could use get_pic_url($CURRENT_PIC_DATA, 'fullsize')

Col. Kurtz

could you please suggest the code for $pic_html = ?
because I get some error messages.
sorry but Im stupid.

I really appreciate your help!

Col. Kurtz

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.