page contents pagination

This public forum is for user-to-user discussions of PHPMaker. Note that this is not support forum.
Post Reply
mansour
User
Posts: 321

page contents pagination

Post 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


mobhar
User
Posts: 11905

Post 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?


mansour
User
Posts: 321

Post 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


mobhar
User
Posts: 11905

Post by mobhar »

There is no such built in feature at the moment.


digitalphotoworld
User
Posts: 416
Location: Nürnberg/Germany

Post by digitalphotoworld »

Google "virtualpagination".

Read the PHPMaker help file and look for Server Events and Client Scripts.


mansour
User
Posts: 321

Post 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>&nbsp;";
		  } else {
		  $pagebody .= "<span class=\"pagenum\"><a href=\"pagesview.php?showdetail=&PageID=&page=$i\">$i</a></span>&nbsp;";
		  }
		  }
		  }
		 $this->PageContent->ViewValue = $pagebody;

thanks


mobhar
User
Posts: 11905

Post by mobhar »

Thanks for confirming us about it.


Post Reply