kernel
[ class tree: kernel ] [ index: kernel ] [ all elements ]

Source for file list_cache.php

Documentation is available at list_cache.php

  1. <?php
  2. /**
  3.  * @version $Header: /cvsroot/bitweaver/_bit_kernel/list_cache.php,v 1.6 2006/04/11 13:05:16 squareing Exp $
  4.  * @package kernel
  5.  * @subpackage functions
  6.  */
  7.  
  8. // Copyright (c) 2002-2003, Luis Argerich, Garland Foster, Eduardo Polidor, et. al.
  9. // All Rights Reserved. See copyright.txt for details and a complete list of authors.
  10. // Licensed under the GNU LESSER GENERAL PUBLIC LICENSE. See license.txt for details.
  11.  
  12.  
  13.  
  14. /**
  15.  * required setup
  16.  */
  17. require_once'../bit_setup_inc.php' );
  18.  
  19. $gBitSystem->verifyPermission'p_admin' );
  20.  
  21. if (isset($_REQUEST["remove"])) {
  22.     $gBitSystem->remove_cache($_REQUEST["remove"]);
  23. }
  24.  
  25. if (isset($_REQUEST["refresh"])) {
  26.     $gBitSystem->refresh_cache($_REQUEST["refresh"]);
  27. }
  28.  
  29. // This script can receive the thresold
  30. // for the information as the number of
  31. // days to get in the log 1,3,4,etc
  32. // it will default to 1 recovering information for today
  33.  
  34. if empty$_REQUEST["sort_mode") ) {
  35.     $sort_mode 'url_desc';
  36. else {
  37.     $sort_mode $_REQUEST["sort_mode"];
  38. }
  39.  
  40. $gBitSmarty->assign_by_ref('sort_mode'$sort_mode);
  41.  
  42. // If offset is set use it if not then use offset =0
  43. // use the max_records php variable to set the limit
  44. // if sortMode is not set then use lastModif_desc
  45.  
  46. if (!isset($_REQUEST["offset"])) {
  47.     $offset 0;
  48. else {
  49.     $offset $_REQUEST["offset"];
  50. }
  51. if (isset($_REQUEST['page'])) {
  52.     $page &$_REQUEST['page'];
  53.     $offset ($page 1$max_records;
  54. }
  55. $gBitSmarty->assign_by_ref('offset'$offset);
  56.  
  57. if (!isset($_REQUEST["find"])) {
  58.     $find '';
  59. else {
  60.     $find $_REQUEST["find"];
  61. }
  62.  
  63. $gBitSmarty->assign('find'$find);
  64.  
  65. // Get a list of last changes to the Wiki database
  66. $listpages $gBitSystem->list_cache($offset$max_records$sort_mode$find);
  67.  
  68. // If there're more records then assign next_offset
  69. $cant_pages ceil($listpages["cant"$max_records);
  70. $gBitSmarty->assign_by_ref('cant_pages'$cant_pages);
  71. $gBitSmarty->assign('actual_page'($offset $max_records));
  72.  
  73. if ($listpages["cant"($offset $max_records)) {
  74.     $gBitSmarty->assign('next_offset'$offset $max_records);
  75. else {
  76.     $gBitSmarty->assign('next_offset'-1);
  77. }
  78.  
  79. // If offset is > 0 then prev_offset
  80. if ($offset 0{
  81.     $gBitSmarty->assign('prev_offset'$offset $max_records);
  82. else {
  83.     $gBitSmarty->assign('prev_offset'-1);
  84. }
  85.  
  86. $gBitSmarty->assign_by_ref('listpages'$listpages["data"]);
  87. //print_r($listpages["data"]);
  88. // Display the template
  89.  
  90. $gBitSystem->display'bitpackage:kernel/list_cache.tpl');
  91.  
  92. ?>

Documentation generated on Thu, 15 Feb 2007 20:43:06 +0000 by phpDocumentor 1.3.0