Here is the code I currently have working without SEO urls and you have to manually enter [PAGEBREAK] into the article text where you want it broken.
# PagedContent-- Etomite 0.6.1
# Author: Eric Barnes
# Date: 2006-05-17
# Purpose: Returns a portion of the content and pages the rest.
# Usage: [[PagedContent]]
//process the querystring//
$queryString_search = "";
if (!empty($_SERVER['QUERY_STRING']))
{
$params = explode("&", $_SERVER['QUERY_STRING']);
$newParams = array();
foreach ($params as $param)
{
$param=htmlspecialchars($param);
if (stristr($param, "page") == false)
{
array_push($newParams, $param);
}
}
if (count($newParams) != 0)
{
$queryString_search = "?" . implode("&", $newParams);
}
}
//I don't like this and I am sure there is a better way.
$currentPage=$_SERVER['PHP_SELF'] . $queryString_search;
if(!isset($id))
{
if(isset($_GET['page']) && $_GET['page'] <> 0)
{
$page=(int)$_GET['page'];
}
else
{
$page=0;
}
$id = $etomite->documentIdentifier;
$fields = "content";
$doc = $etomite->getDocument($id, $fields);
if($doc)
{
$content=spliti('\[PAGEBREAK]',$doc['content']);
$output=$content[$page];
$output.='<div class="page"> » Page ';
$array_count=count($content);
for($y=0; $y<$array_count; $y++)
{
$nextpage=$y+1;
if($page==$y)
{
$output.='<strong>'.$nextpage.'</strong> ';
}
else
{
$output.='<a href='.$currentPage.'&page='.$y.'>'.$nextpage.'</a> ';
}
}
return $output;
}
else
{
return "";
}
}
else
{
return "";
}
Edited by suzkaw, 17 May 2006 - 10:02 PM.










