[thelist] multiple page articles on a site

Tom Dell'Aringa pixelmech at yahoo.com
Thu Aug 1 14:20:01 CDT 2002


--- Simon Willison <simon at incutio.com> wrote:
> At 12:08 01/08/2002 -0700, Tom Dell'Aringa wrote:
> >I've written an article I wanted to post to my site (and maybe to
> the
> >evolt site if I can shore it up). Its not super long, but its
> long.
> >(Hows that for relative?!). Anyway, I personally don't necessarily
> >mind a really long browser page with an article. But some people
> do.
> >
> >My site is php based, and I do have a mySQL db (which I have never
> >used.) Is there a "quick and dirty" way to set up a multiple page
> >article? I don't have any type of CMS I can use for it right now.
>
> It depends how quick and dirty you want to go. My solution has
> always been
> to have a custom tag which I insert wherever a page break is
> required - for
> example <!--pagebreak-->
>
> You can then retrieve the entire article text from the database and
> do this:
>
> $pages = explode('<!--pagebreak-->', $articleText);
>
> $pages will then be an array of pages for your article. If
> $pageNumber is
> the number of the page you want to display (starting at zero
> because we're
> geeks) just use the following line to display the page:
>
> echo $pages[$pageNumber];
>
> You can compare the pageNumber to the number of items in the $pages
> array
> to see if a "next page" link needs to be provided.
>
> Hope that helps,
>
> Simon

Thats a pretty nice solution. I just might try that! Thanks Simon.

Tom

=====
var me = tom.pixelmech.webDeveloper();

http://www.pixelmech.com/
http://www.maccaws.com/
[Making A Commercial Case for Adopting Web Standards]

__________________________________________________
Do You Yahoo!?
Yahoo! Health - Feel better, live better
http://health.yahoo.com



More information about the thelist mailing list