appdb/include util.php
WineHQ
wineowner at wine.codeweavers.com
Fri Jul 7 12:45:23 CDT 2006
ChangeSet ID: 26337
CVSROOT: /opt/cvs-commit
Module name: appdb
Changes by: wineowner at winehq.org 2006/07/07 12:45:23
Modified files:
include : util.php
Log message:
Chris Morgan <cmorgan at alum.wpi.edu>
Fix page changing that uses display_page_range(). Switch 'page' to 'iPage' and rename variables in
display_page_range() to use our current naming convention
Patch: http://cvs.winehq.org/patch.py?id=26337
Old revision New revision Changes Path
1.66 1.67 +26 -26 appdb/include/util.php
Index: appdb/include/util.php
diff -u -p appdb/include/util.php:1.66 appdb/include/util.php:1.67
--- appdb/include/util.php:1.66 7 Jul 2006 17:45:23 -0000
+++ appdb/include/util.php 7 Jul 2006 17:45:23 -0000
@@ -709,57 +709,57 @@ function perform_search_and_output_resul
outputSearchTableForhResult($search_words, $hResult);
}
-function display_page_range($currentPage=1, $pageRange=1, $totalPages=1, $linkurl=NULL)
+function display_page_range($iCurrentPage=1, $iPageRange=1, $iTotalPages=1, $sLinkurl=NULL)
{
- if($linkurl==NULL)
+ if($sLinkurl==NULL)
{
- $linkurl = $_SERVER['PHP_SELF']."?";
+ $sLinkurl = $_SERVER['PHP_SELF']."?";
}
/* display the links to each of these pages */
- $currentPage = max(1,(min($currentPage,$totalPages)));
- $pageRange = min($pageRange,$totalPages);
+ $iCurrentPage = max(1,(min($iCurrentPage,$iTotalPages)));
+ $iPageRange = min($iPageRange,$iTotalPages);
- if($currentPage <= ceil($pageRange/2))
+ if($iCurrentPage <= ceil($iPageRange/2))
{
- $startPage = 1;
- $endPage = $pageRange;
+ $iStartPage = 1;
+ $iEndPage = $iPageRange;
} else
{
- if($currentPage + ($pageRange/2) > $totalPages)
+ if($iCurrentPage + ($iPageRange/2) > $iTotalPages)
{
- $startPage = $totalPages - $pageRange;
- $endPage = $totalPages;
+ $iStartPage = $iTotalPages - $iPageRange;
+ $iEndPage = $iTotalPages;
} else
{
- $startPage = $currentPage - floor($pageRange/2);
- $endPage = $currentPage + floor($pageRange/2);
+ $iStartPage = $iCurrentPage - floor($iPageRange/2);
+ $iEndPage = $iCurrentPage + floor($iPageRange/2);
}
}
- $startPage = max(1,$startPage);
+ $iStartPage = max(1,$iStartPage);
- if($currentPage != 1)
+ if($iCurrentPage != 1)
{
- echo "<a href='".$linkurl."&page=1'>|<</a> ";
- $previousPage = $currentPage - 1;
- echo "<a href='".$linkurl."&page=$previousPage'><</a> ";
+ echo "<a href='".$sLinkurl."&iPage=1'>|<</a> ";
+ $iPreviousPage = $iCurrentPage - 1;
+ echo "<a href='".$sLinkurl."&iPage=$iPreviousPage'><</a> ";
} else
{
echo "|< < ";
}
/* display the desired range */
- for($x = $startPage; $x <= $endPage; $x++)
+ for($iPg = $iStartPage; $iPg <= $iEndPage; $iPg++)
{
- if($x != $currentPage)
- echo "<a href='".$linkurl."&page=".$x."'>$x</a> ";
+ if($iPg != $iCurrentPage)
+ echo "<a href='".$sLinkurl."&iPage=".$iPg."'>$iPg</a> ";
else
- echo "$x ";
+ echo "$iPg ";
}
- if($currentPage < $totalPages)
+ if($iCurrentPage < $iTotalPages)
{
- $nextPage = $currentPage + 1;
- echo "<a href='".$linkurl."&page=$nextPage'>></a> ";
- echo "<a href='".$linkurl."&page=$totalPages'>>|</a> ";
+ $iNextPage = $iCurrentPage + 1;
+ echo "<a href='".$sLinkurl."&iPage=$iNextPage'>></a> ";
+ echo "<a href='".$sLinkurl."&iPage=$iTotalPages'>>|</a> ";
} else
{
echo "> >|";
More information about the wine-cvs
mailing list