function makepagenav($start,$count,$total,$range=0,$link=""){
global $locale;
if ($link == "") $link = FUSION_SELF."?";
$res="";
[color=red]$pg_cnt=ceil($total / $count);[/color]
if ($pg_cnt > 1) {
$idx_back = $start - $count;
$idx_next = $start + $count;
$cur_page=ceil(($start + 1) / $count);
$res.="<table cellspacing='1' cellpadding='1' border='0' class='tbl-border'>\n<tr>\n";
$res.="<td class='tbl2'><span class='small'>".$locale['052']."$cur_page".$locale['053']."$pg_cnt</span></td>\n";
if ($idx_back >= 0) {
if ($cur_page > ($range + 1)) $res.="<td class='tbl2'><a class='small' href='$link"."rowstart=0'><<</a></td>\n";
$res.="<td class='tbl2'><a class='small' href='$link"."rowstart=$idx_back'><</a></td>\n";
}
$idx_fst=max($cur_page - $range, 1);
$idx_lst=min($cur_page + $range, $pg_cnt);
if ($range==0) {
$idx_fst = 1;
$idx_lst=$pg_cnt;
}
for($i=$idx_fst;$i<=$idx_lst;$i++) {
$offset_page=($i - 1) * $count;
if ($i==$cur_page) {
$res.="<td class='tbl1'><span class='small'><b>$i</b></span></td>\n";
} else {
$res.="<td class='tbl1'><a class='small' href='$link"."rowstart=$offset_page'>$i</a></td>\n";
}
}
if ($idx_next < $total) {
$res.="<td class='tbl2'><a class='small' href='$link"."rowstart=$idx_next'>></a></td>\n";
if ($cur_page < ($pg_cnt - $range)) $res.="<td class='tbl2'><a class='small' href='$link"."rowstart=".($pg_cnt-1)*$count."'>>></a></td>\n";
}
$res.="</tr>\n</table>\n";
}
return $res;
}
Quote
Foto albumai
You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 3You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 3
Warning: Division by zero in /home/phpfusion/domains/php-fusion.lt/public_html/maincore.php on line 528
Quote
You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 3You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 3
Quote
Warning: Division by zero in /home/phpfusion/domains/php-fusion.lt/public_html/maincore.php on line 528
Quote
You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 3You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 3
Quote
riomas wrote:Quote
You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 3You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 3
Quote
TammyK wrote:
It's still something that should be protected against.
Adding:Code Download source
if(empty($count)) return;
Directly above:Code Download source
$pg_cnt=ceil($total / $count);
should keep the function from throwing that error.
Quote
Warning: Division by zero in /home/googleci/public_html/maincore.php on line
Quote
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 3You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 3
Category Forum
Bugs and Errors - 6Labels
None yet
Statistics
0 participants
Notifications
You are not receiving notifications from this thread.
Related Questions