Page 1 of 1
page contents pagination
Posted: Mon Sep 09, 2013 12:21 pm
by mansour
Hi,
I have a table for my dynamic pages! this table has a field named PageContent (long text)! I use [--pagebreak--] tag during data entry! how may i split the page content using this tag?
typically i can use explode to do that!
please post your sample code !
Regards
Mansour
Re: page contents pagination
Posted: Tue Sep 10, 2013 11:04 am
by mobhar
Not sure what you want. Moreover you said that you have tried it using php explode() function.
So, what is the actual goal that you want to achieve regarding it?
Re: page contents pagination
Posted: Wed Sep 11, 2013 1:49 pm
by mansour
Hi,
i need to split the page content to multiple page (very long text). So, i can post articles and so on.
Any suggestion?
Regards
Mansour
Re: page contents pagination
Posted: Wed Sep 11, 2013 5:59 pm
by mobhar
There is no such built in feature at the moment.
Re: page contents pagination
Posted: Wed Sep 11, 2013 9:45 pm
by digitalphotoworld
Google "virtualpagination".
Read the PHPMaker help file and look for Server Events and Client Scripts.
Re: page contents pagination (Fixed)
Posted: Mon Sep 16, 2013 12:45 am
by mansour
Hi,
i used "Row_Rendered" server event and my problem fixed. i used "[--pagebreak--]" as my split tag. complete code for my pagination:
if ($_GET["page"] == ""){
$page = 0;
} else {
$page = @$_GET["page"];
}
$contentpages = explode( "[--pagebreak--]", $this->PageContent->CurrentValue);
$pageno = count($contentpages);
if ( $page == "" || $page < 1 )
$page = 1;
if ( $page > $pageno )
$page = $pageno;
$arrayelement = (int)$page;
$arrayelement --;
$pagebody = "$contentpages[$arrayelement]";
$pagebody .= "<br/>";
if ($pageno > 1) {
for($i = 1; $i <= $pageno; $i++){
if(($page) == $i){
$pagebody .= "<span class=\"pagenumstatic\">$i</span> ";
} else {
$pagebody .= "<span class=\"pagenum\"><a href=\"pagesview.php?showdetail=&PageID=&page=$i\">$i</a></span> ";
}
}
}
$this->PageContent->ViewValue = $pagebody;
thanks
Re: page contents pagination
Posted: Mon Sep 16, 2013 9:12 am
by mobhar
Thanks for confirming us about it.