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] 2   Go Down

Author Topic: Improper location of images after hitting next button when viewing album.  (Read 19605 times)

0 Members and 1 Guest are viewing this topic.

me_slayer

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 27

I've noticed that when you browse pictures using the next button, you always have to scroll down a little to see the whole picture. The 'next' button refreshes the whole page and put you back on the top.

I've noticed this with every theme. Is it possible to position the image somewhat correctly when the user hits the 'next' button when viewing the album?

Sorry if this is a repost. I searched the forum and couldn't find a thread relating to this matter.

So, is it possible or am I just stupid and missing something obvious?

Thanks guys
Logged

mstralka

  • VIP
  • Coppermine frequent poster
  • ***
  • Offline Offline
  • Posts: 178

Try this mod.  I wasn't able to duplicate this problem (because my pictures are small enough to not have to scroll) but this might help.

This will create an anchor tag named
Code: [Select]
<a name="picture" id="picture" />
just above the image on displayimage.php


displayimage.php
FIND:
Code: [Select]
        $next_tgt = "$PHP_SELF?album=$album$cat_link&pos=$next";
Change to:
Code: [Select]
        $next_tgt = "$PHP_SELF?album=$album$cat_link&pos=$next#picture";

FIND:
Code: [Select]
        $prev_tgt = "$PHP_SELF?album=$album$cat_link&pos=$prev";
Change to:
Code: [Select]
        $prev_tgt = "$PHP_SELF?album=$album$cat_link&pos=$prev#picture";

FIND:
Code: [Select]
function html_picture_menu($id)
{
    global $lang_display_image_php;

    return <<<EOT
     <a href="#" onClick="return MM_openBrWindow('picEditor.php?id=$id','Crop_Picture','scrollbars=yes,toolbar=no,status=yes,resizable=yes')" class="admin_menu" >{$lang_display_image_php['crop_pic']}</a> <a href="editOnePic.php?id=$id&what=picture"  class="admin_menu">{$lang_display_image_php['edit_pic']}</a> <a href="delete.php?id=$id&what=picture"  class="admin_menu" onclick="return confirm('{$lang_display_image_php['confirm_del']}'); return false; ">{$lang_display_image_php['del_pic']}</a>

EOT;
}
Change to:
Code: [Select]
function html_picture_menu($id)
{
    global $lang_display_image_php;

    return <<<EOT
<a name="picture" id="picture" />
     <a href="#" onClick="return MM_openBrWindow('picEditor.php?id=$id','Crop_Picture','scrollbars=yes,toolbar=no,status=yes,resizable=yes')" class="admin_menu" >{$lang_display_image_php['crop_pic']}</a> <a href="editOnePic.php?id=$id&what=picture"  class="admin_menu">{$lang_display_image_php['edit_pic']}</a> <a href="delete.php?id=$id&what=picture"  class="admin_menu" onclick="return confirm('{$lang_display_image_php['confirm_del']}'); return false; ">{$lang_display_image_php['del_pic']}</a>

EOT;
}
Logged
GO IRISH

me_slayer

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 27
Thanks, but..
« Reply #2 on: August 22, 2004, 05:46:06 pm »

It still takes me to the top of the page..umm...

Thanks for your help and the quick reply. Still looking for a solution...

Edit : takes me at the bottom of the page, not top  ::)

« Last Edit: August 22, 2004, 05:56:54 pm by me_slayer »
Logged

Tranz

  • Dev Team member
  • Coppermine addict
  • ****
  • Country: 00
  • Offline Offline
  • Gender: Female
  • Posts: 6149

Part of the problem is that the screen and resolution is too small. Bigger monitors don't have that problem. The gallery display still functions the same way, but the image still fits in the window.

However, a template that would minimize the header space might help.

Also, have you tried using slideshow? The images will automatically go to the next images for you, and the image viewer stays in place in the browser window.
Logged

me_slayer

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 27

You are absolutely right. I work with high resolutions and this doesn't seem to be a problem at all. However, I've visitors that still use lower resolutions and I'm afraid  the picture won't fit on the screen. I like your idea of minimizing the header space.

Edit: Yes, slideshow works perfectly...good feature too

thanks man

