Not signed in (Sign In)

Vanilla 1.1.10 is a product of Lussumo. More Information: Documentation, Community Support.

    • CommentAuthortorwald
    • CommentTimeAug 1st 2007
     
    Hey!
    I am using plogger gallery for my family website and it is really great!
    I got one thing that irritating me thought.
    When i am in a album and hit "Next" or "Previous" (I don't want to use the slideshow) I always get back to the top of the page, witch means I have to scroll down at all pictures to see them.
    Is it any one who can help me with my problem, how to be at the same level on the page after I have hit "Next" or "Previous"?
    Tank you!
    • CommentAuthorardamis
    • CommentTimeAug 4th 2007
     
    Eh, this is tricky. You can use javascript to scroll the visitor's browser, but I'd personally be infuriated by any web site that did that to me. The solution I prefer is to rework the layout to move the images closer to the top of the page.

    Some examples of scroll-related javascript: http://www.sitepoint.com/article/javascript-from-scratch/6

    -ardamis
  1.  
    You could use an anchor tag

    Put the tag at the top of your pictures, or wherever you want the top of the browser window to be on your page


    then modify the links to add a #pictures at the end of the link

    or add a link at the top of the page to scroll you down automagically take me to pictures
    • CommentAuthorardamis
    • CommentTimeAug 4th 2007
     
    That's easier said than done, I think. Before making the earlier post, I looked at the core files to see what it would take to implement your method, and frankly, I couldn't see how to do that. Could you post the changes required to add #pictures to the next and prev links?

    -ardamis
    • CommentAuthortorwald
    • CommentTimeAug 5th 2007 edited
     
    Posted By: ardamis
    Could you post the changes required to add #pictures to the next and prev links?

    -ardamis


    cold you please do that, thank you!
    - Torwald
  2.  
    ok if you look in themes/default/pictures.php you'll find these two lines...

    $prev_link = plogger_get_prev_picture_link();
    $next_link = plogger_get_next_picture_link();

    then if you look in plogger-functions.php you will find these two functions...

    function plogger_get_next_picture_url() {
    $image_list = $GLOBALS["image_list"];
    $row = $GLOBALS["current_picture"];
    $current_picture = array_search($row['id'],$image_list);
    $next_link = '';
    if ($current_picture < sizeof($image_list)-1)
    {
    $next_link = generate_url("picture",$image_list[$current_picture
    }
    return $next_link;
    }
    function plogger_get_prev_picture_url() {
    $image_list = $GLOBALS["image_list"];
    $row = $GLOBALS["current_picture"];
    $current_picture = array_search($row['id'],$image_list);
    $prev_link = '';
    if ($current_picture > 0) {
    $prev_link = generate_url("picture",$image_list[$current_picture
    }
    return $prev_link;
    }

    if you notice they both use the generate_url() function to create the url with the picture variable passed to it so now find generate_url() in plogger-functions.php...

    at the bottom of the function you'll see this line (line 1097 on my install)...
    return $rv;
    this line returns the link for everything in plogger you could change this line to:
    return $rv . "#picture";
    which would add the #picture on the end of every link so as soon as they got in your photo gallery it would always automatically put you where you want to be.

    or you could modify the two "picture" level links on lines 1087 and 1070
    line 1070:
    $rv = $config["baseurl"].$pic["path"].'#picture';

    line 1087:
    $rv = $config['baseurl'].'#picture?level=picture&amp;id='.$id;
    Line 1070 however is for having mod_rewrite enabled and i don't know what special stuff happens there so that may not work
    Line 1087 the #picture might have to go at the end of the link instead of before the question mark as i have above, i didn't test any of this.

    ok so once you have the link modified you need to put your anchor tag in... so go back to the top of plog-functions.php and you will see the generate_breadcrumb() function which creates the collection/album menu above the thumbnails for each level, probably a good spot to put the anchor tag.

    at the bottom of the function around line 61 change it to look like this:
    return '<div id="breadcrumb_links">'.$breadcrumbs.'<a id="#pictures"></a></div>'

    that's what i prettymuch get out of it after looking at it for about 20 min while writing this post, i haven't tested it and i don't need to use this type of setup for my page but if you're trying it out and having some problems, let me know and i'll try to help you out.
    • CommentAuthorblougou
    • CommentTimeAug 8th 2007
     
    Mike, do you plan it to add this function in plogger???

    It will be very useful....
    • CommentAuthortorwald
    • CommentTimeAug 8th 2007 edited
     
    <blockquote><cite>Posted By: jammindice</cite>
    ok so once you have the link modified you need to put your anchor tag in... so go back to the top of plog-functions.php and you will see the generate_breadcrumb() function which creates the collection/album menu above the thumbnails for each level, probably a good spot to put the anchor tag.</blockquote>

    thanks for helping.
    the thing is thought i have never used anchor tags before. am i supposed to put it at the same line as "generate_breadcrumb() function"?
    and should i call it picture?....do you think you can write oute the anchor line?

    thanks
    • CommentAuthorjammindice
    • CommentTimeAug 8th 2007 edited
     
    i did... the paragraph below it...

    here it is again:

    at the bottom of the function around line 61 change it to look like this:
    return '<div id="breadcrumb_links">'.$breadcrumbs.'<a name="pictures"></a></div>'

    although a slight error, you don't need the # sign in the anchor tag, and it's not supposed to be id but name instead... the above line should be accurate.