[geeklog-users] Prev/Next Stories

geeklog-users-admin at lists.geeklog.net geeklog-users-admin at lists.geeklog.net
Wed Apr 9 14:09:57 EDT 2003


Hey y'all (that's what they say in Texas):

Everything in GL functions extremely well with the exception of the previous/next stories links. The first page displays the first 50 stories and has the "Next Stories" ($LANG24[2]) link at the bottom which hyperlinks over to the next page. After the subsequent page is brought up (i.e., page 2), there is no "Previous Stories" ($LANG24[1]) link.

I've checked my liststories.thtml which is correct. I've not made any modifications to story.php with the exception of adding a few minor fields. The culprit must lay within this code:

   // Print prev/next page links if needed

        if (DB_count($_TABLES['stories']) > 50) {
            $prevpage = $page - 1;
            $nextpage = $page + 1;
            if ($pagestart >= 50) {
                $story_templates->set_var('previouspage_link', '<a href="' . $_CONF['site_admin_url'] . '/story.php?mode=list&page='
                    . $prevpage . '">' . $LANG24[1] . '</a> ');
            } else {
         $story_templates->set_var('previouspage_link','');
            }
            if ($pagestart <= (DB_count($_TABLES['stories']) - 50)) {
                $story_templates->set_var('nextpage_link', '<a href="' . $_CONF['site_admin_url'] . '/story.php?mode=list&page='
                    . $nextpage . '">' . $LANG24[2] . '</a> ');
            } else {
         $story_templates->set_var('nextpage_link','');
            }
        } else {
     $story_templates->set_var('previouspage_link','');
     $story_templates->set_var('nextpage_link','');
        }
           

    } else {
        // There are no news items
        $story_templates->set_var('storylist_item','<tr><td colspan="7">' . $LANG24[6] . '</td></tr>');
        $story_templates->set_var('previouspage_link','');
        $story_templates->set_var('nextpage_link','');
 
    }

First of all, I can't figure out where $pagestart comes from (I don't see it initialized anywhere). Can any of you GL deities give me a hand?

GL truly rocks,

theonomine
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://pairlist8.pair.net/pipermail/geeklog-users/attachments/20030409/ec813e66/attachment.html>


More information about the geeklog-users mailing list