hi all i have recently purchased a script and im attempting to fix it would anyone know how to solve these 2 errors which appear to be coming from this function
[09-Jun-2018 12:40:57 UTC] PHP Warning: Division by zero in /home/public_html/includes/functions.php on line 126
[09-Jun-2018 12:41:19 UTC] PHP Fatal error: Maximum execution time of 30 seconds exceeded in /home/public_html/includes/functions.php on line 135
if(!function_exists('Pagination')){
function Pagination($config=array()){
if($_SESSION['lang']=='L1'){
$firstpage = 'First';
$lastpage = 'Last';
}
else{
{
$firstpage = 'Trang đầu';
$lastpage = 'Trang cuối';
}
}
$output = '';
////FIRST ERROR $rs_maxpage = $config['js_numrows_page']>0?ceil($config['js_numrows_page']/$config['per_page']):0;
$eitherside = ($config['showeachside'] * $config['per_page']);
$paga = (strpos($config['cururl'], '?')!==false)?'&p=':'?p=';
if($rs_maxpage>1){
if($config['rs_start']+1 > $eitherside){
$page = $config['curpage'] - 1;
$output .= '<a href="'.$config['cururl'].'"><i>'.$firstpage.'</i></a> <a href="'.$config['cururl'].$paga.$page.'"><i><<</i></a> . . . ';
}
$pg=1;
////SECOND ERROR for($y=0; $y<$config['js_numrows_page']; $y+=$config['per_page']){
if(($y > ($config['rs_start'] - $eitherside)) && ($y < ($config['rs_start'] + $eitherside)))
$output .= ($pg==$config['curpage'])?'<b> '.$pg.'</b>':' <a href="'.$config['cururl'].$paga.$pg.'">'.$pg.'</a>';
$pg++;
}
if(($config['rs_start']+$eitherside)<$config['js_numrows_page']){
$page = $config['curpage'] + 1;
$output .= ' . . . <a href="'.$config['cururl'].$paga.$page.'"><i>>></i></a> <a href="'.$config['cururl'].$paga.$rs_maxpage.'"><i>'.$lastpage.'</i></a>';
}
}
return $output;
}
}
Any help would be much appreciated ty jan x