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
-
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
-
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;
}
-
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 ::)
-
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.
-
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.
-
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?
-
This will create an anchor tag named
<a name="picture" id="picture" />
just above the image on displayimage.php
Where might I find that?
-
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";
}
-
I must have done something wrong:
parse 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";
}
-
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.
-
I followed:
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:
<a name="picture" id="picture" />
just above the image on displayimage.php
-
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)
-
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?
-
edit thumbnails.php, find
display_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" />';
-
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?
-
post a link to your site.
-
same as before
-
are you sure you have uploaded the file. For testing purposes, temporarily add a line
die;
after the line with the print statement.
-
lol. yeah im sure. i just killed it.
-
taking a look at your site, I noticed the anchor is there. What's the actual question?
-
making the anchors work on the thumbnails.
-
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.
-
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.
$thumb_tgt = "thumbnails.php?album=$album$cat_link&page=$page#picture";
But it hasn't worked. Any ideas?
-
there are other places as well, e.g. in include/functions.inc.php, find
$link = "<a href=\"thumbnails.php?album=".$CURRENT_ALBUM_DATA['aid']."\">".$CURRENT_ALBUM_DATA['title']."</a>";
-
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:
$link = "<a href=\"nofile.php?noalbum=".$CURRENT_ALBUM_DATA['aid']."\">".$CURRENT_ALBUM_DATA['title']."</a>";
Notice:
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?
-
any other suggestions?
-
$link = "<a href=\"thumbnails.php?album=".$CURRENT_ALBUM_DATA['aid']."#picture\">".$CURRENT_ALBUM_DATA['title']."</a>";
doesn't work as expected?
-
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?
-
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
-
perhaps just personal preference.