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

Source for file slideshow.php

Documentation is available at slideshow.php

  1. <?php
  2. /**
  3.  * $Header: /cvsroot/bitweaver/_bit_wiki/slideshow.php,v 1.13 2006/04/30 17:43:38 squareing Exp $
  4.  *
  5.  * Copyright (c) 2004 bitweaver.org
  6.  * Copyright (c) 2003 tikwiki.org
  7.  * Copyright (c) 2002-2003, Luis Argerich, Garland Foster, Eduardo Polidor, et. al.
  8.  * All Rights Reserved. See copyright.txt for details and a complete list of authors.
  9.  * Licensed under the GNU LESSER GENERAL PUBLIC LICENSE. See license.txt for details
  10.  *
  11.  * $Id: slideshow.php,v 1.13 2006/04/30 17:43:38 squareing Exp $
  12.  * @package wiki
  13.  * @subpackage functions
  14.  */
  15.  
  16. /**
  17.  * required setup
  18.  */
  19. require_once'../bit_setup_inc.php' );
  20.  
  21. require_once'BitPage.php' );
  22.  
  23.  
  24. $gBitSystem->verifyPackage'wiki' );
  25. //print($GLOBALS["HTTP_REFERER"]);
  26.  
  27. if (!isset($_SESSION["thedate"])) {
  28.     $thedate $gBitSystem->getUTCTime();
  29. else {
  30.     $thedate $_SESSION["thedate"];
  31. }
  32.  
  33. require_once WIKI_PKG_PATH.'lookup_page_inc.php' );
  34. require_once WIKI_PKG_PATH.'page_setup_inc.php' );
  35. // If the page doesn't exist then display an error
  36. if (!$gContent->isValid()) {
  37.     $gBitSmarty->assign('msg'tra("Page cannot be found"));
  38.  
  39.     $gBitSystem->display'error.tpl' );
  40.     die;
  41. }
  42.  
  43. // Now check permissions to access this page
  44. if (!$gBitUser->hasPermission'p_wiki_view_page' )) {
  45.     $gBitSmarty->assign('msg'tra("Permission denied you cannot view this page"));
  46.  
  47.     $gBitSystem->display'error.tpl' );
  48.     die;
  49. }
  50.  
  51. // BreadCrumbNavigation here
  52. // Get the number of pages from the default or userPreferences
  53. // Remember to reverse the array when posting the array
  54.  
  55. $anonpref $wikilib->getPreference('users_bread_crumb'4);
  56.  
  57. if$gBitUser->isRegistered() ) {
  58.     $users_bread_crumb $wikilib->getPreference('users_bread_crumb'$anonpref$user );
  59. else {
  60.     $users_bread_crumb $anonpref;
  61. }
  62.  
  63. ifempty$_SESSION["breadCrumb") ) {
  64.     $_SESSION["breadCrumb"array();
  65. }
  66.  
  67. if!in_array($page$_SESSION["breadCrumb"])) {
  68.     if (count($_SESSION["breadCrumb"]$users_bread_crumb{
  69.         array_shift ($_SESSION["breadCrumb"]);
  70.     }
  71.  
  72.     array_push($_SESSION["breadCrumb"]$page);
  73. else {
  74.     // If the page is in the array move to the last position
  75.     $pos array_search($page$_SESSION["breadCrumb"]);
  76.  
  77.     unset ($_SESSION["breadCrumb"][$pos]);
  78.     array_push($_SESSION["breadCrumb"]$page);
  79. }
  80.  
  81. // Get page data
  82. includeWIKI_PKG_PATH.'lookup_page_inc.php' );
  83. $info $gContent->mInfo;
  84.  
  85. // Verify lock status
  86. if ($info["flag"== 'L'{
  87.     $gBitSmarty->assign('lock'true);
  88. else {
  89.     $gBitSmarty->assign('lock'false);
  90. }
  91.  
  92. // If not locked and last version is user version then can undo
  93. $gBitSmarty->assign('canundo''n');
  94.  
  95. if ($info["flag"!= 'L' && (($gBitUser->hasPermission'p_wiki_edit_page' && $info["user"== $user|| ($gBitUser->hasPermission'p_wiki_remove_page' )))) {
  96.     $gBitSmarty->assign('canundo''y');
  97. }
  98.  
  99. if ($gBitUser->hasPermission'p_wiki_admin' )) {
  100.     $gBitSmarty->assign('canundo''y');
  101. }
  102.  
  103. //Now process the pages
  104. preg_match_all("/-=([^=]+)=-/"$info["data"]$reqs);
  105. $slides split("-=[^=]+=-"$info["data"]);
  106.  
  107. if (count($slides2{
  108.     $slides explode(defined('PAGE_SEP'PAGE_SEP "...page..."$info["data"]);
  109.  
  110.     array_unshift($slides'');
  111. }
  112.  
  113. if (!isset($_REQUEST["slide"])) {
  114.     $_REQUEST["slide"0;
  115. }
  116.  
  117. $gBitSmarty->assign('prev_slide'$_REQUEST["slide"1);
  118. $gBitSmarty->assign('next_slide'$_REQUEST["slide"1);
  119.  
  120. if (isset($reqs[1][$_REQUEST["slide"]])) {
  121.     $slide_title $reqs[1][$_REQUEST["slide"]];
  122. else {
  123.     $slide_title '';
  124. }
  125.  
  126. $slide_data $gContent->parseData$slides[$_REQUEST["slide"1);
  127.  
  128. if (isset($reqs[1][$_REQUEST["slide"1])) {
  129.     $slide_prev_title $reqs[1][$_REQUEST["slide"1];
  130. else {
  131.     $slide_prev_title 'prev';
  132. }
  133.  
  134. if (isset($reqs[1][$_REQUEST["slide"1])) {
  135.     $slide_next_title $reqs[1][$_REQUEST["slide"1];
  136. else {
  137.     $slide_next_title 'next';
  138. }
  139.  
  140. $gBitSmarty->assign('slide_prev_title'$slide_prev_title);
  141. $gBitSmarty->assign('slide_next_title'$slide_next_title);
  142.  
  143. $gBitSmarty->assign('slide_title'$slide_title);
  144. $gBitSmarty->assign('slide_data'$slide_data);
  145.  
  146. $total_slides count($slides1;
  147. $current_slide $_REQUEST["slide"1;
  148. $gBitSmarty->assign('total_slides'$total_slides);
  149. $gBitSmarty->assign('current_slide'$current_slide);
  150.  
  151. //$gBitSmarty->assign_by_ref('last_modified',date("l d of F, Y  [H:i:s]",$info["last_modified"]));
  152. $gBitSmarty->assign_by_ref('last_modified'$info["last_modified"]);
  153.  
  154. if (empty($info["user"])) {
  155.     $info["user"'anonymous';
  156. }
  157.  
  158. $gBitSmarty->assign_by_ref('lastUser'$info["user"]);
  159. $gBitSmarty->display("bitpackage:wiki/slideshow.tpl");
  160. ?>

Documentation generated on Thu, 15 Feb 2007 20:48:46 +0000 by phpDocumentor 1.3.0