Improper location of images after hitting next button when viewing album. Improper location of images after hitting next button when viewing album.
 

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

Improper location of images after hitting next button when viewing album.

Started by me_slayer, August 22, 2004, 07:27:27 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

me_slayer

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

mstralka

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

<a name="picture" id="picture" />

just above the image on displayimage.php


displayimage.php
FIND:

        $next_tgt = "$PHP_SELF?album=$album$cat_link&pos=$next";

Change to:

        $next_tgt = "$PHP_SELF?album=$album$cat_link&pos=$next#picture";


FIND:

        $prev_tgt = "$PHP_SELF?album=$album$cat_link&pos=$prev";

Change to:

        $prev_tgt = "$PHP_SELF?album=$album$cat_link&pos=$prev#picture";


FIND:

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:

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;
}
GO IRISH

me_slayer

#2
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  ::)


Tranz

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.

me_slayer

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

Quote from: TranzNDance on August 22, 2004, 05:51:20 PM
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.

Tranz

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?

willstein

Quote from: mstralka on August 22, 2004, 04:16:29 PMThis will create an anchor tag named


<a name="picture" id="picture" />


just above the image on displayimage.php


Where might I find that?

Joachim Müller

right above    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";
    }

willstein

I must have done something wrong:

Quoteparse error. unexpected '<' on line 184

184 = <a name="picture" id="picture" />

184-200 =

     <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";
    }

kegobeer

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

I followed:





Quote from: mstralka on August 22, 2004, 04:16:29 PM
displayimage.php
FIND:

        $next_tgt = "$PHP_SELF?album=$album$cat_link&pos=$next";

Change to:

        $next_tgt = "$PHP_SELF?album=$album$cat_link&pos=$next#picture";


FIND:

        $prev_tgt = "$PHP_SELF?album=$album$cat_link&pos=$prev";

Change to:

        $prev_tgt = "$PHP_SELF?album=$album$cat_link&pos=$prev#picture";


FIND:

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:

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:






Quote from: mstralka on August 22, 2004, 04:16:29 PM
<a name="picture" id="picture" />

just above the image on displayimage.php

Joachim Müller

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    $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)

willstein

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

Joachim Müller

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

willstein

Hmm...

the following can be found in thumbnails.php (on lines 136, and 137)
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?

Joachim Müller


willstein

same as before

Joachim Müller

are you sure you have uploaded the file. For testing purposes, temporarily add a line die;after the line with the print statement.

willstein


Joachim Müller

taking a look at your site, I noticed the anchor is there. What's the actual question?