Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
0

Custom Recordset Paging

LEGEND ,
Oct 24, 2006 Oct 24, 2006

Copy link to clipboard

Copied

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.


TOPICS
Server side applications

Views

292
Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Oct 24, 2006 Oct 24, 2006

Copy link to clipboard

Copied

> 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


Votes

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Oct 25, 2006 Oct 25, 2006

Copy link to clipboard

Copied

LATEST
anybody?


Votes

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines