<a href=demo.phps>source code</a><br>
<? require "StoryPager.lib"; $pager=new StoryPager; ?>
<? if (!$content) { ?>
<form method=POST>
target_nop:<br><input name=target_nop><br>
optimum_pl:<br><input name=optimum_pl><br>
even_paging: <input type=checkbox name=even_paging><br>
text:<br>
<textarea name=content rows=20 cols=80></textarea><br>
<input type=submit>
</form>
<? } else { ?>
<?
if ($target_nop) $pager->target_nop($target_nop);
if ($optimum_pl) $pager->optimum_pl($optimum_pl);
$pager->even_paging($even_paging ? 1:0);
$pager->split($content);
foreach ($pager->pages as $page) {
echo "<p>page ", ++$i, ", length = ", strlen($page), "<hr>";
echo $page;
}
} ?>
|