Part of the problem is that the screen and resolution is too small. Bigger monitors don't have that problem. The gallery display still functions the same way, but the image still fits in the window.

However, a template that would minimize the header space might help.

Also, have you tried using slideshow? The images will automatically go to the next images for you, and the image viewer stays in place in the browser window.
Logged

Tranz

  • Dev Team member
  • Coppermine addict
  • ****
  • Country: 00
  • Offline Offline
  • Gender: Female
  • Posts: 6149

Have you checked out the Fruity theme? The navigation bar goes vertically on the side instead of across the top, so that would save some space there. I'm guessing that people with small screens probably have slow connections, too, so maybe minimizing the use of graphics in the template might help. Then name the template so it's easy to recognize that it's for low resolution viewers. Did you enable theme chooser?
Logged

willstein

  • Coppermine frequent poster
  • ***
  • Offline Offline
  • Gender: Male
  • Posts: 120
    • mansei

This will create an anchor tag named

Code: [Select]
<a name="picture" id="picture" />

just above the image on displayimage.php


Where might I find that?
Logged

Joachim Müller

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 47843
  • aka "GauGau"
    • gaugau.de

right above
Code: [Select]
    if ($mime_content['content']=='image') {
        if (isset($image_size['reduced'])) {
            $winsizeX = $CURRENT_PIC_DATA['pwidth'] + 16;
            $winsizeY = $CURRENT_PIC_DATA['pheight'] + 16;
            $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_title = $lang_display_image_php['view_fs'] . "\n==============\n" . $pic_title;
            $pic_html .= "<img src=\"" . $picture_url . "\" class=\"image\" border=\"0\" alt=\"{$lang_display_image_php['view_fs']}\" /><br />";
            $pic_html .= "</a>\n";
        } else {
            $pic_html = "<img src=\"" . $picture_url . "\" {$image_size['geom']} class=\"image\" border=\"0\" /><br />\n";
        }
    } elseif ($mime_content['content']=='document') {
        $pic_html = "<a href=\"{$picture_url}\" target=\"_blank\" class=\"document_link\"><img src=\"".$pic_thumb_url."\" border=\"0\" class=\"image\" /></a>\n<br />";
    } else {
            $pic_html = "<object {$image_size['whole']}><param name=\"autostart\" value=\"true\"><param name=\"src\" value=\"". $picture_url . "\"><embed {$image_size['whole']} src=\"". $picture_url . "\" autostart=\"true\"></embed></object><br />\n";
    }
Logged

willstein

  • Coppermine frequent poster
  • ***
  • Offline Offline
  • Gender: Male
  • Posts: 120
    • mansei

I must have done something wrong:

Quote
parse error. unexpected '<' on line 184

184 =
Code: [Select]
<a name="picture" id="picture" />
184-200 =

Code: [Select]
     <a name="picture" id="picture" />
    if ($mime_content['content']=='image') {
        if (isset($image_size['reduced'])) {
            $winsizeX = $CURRENT_PIC_DATA['pwidth'] + 16;
            $winsizeY = $CURRENT_PIC_DATA['pheight'] + 16;
            $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_title = $lang_display_image_php['view_fs'] . "\n==============\n" . $pic_title;
            $pic_html .= "<img src=\"" . $picture_url . "\" class=\"image\" border=\"0\" alt=\"{$lang_display_image_php['view_fs']}\" /><br />";
            $pic_html .= "</a>\n";
        } else {
            $pic_html = "<img src=\"" . $picture_url . "\" {$image_size['geom']} class=\"image\" border=\"0\" /><br />\n";
        }
    } elseif ($mime_content['content']=='document') {
        $pic_html = "<a href=\"{$picture_url}\" target=\"_blank\" class=\"document_link\"><img src=\"".$pic_thumb_url."\" border=\"0\" class=\"image\" /></a>\n<br />";
    } else {
            $pic_html = "<object {$image_size['whole']}><param name=\"autostart\" value=\"true\"><param name=\"src\" value=\"". $picture_url . "\"><embed {$image_size['whole']} src=\"". $picture_url . "\" autostart=\"true\"></embed></object><br />\n";
    }
Logged

kegobeer

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 4637
  • Beer - it does a body good!
    • The Kazebeer Family Website

