|
From: <be...@us...> - 2012-04-09 18:06:36
|
Revision: 9291
http://xoops.svn.sourceforge.net/xoops/?rev=9291&view=rev
Author: beckmi
Date: 2012-04-09 18:06:29 +0000 (Mon, 09 Apr 2012)
Log Message:
-----------
preventing division by zero in pagenav.php (timgno)
Modified Paths:
--------------
XoopsCore/branches/2.5.x/2.5.5/docs/changelog.250.txt
XoopsCore/branches/2.5.x/2.5.5/docs/lang_diff.txt
XoopsCore/branches/2.5.x/2.5.5/htdocs/class/pagenav.php
Modified: XoopsCore/branches/2.5.x/2.5.5/docs/changelog.250.txt
===================================================================
--- XoopsCore/branches/2.5.x/2.5.5/docs/changelog.250.txt 2012-04-08 17:15:11 UTC (rev 9290)
+++ XoopsCore/branches/2.5.x/2.5.5/docs/changelog.250.txt 2012-04-09 18:06:29 UTC (rev 9291)
@@ -1,6 +1,13 @@
XOOPS 2.5.x Changelog (Language changes: see: /docs/lang_diff.txt)
===============================
+2011/04/15: Version 2.5.5 Final
+===============================
+Bugfixes:
+ - preventing division by zero in pagenav.php (timgno)
+
+
+===============================
2011/03/14: Version 2.5.5 RC
===============================
Bugfixes:
Modified: XoopsCore/branches/2.5.x/2.5.5/docs/lang_diff.txt
===================================================================
--- XoopsCore/branches/2.5.x/2.5.5/docs/lang_diff.txt 2012-04-08 17:15:11 UTC (rev 9290)
+++ XoopsCore/branches/2.5.x/2.5.5/docs/lang_diff.txt 2012-04-09 18:06:29 UTC (rev 9291)
@@ -20,6 +20,9 @@
- added define("_AM_MODULEADMIN_ABOUT_AUTHOR_INFO","Author Info");
- added define("_AM_MODULEADMIN_ADMIN_FOOTER", "<div class='center smallsmall italic pad5'>This module is maintained by the <a class='tooltip' rel='external' href='http://xoops.org/' title='Visit XOOPS Community'>XOOPS Community</a></div>");
+/language/english/calendar.php
+- added define("_CAL_FORMAT","Y-m-d");
+
===============================
2011/11/17: Version 2.5.4
===============================
Modified: XoopsCore/branches/2.5.x/2.5.5/htdocs/class/pagenav.php
===================================================================
--- XoopsCore/branches/2.5.x/2.5.5/htdocs/class/pagenav.php 2012-04-08 17:15:11 UTC (rev 9290)
+++ XoopsCore/branches/2.5.x/2.5.5/htdocs/class/pagenav.php 2012-04-09 18:06:29 UTC (rev 9291)
@@ -67,35 +67,37 @@
if ($this->total <= $this->perpage) {
return $ret;
}
- $total_pages = ceil($this->total / $this->perpage);
- if ($total_pages > 1) {
- $ret .= '<div id="xo-pagenav">';
- $prev = $this->current - $this->perpage;
- if ($prev >= 0) {
- $ret .= '<a class="xo-pagarrow" href="' . $this->url . $prev . $this->extra . '"><u>«</u></a> ';
- }
- $counter = 1;
- $current_page = intval(floor(($this->current + $this->perpage) / $this->perpage));
- while ($counter <= $total_pages) {
- if ($counter == $current_page) {
- $ret .= '<strong class="xo-pagact" >(' . $counter . ')</strong> ';
- } elseif (($counter > $current_page - $offset && $counter < $current_page + $offset) || $counter == 1 || $counter == $total_pages) {
- if ($counter == $total_pages && $current_page < $total_pages - $offset) {
- $ret .= '... ';
- }
- $ret .= '<a class="xo-counterpage" href="' . $this->url . (($counter - 1) * $this->perpage) . $this->extra . '">' . $counter . '</a> ';
- if ($counter == 1 && $current_page > 1 + $offset) {
- $ret .= '... ';
- }
- }
- $counter ++;
- }
- $next = $this->current + $this->perpage;
- if ($this->total > $next) {
- $ret .= '<a class="xo-pagarrow" href="' . $this->url . $next . $this->extra . '"><u>»</u></a> ';
- }
- $ret .= '</div> ';
- }
+ if(($this->total != 0) && ($this->perpage != 0)) {
+ $total_pages = ceil($this->total / $this->perpage);
+ if ($total_pages > 1) {
+ $ret .= '<div id="xo-pagenav">';
+ $prev = $this->current - $this->perpage;
+ if ($prev >= 0) {
+ $ret .= '<a class="xo-pagarrow" href="' . $this->url . $prev . $this->extra . '"><u>«</u></a> ';
+ }
+ $counter = 1;
+ $current_page = intval(floor(($this->current + $this->perpage) / $this->perpage));
+ while ($counter <= $total_pages) {
+ if ($counter == $current_page) {
+ $ret .= '<strong class="xo-pagact" >(' . $counter . ')</strong> ';
+ } elseif (($counter > $current_page - $offset && $counter < $current_page + $offset) || $counter == 1 || $counter == $total_pages) {
+ if ($counter == $total_pages && $current_page < $total_pages - $offset) {
+ $ret .= '... ';
+ }
+ $ret .= '<a class="xo-counterpage" href="' . $this->url . (($counter - 1) * $this->perpage) . $this->extra . '">' . $counter . '</a> ';
+ if ($counter == 1 && $current_page > 1 + $offset) {
+ $ret .= '... ';
+ }
+ }
+ $counter ++;
+ }
+ $next = $this->current + $this->perpage;
+ if ($this->total > $next) {
+ $ret .= '<a class="xo-pagarrow" href="' . $this->url . $next . $this->extra . '"><u>»</u></a> ';
+ }
+ $ret .= '</div> ';
+ }
+ }
return $ret;
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|