jayavinoth
19 May 2011, 01:10 AM
Hello friend,:confused:
If I post article more then some words , it takes two pages to display the content. Please help me to display the whole article in one page. See this: http://www.solvedhow.com/How+to+Lose+Weight-5.html
This is the coding in paging.html.
Please help me
<?php
class Lib_Paging
{
var $output=array();
var $prev;
var $next;
function Lib_Paging($model,$par,$cssstyle)
{
if($model='classic')
$this->doClassicPaging($par,$cssstyle);
if($model='default')
$this->doDefaultPaging($par,$cssstyle);
}
function doClassicPaging($par = array(),$cssstyle)
{
// print_r($par);exit;
// echo $cssstyle;exit;
if(count($par)>0)
{
if(!isset($_GET['page']))
{
$start = 1;
$end = ($par['length']>$par['totalpages'] ? $par['totalpages'] : $par['length']);
$s = 0;
for($i=$start;$i<=$end;$i++)
{
$tmp = $_SERVER['QUERY_STRING']."&page=".$i;
if($_GET['page'] == "" && $i==1)
$this->output[++$s]= '<span class="current">'.$i.'</span>';
else
$this->output[++$s]= '<a href="?'.$tmp.'" class=\''.$cssstyle.'\'>'.$i.'</a>';
}
if($par['totalpages']>$par['length'])
{
$tmp = $_SERVER['QUERY_STRING']."&page=".($start+1);
$this->next = '<a href="?'.($tmp).'" class=\''.$cssstyle.'\'>Next </a>';
}
return true;
}
else if (isset($_GET['page']))
{
$cpage = $_GET['page'];
$mid = (int) ($par['length']/2);
if($cpage > ($mid+1))
{
$start = ($cpage - $mid);
$end = $start + $par['length']-1;
}
else
{
$start = 1;
$end = ($par['length']>$par['totalpages'] ? $par['totalpages'] : $par['length']);
}
$s=0;
for($i=$start;$i<=$end;$i++)
{
$tmp = split('page',$_SERVER['QUERY_STRING']);
$q = $tmp[0]."page=".$i;
$tmp = split('&',$tmp[1]);
$q .= (strlen(trim($tmp[1]) > 0) ? '&'.$tmp[1] : '');
if($_GET['page']==$i)
$this->output[++$s] = '<span class="current">'.$i.'</span>';
else
{
if($i<=$par['totalpages'])
$this->output[++$s] = '<a href="?'.$q.' " class=\''.$cssstyle.'\'>'.$i.'</a>';
}
}
if ($_GET['page']<$par['totalpages'])
{
$tmp = split('page',$_SERVER['QUERY_STRING']);
$q = $tmp[0]."page=".($_GET['page']+1);
$tmp = split('&',$tmp[1]);
$q .= (strlen(trim($tmp[1]) > 0) ? '&'.$tmp[1] : '');
$this->next = '<a href="?'.($q).' " class=\''.$cssstyle.'\'>Next </a>';
}
if($_GET['page']>1)
{
$tmp = split('page',$_SERVER['QUERY_STRING']);
$q = $tmp[0]."page=".($_GET['page']-1);
$tmp = split('&',$tmp[1]);
$q .= (strlen(trim($tmp[1]) > 0) ? '&'.$tmp[1] : '');
$this->prev .= ' <a href="?'.($q).'" class=\''.$cssstyle.'\'>Prev</a>';
}
}
}
}
function doDefaultPaging($par = array(),$cssstyle)
{
// print_r($par);exit;
// echo $cssstyle;exit;
if(count($par)>0)
{
if(!isset($_GET['page']))
{
$start = 1;
$end = ($par['length']>$par['totalpages'] ? $par['totalpages'] : $par['length']);
$s = 0;
for($i=$start;$i<=$end;$i++)
{
$tmp = $_SERVER['QUERY_STRING']."&page=".$i;
if ($end==1) // For A Single Display Page
{
$this->output[++$s]= '';
}
else
{
if($_GET['page'] == "" && $i==1)
$this->output[++$s]= '<li class=\''.$cssstyle.' selected\'>'.$i.'</li>';
else
$this->output[++$s]= '<li class=\''.$cssstyle.'\'><a href="'.$_SESSION['ajasiteset']['sitefullpath'].'?'.$tmp.'" >'.$i.'</a></li>';
}
}
if($par['totalpages']>$par['length'])
{
$tmp = $_SERVER['QUERY_STRING']."&page=".($start+1);
$this->next = '<li><a href="'.$_SESSION['ajasiteset']['sitefullpath'].'?'.($tmp).'"><span class="view_edit_next"></span> </a></li>';
}
return true;
}
else if (isset($_GET['page']))
{
$cpage = $_GET['page'];
$mid = (int) ($par['length']/2);
if($cpage > ($mid+1))
{
$start = ($cpage - $mid);
$end = $start + $par['length']-1;
}
else
{
$start = 1;
$end = ($par['length']>$par['totalpages'] ? $par['totalpages'] : $par['length']);
}
$s=0;
for($i=$start;$i<=$end;$i++)
{
$tmp = split('page',$_SERVER['QUERY_STRING']);
$q = $tmp[0]."page=".$i;
$tmp = split('&',$tmp[1]);
$q .= (strlen(trim($tmp[1]) > 0) ? '&'.$tmp[1] : '');
if($_GET['page']==$i)
$this->output[++$s] = '<li class=\''.$cssstyle.' selected\'>'.$i.'</li>';
else
{
if($i<=$par['totalpages'])
$this->output[++$s] = '<li class=\''.$cssstyle.'\'><a href="'.$_SESSION['ajasiteset']['sitefullpath'].'?'.$q.' " >'.$i.'</a></li>';
}
}
if ($_GET['page']<$par['totalpages'])
{
$tmp = split('page',$_SERVER['QUERY_STRING']);
$q = $tmp[0]."page=".($_GET['page']+1);
$tmp = split('&',$tmp[1]);
$q .= (strlen(trim($tmp[1]) > 0) ? '&'.$tmp[1] : '');
$this->next = '<li><a href="'.$_SESSION['ajasiteset']['sitefullpath'].'?'.($q).'" ><span class="view_edit_next"></span> </a></li>';
}
if($_GET['page']>1)
{
$tmp = split('page',$_SERVER['QUERY_STRING']);
$q = $tmp[0]."page=".($_GET['page']-1);
$tmp = split('&',$tmp[1]);
$q .= (strlen(trim($tmp[1]) > 0) ? '&'.$tmp[1] : '');
$this->prev = '<li><a href="'.$_SESSION['ajasiteset']['sitefullpath'].'?'.($q).'" ><span class="view_edit_pre"></span></a></li>';
}
}
}
}
}
?>
If I post article more then some words , it takes two pages to display the content. Please help me to display the whole article in one page. See this: http://www.solvedhow.com/How+to+Lose+Weight-5.html
This is the coding in paging.html.
Please help me
<?php
class Lib_Paging
{
var $output=array();
var $prev;
var $next;
function Lib_Paging($model,$par,$cssstyle)
{
if($model='classic')
$this->doClassicPaging($par,$cssstyle);
if($model='default')
$this->doDefaultPaging($par,$cssstyle);
}
function doClassicPaging($par = array(),$cssstyle)
{
// print_r($par);exit;
// echo $cssstyle;exit;
if(count($par)>0)
{
if(!isset($_GET['page']))
{
$start = 1;
$end = ($par['length']>$par['totalpages'] ? $par['totalpages'] : $par['length']);
$s = 0;
for($i=$start;$i<=$end;$i++)
{
$tmp = $_SERVER['QUERY_STRING']."&page=".$i;
if($_GET['page'] == "" && $i==1)
$this->output[++$s]= '<span class="current">'.$i.'</span>';
else
$this->output[++$s]= '<a href="?'.$tmp.'" class=\''.$cssstyle.'\'>'.$i.'</a>';
}
if($par['totalpages']>$par['length'])
{
$tmp = $_SERVER['QUERY_STRING']."&page=".($start+1);
$this->next = '<a href="?'.($tmp).'" class=\''.$cssstyle.'\'>Next </a>';
}
return true;
}
else if (isset($_GET['page']))
{
$cpage = $_GET['page'];
$mid = (int) ($par['length']/2);
if($cpage > ($mid+1))
{
$start = ($cpage - $mid);
$end = $start + $par['length']-1;
}
else
{
$start = 1;
$end = ($par['length']>$par['totalpages'] ? $par['totalpages'] : $par['length']);
}
$s=0;
for($i=$start;$i<=$end;$i++)
{
$tmp = split('page',$_SERVER['QUERY_STRING']);
$q = $tmp[0]."page=".$i;
$tmp = split('&',$tmp[1]);
$q .= (strlen(trim($tmp[1]) > 0) ? '&'.$tmp[1] : '');
if($_GET['page']==$i)
$this->output[++$s] = '<span class="current">'.$i.'</span>';
else
{
if($i<=$par['totalpages'])
$this->output[++$s] = '<a href="?'.$q.' " class=\''.$cssstyle.'\'>'.$i.'</a>';
}
}
if ($_GET['page']<$par['totalpages'])
{
$tmp = split('page',$_SERVER['QUERY_STRING']);
$q = $tmp[0]."page=".($_GET['page']+1);
$tmp = split('&',$tmp[1]);
$q .= (strlen(trim($tmp[1]) > 0) ? '&'.$tmp[1] : '');
$this->next = '<a href="?'.($q).' " class=\''.$cssstyle.'\'>Next </a>';
}
if($_GET['page']>1)
{
$tmp = split('page',$_SERVER['QUERY_STRING']);
$q = $tmp[0]."page=".($_GET['page']-1);
$tmp = split('&',$tmp[1]);
$q .= (strlen(trim($tmp[1]) > 0) ? '&'.$tmp[1] : '');
$this->prev .= ' <a href="?'.($q).'" class=\''.$cssstyle.'\'>Prev</a>';
}
}
}
}
function doDefaultPaging($par = array(),$cssstyle)
{
// print_r($par);exit;
// echo $cssstyle;exit;
if(count($par)>0)
{
if(!isset($_GET['page']))
{
$start = 1;
$end = ($par['length']>$par['totalpages'] ? $par['totalpages'] : $par['length']);
$s = 0;
for($i=$start;$i<=$end;$i++)
{
$tmp = $_SERVER['QUERY_STRING']."&page=".$i;
if ($end==1) // For A Single Display Page
{
$this->output[++$s]= '';
}
else
{
if($_GET['page'] == "" && $i==1)
$this->output[++$s]= '<li class=\''.$cssstyle.' selected\'>'.$i.'</li>';
else
$this->output[++$s]= '<li class=\''.$cssstyle.'\'><a href="'.$_SESSION['ajasiteset']['sitefullpath'].'?'.$tmp.'" >'.$i.'</a></li>';
}
}
if($par['totalpages']>$par['length'])
{
$tmp = $_SERVER['QUERY_STRING']."&page=".($start+1);
$this->next = '<li><a href="'.$_SESSION['ajasiteset']['sitefullpath'].'?'.($tmp).'"><span class="view_edit_next"></span> </a></li>';
}
return true;
}
else if (isset($_GET['page']))
{
$cpage = $_GET['page'];
$mid = (int) ($par['length']/2);
if($cpage > ($mid+1))
{
$start = ($cpage - $mid);
$end = $start + $par['length']-1;
}
else
{
$start = 1;
$end = ($par['length']>$par['totalpages'] ? $par['totalpages'] : $par['length']);
}
$s=0;
for($i=$start;$i<=$end;$i++)
{
$tmp = split('page',$_SERVER['QUERY_STRING']);
$q = $tmp[0]."page=".$i;
$tmp = split('&',$tmp[1]);
$q .= (strlen(trim($tmp[1]) > 0) ? '&'.$tmp[1] : '');
if($_GET['page']==$i)
$this->output[++$s] = '<li class=\''.$cssstyle.' selected\'>'.$i.'</li>';
else
{
if($i<=$par['totalpages'])
$this->output[++$s] = '<li class=\''.$cssstyle.'\'><a href="'.$_SESSION['ajasiteset']['sitefullpath'].'?'.$q.' " >'.$i.'</a></li>';
}
}
if ($_GET['page']<$par['totalpages'])
{
$tmp = split('page',$_SERVER['QUERY_STRING']);
$q = $tmp[0]."page=".($_GET['page']+1);
$tmp = split('&',$tmp[1]);
$q .= (strlen(trim($tmp[1]) > 0) ? '&'.$tmp[1] : '');
$this->next = '<li><a href="'.$_SESSION['ajasiteset']['sitefullpath'].'?'.($q).'" ><span class="view_edit_next"></span> </a></li>';
}
if($_GET['page']>1)
{
$tmp = split('page',$_SERVER['QUERY_STRING']);
$q = $tmp[0]."page=".($_GET['page']-1);
$tmp = split('&',$tmp[1]);
$q .= (strlen(trim($tmp[1]) > 0) ? '&'.$tmp[1] : '');
$this->prev = '<li><a href="'.$_SESSION['ajasiteset']['sitefullpath'].'?'.($q).'" ><span class="view_edit_pre"></span></a></li>';
}
}
}
}
}
?>