Welcome to Geeklog, Anonymous Monday, May 06 2024 @ 05:42 pm EDT

Geeklog Forums

Adding page navigation to top of center block


Status: offline

enigmah

Forum User
Chatty
Registered: 07/22/02
Posts: 50
Where do I add the page navigation to the top of the center block in addition to the one at the bottom of the page? Question
 Quote

Status: offline

JohnVanVliet

Forum User
Full Member
Registered: 10/09/03
Posts: 161
it is in headder.thtml in the layout
but every theme uses a diff. code layout /stile (they are all diff. )
 Quote

Status: offline

enigmah

Forum User
Chatty
Registered: 07/22/02
Posts: 50
I didn't mean the menu in the header, I meant the page navigation for stories.
 Quote

Status: Banned

machinari

Forum User
Full Member
Registered: 03/22/04
Posts: 1512
the page nav function is called in index.php before the footer is called. reproduce that code immediately after the COM_siteHeader is called, or thereabouts.
Text Formatted Code
    // Print Google-like paging navigation
    if (empty($topic)) {
        $base_url = $_CONF['site_url'] . '/index.php';
        if ($newstories) {
            $base_url .= '?display=new';
        }
    } else {
        $base_url = $_CONF['site_url'] . '/index.php?topic=' . $topic;
    }
    $display .= COM_printPageNavigation($base_url,$page, $num_pages);

 

of course this code depends on some sql, etc.
hope that helps
 Quote

Status: offline

enigmah

Forum User
Chatty
Registered: 07/22/02
Posts: 50
Thanks,
This is where I added the page nav:

$num_pages = ceil ($D['count'] / $limit);


// Print Google-like paging navigation above the stories
if (empty($topic)) {
$base_url = $_CONF['site_url'] . '/index.php';
if ($newstories) {
$base_url .= '?display=new';
}
} else {
$base_url = $_CONF['site_url'] . '/index.php?topic=' . $topic;
}
$display .= COM_printPageNavigation($base_url,$page, $num_pages);


if ($nrows > 0) {
for ($x = 1; $x $A = DB_fetchArray($result);
if ($A['featured'] == 1) {
$feature = 'true';
} elseif (($x == 1) && ($_CONF['showfirstasfeatured'] == 1)) {
$feature = 'true';
$A['featured'] = 1;
}
$display .= COM_article($A,'y');
if ($A['featured'] == 1) {
$display .= PLG_showCenterblock (2, $page, $topic);
}
}



$display .= PLG_showCenterblock (3, $page, $topic); // bottom blocks

// Print Google-like paging navigation under the stories
if (empty($topic)) {
$base_url = $_CONF['site_url'] . '/index.php';
if ($newstories) {
$base_url .= '?display=new';
}
} else {
$base_url = $_CONF['site_url'] . '/index.php?topic=' . $topic;
}
$display .= COM_printPageNavigation($base_url,$page, $num_pages);
 Quote

Status: Banned

machinari

Forum User
Full Member
Registered: 03/22/04
Posts: 1512
just remember that this code relies on variables that need to be set before the code is to run. so it's not just the page nave code that needs to be copied, but some of the sql before it as well... You'll have to investigate to see exactly what needs to be done there.
 Quote

All times are EDT. The time is now 05:42 pm.

  • Normal Topic
  • Sticky Topic
  • Locked Topic
  • New Post
  • Sticky Topic W/ New Post
  • Locked Topic W/ New Post
  •  View Anonymous Posts
  •  Able to post
  •  Filtered HTML Allowed
  •  Censored Content