Skip to main content
Inspiring
October 24, 2006
Question

Custom Recordset Paging

  • October 24, 2006
  • 2 replies
  • 314 views
I made a "custom" recordset paging function to allow me to put a link to
more articles.

Here is how I did it:

On my index page, I have an included page, nl_FrontPage, for newsListings,
Front Page.

I created a DW recrodset, limited to a variable on the page (4 articles).

I then manually set the page # with another variable in the page call:

on index.php:
<?php
$mcPage=0;
$mcArticles=4;
$fpStyle=1;
include("nl_FrontPage.php")
?>

Now, on my news.php page, I again include the nl_FrontPage to capture any
"front page articles" not shown on the front page. the page call looks the
same:
if(empty($_GET['mcPage'])){
$mcPage = 1;
}else{$mcPage=$_GET['mcPage'];}
//can put cookie call in here to get more articles
$mcArticle = 4;
$fpStyle = 0;
require("app/nl_FrontPage.php")


Next, I have this little function to do my recordset paging:
function create_paging_menu($a){
$b=$a;
$c=$a;
$b--;
$c++;
$d="<div class=\"menuPaging\"><a href=\"news.php?mcPage={$b}\">Previous
Page</a> <a href=\"news.php?mcPage={$c}\">Next Page</a>";
print $d;
}


Everythign works fine except for this:

When I don't have any future records to show, my menu still shows up. I can
count the articles being displayed and match that to my $mcArticle number,
and if displayed<$mcArticle, I obviously have no more articles to show, but
that still elaves a whole - how to know "if the *next* recordset paging has
any records.

Can somebody give me some direction?

Pages in question:
http://demo.mediachurch.com
http://demo.mediachurch.com/news.php


--

TIA,

Jon Parkhurst
PriivaWeb
http://priiva.net.


This topic has been closed for replies.

2 replies

Inspiring
October 25, 2006
anybody?


Inspiring
October 24, 2006
> that still elaves a whole - how to know "if the *next* recordset paging
> has any records.

that's still leaves a hole

> Pages in question:
> http://demo.mediachurch.com
> http://demo.mediachurch.com/news.php

Page sections are Church News Highlights