forum.coppermine-gallery.net

Support => cpg1.3.x Support => Older/other versions => cpg1.3 Themes/Skins/Templates => Topic started by: me_slayer on August 22, 2004, 07:27:27 am

Title: Improper location of images after hitting next button when viewing album.
Post by: me_slayer on August 22, 2004, 07:27:27 am
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
Title: Re: Improper location of images after hitting next button when viewing album.
Post by: mstralka on August 22, 2004, 04:16:29 pm
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;
}
Title: Thanks, but..
Post by: me_slayer 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  ::)

Title: Re: Improper location of images after hitting next button when viewing album.
Post by: Tranz 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.
Title: Re: Improper location of images after hitting next button when viewing album.
Post by: me_slayer on August 22, 2004, 05:55:25 pm
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.
Title: Re: Improper location of images after hitting next button when viewing album.
Post by: Tranz on August 22, 2004, 06:14:28 pm
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?
Title: Re: Improper location of images after hitting next button when viewing album.
Post by: willstein on October 05, 2005, 05:25:26 am
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?
Title: Re: Improper location of images after hitting next button when viewing album.
Post by: Joachim Müller on October 05, 2005, 06:33:27 am
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";
    }
Title: Re: Improper location of images after hitting next button when viewing album.
Post by: willstein on October 05, 2005, 06:08:48 pm
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";
    }
Title: Re: Improper location of images after hitting next button when viewing album.
Post by: kegobeer on October 05, 2005, 06:55:56 pm
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.
Title: Re: Improper location of images after hitting next button when viewing album.
Post by: willstein 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
Title: Re: Improper location of images after hitting next button when viewing album.
Post by: Joachim Müller 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)
Title: Re: Improper location of images after hitting next button when viewing album.
Post by: willstein 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?
Title: Re: Improper location of images after hitting next button when viewing album.
Post by: Joachim Müller 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" />';
Title: Re: Improper location of images after hitting next button when viewing album.
Post by: willstein 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?
Title: Re: Improper location of images after hitting next button when viewing album.
Post by: Joachim Müller on October 07, 2005, 01:15:05 am
post a link to your site.
Title: Re: Improper location of images after hitting next button when viewing album.
Post by: willstein on October 07, 2005, 01:17:47 am
same as before
Title: Re: Improper location of images after hitting next button when viewing album.
Post by: Joachim Müller 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.
Title: Re: Improper location of images after hitting next button when viewing album.
Post by: willstein on October 07, 2005, 01:24:49 am
lol. yeah im sure. i just killed it.
Title: Re: Improper location of images after hitting next button when viewing album.
Post by: Joachim Müller 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?
Title: Re: Improper location of images after hitting next button when viewing album.
Post by: willstein on October 07, 2005, 01:52:03 am
making the anchors work on the thumbnails.
Title: Re: Improper location of images after hitting next button when viewing album.
Post by: Joachim Müller on October 07, 2005, 08:15:11 am
you'd have to come up with a mod similar to the one from mstralka above: the links that send people to the thumbnail page need to have the anchor too.
Title: Re: Improper location of images after hitting next button when viewing album.
Post by: willstein on October 07, 2005, 08:47:26 pm
hmm.

following mstralka's original mod, I looked in displayimage.php along with thumbnails.php and theme.php.
all I could come up with is, on displayimage.php around line 92.

Code: [Select]
$thumb_tgt = "thumbnails.php?album=$album$cat_link&page=$page#picture";
But it hasn't worked. Any ideas?
Title: Re: Improper location of images after hitting next button when viewing album.
Post by: Joachim Müller on October 08, 2005, 07:13:47 am
there are other places as well, e.g. in include/functions.inc.php, find
Code: [Select]
$link = "<a href=\"thumbnails.php?album=".$CURRENT_ALBUM_DATA['aid']."\">".$CURRENT_ALBUM_DATA['title']."</a>";
Title: Re: Improper location of images after hitting next button when viewing album.
Post by: willstein on October 08, 2005, 06:14:41 pm
Well, after playing with that line trying to add #picture . . . I couldnt figure it out.
Then I completely tested that line, turning it into this:
Code: [Select]
$link = "<a href=\"nofile.php?noalbum=".$CURRENT_ALBUM_DATA['aid']."\">".$CURRENT_ALBUM_DATA['title']."</a>";Notice:
Code: [Select]
nofile.php?noalbum
and it had no effect on my gallery. (yes, i checked to make sure I uploaded it)

could it be somewhere else?
Title: Re: Improper location of images after hitting next button when viewing album.
Post by: willstein on October 10, 2005, 12:39:32 am
any other suggestions?
Title: Re: Improper location of images after hitting next button when viewing album.
Post by: Joachim Müller on October 10, 2005, 08:37:59 am
Code: [Select]
$link = "<a href=\"thumbnails.php?album=".$CURRENT_ALBUM_DATA['aid']."#picture\">".$CURRENT_ALBUM_DATA['title']."</a>";doesn't work as expected?
Title: Re: Improper location of images after hitting next button when viewing album.
Post by: willstein on October 10, 2005, 07:44:52 pm
I tried that in the past, and tried again recently, and it doesnt seem to change the URL. (I assume if the URL does not have #picture, then it won't output)
Is it possible that "aid" is not set?
Title: Re: Improper location of images after hitting next button when viewing album.
Post by: Stramm on October 10, 2005, 11:06:17 pm
I don't get it. What's the point in moving rating and comment box above the pic and then pacing the anchor in a way so that no one would see these page parts (in case of using prev/ next)?? Usually you scroll the page down and not up. And when I use the prev next buttons I'd like to see these buttons on the next page as well and not having to scroll up for this ??? Feels solmehow upside down
Just wondering cause this is a totally different approch of a navigation... far away from any standards
Title: Re: Improper location of images after hitting next button when viewing album.
Post by: willstein on October 11, 2005, 12:05:48 am
perhaps just personal preference.