#139 Can´t go to page 2

open
nobody
None
5
2011-01-24
2011-01-24
Tobias Engisch
No

Hi, I have a problem with the new Scuttle 0.9.0
When I try to click "next" to go from the index page (not logged in) to the second page,
it doesn´t works and nothing happens.

Discussion

1 2 > >> (Page 1 of 2)
  • Jason Coleman
    Jason Coleman
    2011-01-31

    I get the same problem. Any page I try to navigate to from index.php ends up showing me the bookmarks from the first page over again, though the address bar updates correctly (i.e., "http://mysite.org/index.php/?page=2").

    If I log in then I automatically land on bookmarks.php, which performs paging correctly so long as I stay on bookmarks.php. If I return to index.php then paging doesn't work whether or not I'm logged in.

     
  • Engin S
    Engin S
    2011-02-16

    Same problem.

     
  • JP
    JP
    2011-02-19

    In index.php make the following changes:

    replace:
    $tplVars['page'] = 0;
    $tplVars['start'] = 0;

    with:
    if (isset($_GET['page']) && intval($_GET['page']) > 1) {
    $tplVars['page'] = $_GET['page'];
    $tplVars['start'] = ($tplVars['page'] - 1) * $perpage;
    } else {
    $tplVars['page'] = 0;
    $tplVars['start'] = 0;
    }

    and replace:
    $bookmarks =& $bookmarkservice->getBookmarks(0, $perpage, NULL, NULL, NULL, getSortOrder(), NULL);

    with
    $bookmarks =& $bookmarkservice->getBookmarks($tplVars['start'], $perpage, NULL, NULL, NULL, getSortOrder(), NULL);

    Hope this helps,

    JP

     
  • Engin S
    Engin S
    2011-02-19

    @ jphendrix
    Thank you so much. It works now :)

     
  • Engin S
    Engin S
    2011-02-19

    Sorry form my 2011-02-19 18:23:32 EET comment.. When i logged out it doesnt work :(

     
  • Engin S
    Engin S
    2011-02-19

    Ok finally. Here is solution. Make this your index.php
    http://pastebin.com/pLbZ3FHQ
    Tested with logged in and logged out, and it works.

     
  • JP
    JP
    2011-02-19

    @engin1984
    Thanks for your feedback!
    I wasn't able to reproduce your last problem, but I probably misunderstood what you meant. It seems though you fixed it yourself and I took the liberty to make the changes you proposed into my local version too.
    Great team work :o)

     
  • JP
    JP
    2011-02-19

    Oh. Allow me to add a diff on the distribution version and engin1984's version of index.php. Files on pastebin.com tend to disappear after a while and future readers of this thread might be just as curious as we are how to solve this issue. We should patch svn or make a proper patch from this, but I have no idea how that's done. I think this diff output is second best.

    $ diff index.php.dist index.php
    54,55c54,68
    < $tplVars['page'] = 0;
    < $tplVars['start'] = 0;
    ---
    > // https://sourceforge.net/tracker/?func=detail&aid=3164582&group_id=134378&atid=729860
    > // pagination problem fix -starts
    > $perpage = getPerPageCount();
    > if (isset($_GET['page']) && intval($_GET['page']) > 1) {
    > $page = $_GET['page'];
    > $start = ($page - 1) * $perpage;
    > } else {
    > $page = 0;
    > $start = 0;
    > }
    >
    > $tplVars['page'] = $page;
    > $tplVars['start'] = $start;
    > // pagination problem fix -ends
    >
    62c75,78
    < $bookmarks =& $bookmarkservice->getBookmarks(0, $perpage, NULL, NULL, NULL, getSortOrder(), NULL);
    ---
    > // https://sourceforge.net/tracker/?func=detail&aid=3164582&group_id=134378&atid=729860
    > // pagination problem fix -starts
    > $bookmarks =& $bookmarkservice->getBookmarks($tplVars['start'], $perpage,NULL, NULL, NULL, getSortOrder(), NULL);
    > // pagination problem fix -ends

     
  • JP
    JP
    2011-02-19

    @engin1984: This is a different bug, open a different ticket for it. Include more details on how this issue can be reproduced.

    Kind regards,

    JP

     
1 2 > >> (Page 1 of 2)