You weren't meant to actually add <a name="picture" id="picture" /> at line 184 the way you did.  Remove that line and then follow the instructions earlier in this thread.
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

willstein

  • Coppermine frequent poster
  • ***
  • Offline Offline
  • Gender: Male
  • Posts: 120
    • mansei
Re: Improper location of images after hitting next button when viewing album.
« Reply #10 on: October 05, 2005, 07:34:09 pm »

I followed:
    displayimage.php
    FIND:
    Code: [Select]
            $next_tgt = "$PHP_SELF?album=$album$cat_link&pos=$next";
    Change to:
    Code: [Select]
            $next_tgt = "$PHP_SELF?album=$album$cat_link&pos=$next#picture";

    FIND:
    Code: [Select]
            $prev_tgt = "$PHP_SELF?album=$album$cat_link&pos=$prev";
    Change to:
    Code: [Select]
            $prev_tgt = "$PHP_SELF?album=$album$cat_link&pos=$prev#picture";

    FIND:
    Code: [Select]
    function html_picture_menu($id)
    {
        global $lang_display_image_php;

        return <<<EOT
         <a href="#" onClick="return MM_openBrWindow('picEditor.php?id=$id','Crop_Picture','scrollbars=yes,toolbar=no,status=yes,resizable=yes')" class="admin_menu" >{$lang_display_image_php['crop_pic']}</a> <a href="editOnePic.php?id=$id&what=picture"  class="admin_menu">{$lang_display_image_php['edit_pic']}</a> <a href="delete.php?id=$id&what=picture"  class="admin_menu" onclick="return confirm('{$lang_display_image_php['confirm_del']}'); return false; ">{$lang_display_image_php['del_pic']}</a>

    EOT;
    }
    Change to:
    Code: [Select]
    function html_picture_menu($id)
    {
        global $lang_display_image_php;

        return <<<EOT
    <a name="picture" id="picture" />
         <a href="#" onClick="return MM_openBrWindow('picEditor.php?id=$id','Crop_Picture','scrollbars=yes,toolbar=no,status=yes,resizable=yes')" class="admin_menu" >{$lang_display_image_php['crop_pic']}</a> <a href="editOnePic.php?id=$id&what=picture"  class="admin_menu">{$lang_display_image_php['edit_pic']}</a> <a href="delete.php?id=$id&what=picture"  class="admin_menu" onclick="return confirm('{$lang_display_image_php['confirm_del']}'); return false; ">{$lang_display_image_php['del_pic']}</a>

    EOT;
    }
    [/list]
    [/list]
    [/list]

    But I don't see where to enter:



      Code: [Select]
      <a name="picture" id="picture" />
      just above the image on displayimage.php
      Logged

      Joachim Müller

      • Dev Team member
      • Coppermine addict
      • ****
      • Offline Offline
      • Gender: Male
      • Posts: 47843
      • aka "GauGau"
        • gaugau.de
      Re: Improper location of images after hitting next button when viewing album.
      « Reply #11 on: October 06, 2005, 08:33:51 am »

      Of course you get a parse error - you can't add html when php code is expected. You have to add the html stuff to the output var.
      This is the code
      Code: [Select]
          $pic_html = '<a name="picture" id="picture" />';
          if ($mime_content['content']=='image') {
              if (isset($image_size['reduced'])) {
                  $winsizeX = $CURRENT_PIC_DATA['pwidth'] + 16;
                  $winsizeY = $CURRENT_PIC_DATA['pheight'] + 16;
                  $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_title = $lang_display_image_php['view_fs'] . "\n==============\n" . $pic_title;
                  $pic_html .= "<img src=\"" . $picture_url . "\" class=\"image\" border=\"0\" alt=\"{$lang_display_image_php['view_fs']}\" /><br />";
                  $pic_html .= "</a>\n";
              } else {
                  $pic_html .= "<img src=\"" . $picture_url . "\" {$image_size['geom']} class=\"image\" border=\"0\" /><br />\n";
              }
          } elseif ($mime_content['content']=='document') {
              $pic_html = "<a href=\"{$picture_url}\" target=\"_blank\" class=\"document_link\"><img src=\"".$pic_thumb_url."\" border=\"0\" class=\"image\" /></a>\n<br />";
          } else {
                  $pic_html .= "<object {$image_size['whole']}><param name=\"autostart\" value=\"true\"><param name=\"src\" value=\"". $picture_url . "\"><embed {$image_size['whole']} src=\"". $picture_url . "\" autostart=\"true\"></embed></object><br />\n";
          }
      (not tested)
      Logged

      willstein

      • Coppermine frequent poster
      • ***
      • Offline Offline
      • Gender: Male
      • Posts: 120
        • mansei
      Re: Improper location of images after hitting next button when viewing album.
      « Reply #12 on: October 06, 2005, 09:31:23 pm »

      yeah that seemed to work great!
      is it possible to also add the
      Code: [Select]
      $pic_html = '<a name="picture" id="picture" />'; for thumbnails on thumbnails.php and displayimage.php?
      Logged

      Joachim Müller

      • Dev Team member
      • Coppermine addict
      • ****
      • Offline Offline
      • Gender: Male
      • Posts: 47843
      • aka "GauGau"
        • gaugau.de
      Re: Improper location of images after hitting next button when viewing album.
      « Reply #13 on: October 07, 2005, 12:58:27 am »

      edit thumbnails.php, find
      Code: [Select]
      display_thumbnails($album, (isset($cat) ? $cat : 0), $page, $CONFIG['thumbcols'], $CONFIG['thumbrows'], true);and add before it (in a new line):
      Code: [Select]
      print '<a name="picture" id="picture" />';
      Logged

      willstein

      • Coppermine frequent poster
      • ***
      • Offline Offline
      • Gender: Male
      • Posts: 120
        • mansei
      Re: Improper location of images after hitting next button when viewing album.
      « Reply #14 on: October 07, 2005, 01:13:43 am »

      Hmm...

      the following can be found in thumbnails.php (on lines 136, and 137)
      Code: [Select]
      print '<a name="picture" id="picture" />';
      display_thumbnails($album, (isset($cat) ? $cat : 0), $page, $CONFIG['thumbcols'], $CONFIG['thumbrows'], true);

      it doesn't seem to be working.
      did I do something wrong?
      Logged

      Joachim Müller

      • Dev Team member
      • Coppermine addict
      • ****
      • Offline Offline
      • Gender: Male
      • Posts: 47843
      • aka "GauGau"
        • gaugau.de
      Re: Improper location of images after hitting next button when viewing album.
      « Reply #15 on: October 07, 2005, 01:15:05 am »

      post a link to your site.
      Logged

      willstein

      • Coppermine frequent poster
      • ***
      • Offline Offline
      • Gender: Male
      • Posts: 120
        • mansei
      Re: Improper location of images after hitting next button when viewing album.
      « Reply #16 on: October 07, 2005, 01:17:47 am »

      same as before
      « Last Edit: October 11, 2005, 07:39:33 am by lavashark.com »
      Logged

      Joachim Müller

      • Dev Team member
      • Coppermine addict
      • ****
      • Offline Offline
      • Gender: Male
      • Posts: 47843
      • aka "GauGau"
        • gaugau.de
      Re: Improper location of images after hitting next button when viewing album.
      « Reply #17 on: October 07, 2005, 01:21:25 am »

      are you sure you have uploaded the file. For testing purposes, temporarily add a line
      Code: [Select]
      die;after the line with the print statement.
      Logged

      willstein

      • Coppermine frequent poster
      • ***
      • Offline Offline
      • Gender: Male
      • Posts: 120
        • mansei
      Re: Improper location of images after hitting next button when viewing album.
      « Reply #18 on: October 07, 2005, 01:24:49 am »

      lol. yeah im sure. i just killed it.
      Logged

      Joachim Müller

      • Dev Team member
      • Coppermine addict
      • ****
      • Offline Offline
      • Gender: Male
      • Posts: 47843
      • aka "GauGau"
        • gaugau.de
      Re: Improper location of images after hitting next button when viewing album.
      « Reply #19 on: October 07, 2005, 01:43:45 am »

      taking a look at your site, I noticed the anchor is there. What's the actual question?
      Logged
      Pages: [1] 2   Go Up
       

      Page created in 0.03 seconds with 20 queries.