Bluehost.com Web Hosting $6.95

RE: [PHP] splitting content into pages

This is a discussion on RE: [PHP] splitting content into pages within the PHP General forums, part of the PHP Programming Forums category; daniel@electroteque.org <mailto:daniel@electroteque.org> on Wednesday, July 30, 2003 6:35 PM said: > hi ...


Go Back   Usenet Forums > PHP Programming Forums > PHP General

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 07-31-2003
Chris W. Parker
 
Posts: n/a
Default RE: [PHP] splitting content into pages

daniel@electroteque.org <mailto:daniel@electroteque.org>
on Wednesday, July 30, 2003 6:35 PM said:

> hi there , i have an issue trying to split content into pages , we
> have a popup with content and a background image with a set height ,
> when there is more content the background repeats , theoretically i'd
> want to split the content into pages after a given length or line
> length or where it meets the background image height how can i do
> this ?


This can be easy.

1. Make sure the content does not adjust itself based on the size of the
browser window. That is to say that the space that contains the content
should be a fixed width.

2. Then you need to calculate how many words you can legitimately fit
into this fixed space without going over.

If you 150 words will fit in the space but go right up to the very edge
and are almost spilling into a new "page" you should pull the number of
words back to 120 or something to try and make sure that the text will
not spill over.

You can be more precise if you use a fixed width font like Courier New.
If you use a variable width font (not sure if that is the technical
term) you'll have to do a little more guessing because 10 i's are not
the same width as 10 w's.


hth,
chris.

p.s. There is no space before a comma!
Reply With Quote
  #2 (permalink)  
Old 07-31-2003
daniel@electroteque.org
 
Posts: n/a
Default RE: [PHP] splitting content into pages

ok let me explain , its straight up text content from the database , say
its scrolls for ages , i need to split it into pages , so i get the length
of the string up to the last paragraph which fits i need to split it there
any idea ?

> daniel@electroteque.org <mailto:daniel@electroteque.org>
> on Wednesday, July 30, 2003 6:35 PM said:
>
>> hi there , i have an issue trying to split content into pages , we
>> have a popup with content and a background image with a set height ,
>> when there is more content the background repeats , theoretically i'd
>> want to split the content into pages after a given length or line
>> length or where it meets the background image height how can i do this
>> ?

>
> This can be easy.
>
> 1. Make sure the content does not adjust itself based on the size of
> the browser window. That is to say that the space that contains the
> content should be a fixed width.
>
> 2. Then you need to calculate how many words you can legitimately fit
> into this fixed space without going over.
>
> If you 150 words will fit in the space but go right up to the very edge
> and are almost spilling into a new "page" you should pull the number of
> words back to 120 or something to try and make sure that the text will
> not spill over.
>
> You can be more precise if you use a fixed width font like Courier New.
> If you use a variable width font (not sure if that is the technical
> term) you'll have to do a little more guessing because 10 i's are not
> the same width as 10 w's.
>
>
> hth,
> chris.
>
> p.s. There is no space before a comma!




Reply With Quote
  #3 (permalink)  
Old 07-31-2003
daniel@electroteque.org
 
Posts: n/a
Default RE: [PHP] splitting content into pages

maybe somehow with a substr function that gets the position of the last
paragraph ??

> ok let me explain , its straight up text content from the database ,
> say its scrolls for ages , i need to split it into pages , so i get the
> length of the string up to the last paragraph which fits i need to
> split it there any idea ?
>
>> daniel@electroteque.org <mailto:daniel@electroteque.org>
>> on Wednesday, July 30, 2003 6:35 PM said:
>>
>>> hi there , i have an issue trying to split content into pages , we
>>> have a popup with content and a background image with a set height ,
>>> when there is more content the background repeats , theoretically i'd
>>> want to split the content into pages after a given length or line
>>> length or where it meets the background image height how can i do
>>> this ?

>>
>> This can be easy.
>>
>> 1. Make sure the content does not adjust itself based on the size of
>> the browser window. That is to say that the space that contains the
>> content should be a fixed width.
>>
>> 2. Then you need to calculate how many words you can legitimately fit
>> into this fixed space without going over.
>>
>> If you 150 words will fit in the space but go right up to the very
>> edge and are almost spilling into a new "page" you should pull the
>> number of words back to 120 or something to try and make sure that the
>> text will not spill over.
>>
>> You can be more precise if you use a fixed width font like Courier
>> New. If you use a variable width font (not sure if that is the
>> technical term) you'll have to do a little more guessing because 10
>> i's are not the same width as 10 w's.
>>
>>
>> hth,
>> chris.
>>
>> p.s. There is no space before a comma!

>
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php




Reply With Quote
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT +1. The time now is 12:08 AM.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0