when you select it from the table, store the body in a variable.
check the lenght of the variable.
if length > max_per_page or continued == true
{
-continued = true; //used to control when you are switching pages
-break the string(body) up into segments(at least take out the piece you wish to post. Would also be good to find the last space in the segment so you are not splitting words up.) something like current_page*max_per_page should get you where to start the segment.
-calculate the number of pages: length / max_per_page should work
-print segment, page numbers/links, etc
}
else
{
-print body
}
Note: When switching pages, be sure to store which article is being used, which page you wish to go to, etc. You need to pass this info around so you can retrieve it when generating the next segment.
hopefully this will give you some direction. Best of luck.