Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Code for dynamic e- publishing over multiple web "pages"

Status
Not open for further replies.

rockyroad

Programmer
Feb 22, 2003
191
US
Hello

I am looking to build or to integrate code that would allow a user to do the following... the user, through an administration screen, could enter long, long text, an essay that would span multiple pages if printed... store that text in DB, and then query on the DB to present the essay to browser... the catch being that the system could dynamically break the essay to span across several web "pages"... such that the user would see a (pg 1 - 2 - 4 ) navigation and/or a "Next >>" at the bottom of each "page". Anyone have ideas on how this might be accomplished with CF or some other technology, or if there are existing apps to integrate with to accomplish this?

Any help would be much appreciated. Thanks :)
 
There are a lot of varibles here, the most important being how many characters fit on a typical "page". You can use string manipulation functions to break the text up into these page chunks.

The best approach, I think, is to do the manipulation in the DB. Here's a stab-in-the-dark procedural approach:

1. Determine the chunk size.
2. Determine the article length.
3. While the chunk upper position is less than or equal to the article length, construct and execute a series of UNION queries, returning a serial number and the current chunk of text from the article field. This will produce a recordset that contains the page number and the text for that page.
4. Pop the query results into memory and call the record by requested page number.

Phil Hegedusich
Senior Programmer/Analyst
IIMAK
-----------
I'll have the roast duck with the mango salsa.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top