Advanced search  

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]

Pages: [1]   Go Down

Author Topic: Full size view without javascript?  (Read 4253 times)

0 Members and 1 Guest are viewing this topic.

Col. Kurtz

  • Coppermine newbie
  • Offline Offline
  • Posts: 15
Full size view without javascript?
« 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?
Logged

Col. Kurtz

  • Coppermine newbie
  • Offline Offline
  • Posts: 15
Re: Full size view without javascript?
« Reply #1 on: August 28, 2005, 10:39:03 pm »

no one?
Logged

kegobeer

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 4637
  • Beer - it does a body good!
    • The Kazebeer Family Website
Re: Full size view without javascript?
« Reply #2 on: August 29, 2005, 12:46:06 am »

Look in displayimage.php and search for

Code: [Select]
$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

Code: [Select]
//$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:

Code: [Select]
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.
Logged
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

  • Coppermine newbie
  • Offline Offline
  • Posts: 15
Re: Full size view without javascript?
« Reply #3 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.
Logged

kegobeer

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 4637
  • Beer - it does a body good!
    • The Kazebeer Family Website
Re: Full size view without javascript?
« Reply #4 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.
Logged
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

  • Coppermine newbie
  • Offline Offline
  • Posts: 15
Re: Full size view without javascript?
« Reply #5 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.
Logged

Joachim Müller

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 47843
  • aka "GauGau"
    • gaugau.de
Re: Full size view without javascript?
« Reply #6 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...
Logged

Col. Kurtz

  • Coppermine newbie
  • Offline Offline
  • Posts: 15
Re: Full size view without javascript?
« Reply #7 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.
Logged

Joachim Müller

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 47843
  • aka "GauGau"
    • gaugau.de
Re: Full size view without javascript?
« Reply #8 on: August 30, 2005, 08:18:14 am »

sure, you could use
Code: [Select]
get_pic_url($CURRENT_PIC_DATA, 'fullsize')
Logged

Col. Kurtz

  • Coppermine newbie
  • Offline Offline
  • Posts: 15
Re: Full size view without javascript?
« Reply #9 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!
Logged

Col. Kurtz

  • Coppermine newbie
  • Offline Offline
  • Posts: 15
Re: Full size view without javascript?
« Reply #10 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.
Logged
Pages: [1]   Go Up
 

Page created in 0.024 seconds with 15 queries.