diff options
| author | Max Kremmel <xing@synapse.plus.com> | 2007-06-01 16:01:33 +0000 |
|---|---|---|
| committer | Max Kremmel <xing@synapse.plus.com> | 2007-06-01 16:01:33 +0000 |
| commit | 73811143a0a5d08387b7b41b94aeb34439e426a5 (patch) | |
| tree | 256b63b90aa266f566a8c5b9eaec5177717c6bbf | |
| parent | a33a85c5e34f4a02f4cd7cdaab87056b4412c86d (diff) | |
| download | wiki-73811143a0a5d08387b7b41b94aeb34439e426a5.tar.gz wiki-73811143a0a5d08387b7b41b94aeb34439e426a5.tar.bz2 wiki-73811143a0a5d08387b7b41b94aeb34439e426a5.zip | |
clean up more stuff and finally get rid of wikilib and only create class where needed - wikilib is down to 4 or 5 functions now
| -rw-r--r-- | BitPage.php | 255 | ||||
| -rw-r--r-- | backlinks.php | 15 | ||||
| -rw-r--r-- | display_bitpage_inc.php | 10 | ||||
| -rw-r--r-- | like_pages.php | 12 | ||||
| -rw-r--r-- | modules/mod_comm_received_objects.php | 6 | ||||
| -rw-r--r-- | received_pages.php | 7 | ||||
| -rwxr-xr-x | slideshow.php | 12 | ||||
| -rw-r--r-- | wiki_graph.php | 7 |
8 files changed, 82 insertions, 242 deletions
diff --git a/BitPage.php b/BitPage.php index 79848a3..85e7c53 100644 --- a/BitPage.php +++ b/BitPage.php @@ -1,11 +1,11 @@ <?php /** - * @version $Header: /cvsroot/bitweaver/_bit_wiki/BitPage.php,v 1.86 2007/06/01 15:16:48 squareing Exp $ + * @version $Header: /cvsroot/bitweaver/_bit_wiki/BitPage.php,v 1.87 2007/06/01 16:01:29 squareing Exp $ * @package wiki * * @author spider <spider@steelsun.com> * - * @version $Revision: 1.86 $ $Date: 2007/06/01 15:16:48 $ $Author: squareing $ + * @version $Revision: 1.87 $ $Date: 2007/06/01 16:01:29 $ $Author: squareing $ * * Copyright (c) 2004 bitweaver.org * Copyright (c) 2003 tikwiki.org @@ -13,7 +13,7 @@ * All Rights Reserved. See copyright.txt for details and a complete list of authors. * Licensed under the GNU LESSER GENERAL PUBLIC LICENSE. See license.txt for details * - * $Id: BitPage.php,v 1.86 2007/06/01 15:16:48 squareing Exp $ + * $Id: BitPage.php,v 1.87 2007/06/01 16:01:29 squareing Exp $ */ /** @@ -249,15 +249,7 @@ class BitPage extends LibertyAttachable { } } } - -/* } elseif( !empty( $pParamHash['page'] ) && !empty( $pParamHash['newpage'] ) && ( $pParamHash['page'] != $pParamHash['newpage'] ) ) { - // check for rename, and rename it now if we can - if ($this->wiki_rename_page( $pParamHash['page'], $pParamHash['newpage'])) { - $pParamHash['page'] = $pParamHash['newpage']; - } else { - $this->mErrors['page'] = 'Page "'.$pParamHash['newpage'].'" already exists, it could not be renamed'; - } -*/ } + } if( empty( $pParamHash['edit_comment'] ) ) { $pParamHash['page_store']['edit_comment'] = NULL; @@ -732,95 +724,30 @@ class BitPage extends LibertyAttachable { $this->mDb->query( $query, $bindVars); return true; } -} - -define('PLUGINS_DIR', WIKI_PKG_PATH.'plugins'); -/** - * @package wiki - */ -class WikiLib extends BitPage { - function WikiLib() { - BitPage::BitPage(); - } - - // 29-Jun-2003, by zaufi - // The 2 functions below contain duplicate code - // to remove <PRE> tags... (moreover I copy this code - // from gBitSystem.php, and paste to artlib.php, bloglib.php - // and wikilib.php) - // TODO: it should be separate function to avoid - // maintain 3 pieces... (but I don't know PHP and TIKI - // architecture very well yet to make this :() - //Special parsing for multipage articles - function countPages($data) { -/* - - SPIDER KILL - 2005-05-16 - This was causing apache segfaults - - // Temporary remove <PRE></PRE> secions to protect - // from broke <PRE> tags and leave well known <PRE> - // behaviour (i.e. type all text inside AS IS w/o - // any interpretation) - $preparsed = array(); - preg_match_all("/(<[Pp][Rr][Ee]>)((.|\n)*?)(<\/[Pp][Rr][Ee]>)/", $data, $preparse); - $idx = 0; - foreach (array_unique($preparse[2])as $pp) { - $key = md5(BitSystem::genPass()); - $aux["key"] = $key; - $aux["data"] = $pp; - $preparsed[] = $aux; - $data = str_replace($preparse[1][$idx] . $pp . $preparse[4][$idx], $key, $data); - $idx = $idx + 1; - } - $parts = explode("...page...", $data); - return count($parts); -*/ + // ...page... functions + function countSubPages($data) { // we always have at least one page return( (preg_match_all( '/'.(defined('PAGE_SEP') ? preg_quote(PAGE_SEP) : '\.\.\.page\.\.\.').'/', $data, $matches ) + 1) ); } - function get_page($data, $i) { -/* - - SPIDER KILL - 2005-05-16 - This was causing apache segfaults - - // Temporary remove <PRE></PRE> secions to protect - // from broke <PRE> tags and leave well known <PRE> - // behaviour (i.e. type all text inside AS IS w/o - // any interpretation) - - $preparsed = array(); - preg_match_all("/(<[Pp][Rr][Ee]>)((.|\n)*?)(<\/[Pp][Rr][Ee]>)/", $data, $preparse); - $idx = 0; - foreach (array_unique($preparse[2])as $pp) { - $key = md5(BitSystem::genPass()); - $aux["key"] = $key; - $aux["data"] = $pp; - $preparsed[] = $aux; - $data = str_replace($preparse[1][$idx] . $pp . $preparse[4][$idx], $key, $data); - $idx = $idx + 1; - } -*/ // Get slides + function getSubPage($data, $i) { + // Get slides $parts = explode(defined('PAGE_SEP') ? PAGE_SEP : "...page...", $data); if (substr($parts[$i - 1], 1, 5) == "<br/>") $ret = substr($parts[$i - 1], 6); else $ret = $parts[$i - 1]; -/* // Replace back <PRE> sections - foreach ($preparsed as $pp) - $ret = str_replace($pp["key"], "<pre>" . $pp["data"] . "</pre>", $ret); -*/ return $ret; } // Like pages are pages that share a word in common with the current page - function get_like_pages($page) { + function getLikePages( $pPageTitle ) { $ret = array(); if( !empty( $pPageName ) ) { - preg_match_all("/([A-Z])([a-z]+)/", $page, $words); + preg_match_all("/([A-Z])([a-z]+)/", $pPageTitle, $words); // Add support to ((x)) in either strict or full modes - preg_match_all("/(([A-Za-z]|[\x80-\xFF])+)/", $page, $words2); + preg_match_all("/(([A-Za-z]|[\x80-\xFF])+)/", $pPageTitle, $words2); $words = array_unique(array_merge($words[0], $words2[0])); $exps = array(); $bindVars=array(); @@ -842,90 +769,16 @@ class WikiLib extends BitPage { } return $ret; } -/* - - DEPRECTATED - spider 2005-10-07 - - function get_user_pages( $pUserId, $max, $who='user_id') { - if( $pUserId ) { - $query = "SELECT lc.`title` as `title` - FROM `".BIT_DB_PREFIX."wiki_pages` wp INNER JOIN `".BIT_DB_PREFIX."liberty_content` lc ON (lc.`content_id` = wp.`content_id`) - WHERE `$who`=?"; - - $result = $this->mDb->query($query,array($pUserId),$max); - $ret = array(); - - while ($res = $result->fetchRow()) { - $ret[] = $res; - } - - return $ret; - } - } -*/ - -/* ======================================== NOT USED ANYWHERE - not sure how to calculate a ranking of wiki pages anyway. what are the criteria and what does it say about a page? - xing - // This function calculates the page_ranks for the wiki_pages - // it can be used to compute the most relevant pages - // according to the number of links they have - // this can be a very interesting ranking for the Wiki - // More about this on version 1.3 when we add the page_rank - // column to wiki_pages - function page_rank($loops = 16) { - $query = "select `content_id`, lc.`title` from `".BIT_DB_PREFIX."wiki_pages` wp INNER JOIN `".BIT_DB_PREFIX."liberty_content` lc ON( wp.`content_id`=lc.`content_id` "; - $result = $this->mDb->query($query,array()); - $ret = array(); - - while ($res = $result->fetchRow()) { - $ret[$res["content_id"]] = $res["title"]; - } - - // Now calculate the loop - $pages = array(); - - foreach( array_keys( $ret ) as $conId ) { - $val = 1 / count($ret); - - $pages[$conId] = $val; - // Fixed query. -rlpowell - $query = "update `".BIT_DB_PREFIX."wiki_pages` set `page_rank`=? where `content_id`= ?"; - $result = $this->mDb->query($query, array((int)$val, $conId) ); - } - - for ($i = 0; $i < $loops; $i++) { - foreach ($pages as $pagename => $rank) { - // Get all the pages linking to this one - // Fixed query. -rlpowell - $query = "select `from_content_id` from `".BIT_DB_PREFIX."liberty_content_links` where `to_content_id` = ?"; - $result = $this->mDb->query($query, array( $pagename ) ); - $sum = 0; - - while ($res = $result->fetchRow()) { - $linking = $res["from_page"]; - - if (isset($pages[$linking])) { - // Fixed query. -rlpowell - $q2 = "select count(*) from `".BIT_DB_PREFIX."liberty_content_links` where `from_page`= ?"; - $cant = $this->mDb->getOne($q2, array($linking) ); - if ($cant == 0) $cant = 1; - $sum += $pages[$linking] / $cant; - } - } - - $val = (1 - 0.85) + 0.85 * $sum; - $pages[$pagename] = $val; - // Fixed query. -rlpowell - $query = "update `".BIT_DB_PREFIX."wiki_pages` set `page_rank`=? where `title`=?"; - $result = $this->mDb->query($query, array((int)$val, $pagename) ); - - // Update - } - } +} - arsort ($pages); - return $pages; +define('PLUGINS_DIR', WIKI_PKG_PATH.'plugins'); +/** + * @package wiki + */ +class WikiLib extends BitPage { + function WikiLib() { + BitPage::BitPage(); } -*/ function wiki_page_graph(&$str, &$graph, $garg) { $page = $str['name']; @@ -987,34 +840,16 @@ class WikiLib extends BitPage { return $aux; } - function wiki_link_structure() { - $query = "select `title` from `".BIT_DB_PREFIX."wiki_pages` order by ".$this->mDb->convertSortmode("title_asc"); - $result = $this->mDb->query($query); - while ($res = $result->fetchRow()) { - print ($res["title"] . " "); - $page = $res["title"]; - $query2 = "select `to_page` from `".BIT_DB_PREFIX."liberty_content_links` where `from_page`=?"; - $result2 = $this->mDb->query($query2, array( $page ) ); - $pages = array(); - while ($res2 = $result2->fetchRow()) { - if (($res2["to_page"] <> $res["title"]) && (!in_array($res2["to_page"], $pages))) { - $pages[] = $res2["to_page"]; - print ($res2["to_page"] . " "); - } - } - print ("\n"); - } - } /*shared*/ function list_received_pages($offset, $max_records, $sort_mode = 'title_asc', $find) { $bindvars = array(); if ($find) { - $findesc = '%'.strtoupper( $find ).'%'; - $mid = " where (UPPER(`pagename`) like ? or UPPER(`data`) like ?)"; - $bindvbars[] = $findesc; - $bindvbars[] = $findesc; + $findesc = '%'.strtoupper( $find ).'%'; + $mid = " where (UPPER(`pagename`) like ? or UPPER(`data`) like ?)"; + $bindvbars[] = $findesc; + $bindvbars[] = $findesc; } else { - $mid = ""; + $mid = ""; } $query = "select * from `".BIT_DB_PREFIX."wiki_received_pages` $mid order by ".$this->mDb->convertSortmode($sort_mode); @@ -1024,13 +859,13 @@ class WikiLib extends BitPage { $ret = array(); while ($res = $result->fetchRow()) { - if ($this->pageExists($res["title"])) { - $res["exists"] = 'y'; - } else { - $res["exists"] = 'n'; - } + if ($this->pageExists($res["title"])) { + $res["exists"] = 'y'; + } else { + $res["exists"] = 'n'; + } - $ret[] = $res; + $ret[] = $res; } $retval = array(); @@ -1046,6 +881,26 @@ class WikiLib extends BitPage { * ================================================================================================= * ================================================================================================= * ================================================================================================= + + function wiki_link_structure() { + $query = "select `title` from `".BIT_DB_PREFIX."wiki_pages` order by ".$this->mDb->convertSortmode("title_asc"); + $result = $this->mDb->query($query); + while ($res = $result->fetchRow()) { + print ($res["title"] . " "); + $page = $res["title"]; + $query2 = "select `to_page` from `".BIT_DB_PREFIX."liberty_content_links` where `from_page`=?"; + $result2 = $this->mDb->query($query2, array( $page ) ); + $pages = array(); + while ($res2 = $result2->fetchRow()) { + if (($res2["to_page"] <> $res["title"]) && (!in_array($res2["to_page"], $pages))) { + $pages[] = $res2["to_page"]; + print ($res2["to_page"] . " "); + } + } + print ("\n"); + } + } + // This funcion return the $limit most accessed pages // it returns title and hits for each page function get_top_pages($limit) { @@ -1291,14 +1146,4 @@ class WikiLib extends BitPage { */ } -/** - * the wikilib class - * @global WikiLib $wikilib - */ -global $wikilib; -// Perhaps someone overrode the wikilib class to do there own magic, and have alread instantiated... -if( empty( $wikilib ) ) { - $wikilib = new WikiLib(); -} - ?> diff --git a/backlinks.php b/backlinks.php index 3a481ee..82fa405 100644 --- a/backlinks.php +++ b/backlinks.php @@ -3,13 +3,13 @@ * assigned_modules * * @author spider <spider@steelsun.com> - * @version $Revision: 1.10 $ + * @version $Revision: 1.11 $ * @package wiki * @subpackage functions * @copyright Copyright (c) 2002-2003, Luis Argerich, Garland Foster, Eduardo Polidor, et. al. * @license Licensed under the GNU LESSER GENERAL PUBLIC LICENSE. See license.txt for details. */ -// $Header: /cvsroot/bitweaver/_bit_wiki/backlinks.php,v 1.10 2007/06/01 15:16:49 squareing Exp $ +// $Header: /cvsroot/bitweaver/_bit_wiki/backlinks.php,v 1.11 2007/06/01 16:01:30 squareing Exp $ // All Rights Reserved. See copyright.txt for details and a complete list of authors. /** @@ -23,21 +23,18 @@ $gBitSystem->verifyFeature( 'wiki_backlinks' ); // Get the page from the request var or default it to HomePage if (!isset($_REQUEST["page"])) { - $gBitSmarty->fatalError(tra("No page indicated")); + $gBitSystem->fatalError(tra("No page indicated")); } else { $page = $_REQUEST["page"]; $gBitSmarty->assign_by_ref('page', $_REQUEST["page"]); } // Now check permissions to access this page -if (!$gBitUser->hasPermission( 'p_wiki_view_page' )) { - $gBitSmarty->assign('msg', tra("Permission denied you cannot view backlinks for this page")); - $gBitSystem->display( 'error.tpl' ); - die; -} +$gBitSystem->verifyPermission( 'p_wiki_view_page' ); + // If the page doesn't exist then display an error if( !$gContent->pageExists( $page )) { - $gBitSmarty->fatalError(tra("The page could not be found")); + $gBitSystem->fatalError(tra("The page could not be found")); } // Get the backlinks for the page "page" $backlinks = $gContent->getBacklinks(); diff --git a/display_bitpage_inc.php b/display_bitpage_inc.php index 0c3ff14..9ffb642 100644 --- a/display_bitpage_inc.php +++ b/display_bitpage_inc.php @@ -1,6 +1,6 @@ <?php /** - * $Header: /cvsroot/bitweaver/_bit_wiki/display_bitpage_inc.php,v 1.33 2007/06/01 15:16:49 squareing Exp $ + * $Header: /cvsroot/bitweaver/_bit_wiki/display_bitpage_inc.php,v 1.34 2007/06/01 16:01:30 squareing Exp $ * * Copyright (c) 2004 bitweaver.org * Copyright (c) 2003 tikwiki.org @@ -8,7 +8,7 @@ * All Rights Reserved. See copyright.txt for details and a complete list of authors. * Licensed under the GNU LESSER GENERAL PUBLIC LICENSE. See license.txt for details * - * $Id: display_bitpage_inc.php,v 1.33 2007/06/01 15:16:49 squareing Exp $ + * $Id: display_bitpage_inc.php,v 1.34 2007/06/01 16:01:30 squareing Exp $ * @package wiki * @subpackage functions */ @@ -101,12 +101,13 @@ if ($gBitSystem->isFeatureActive( 'wiki_uses_slides' )) { $gBitSmarty->assign('show_slideshow','n'); } -$pages = $gContent->countPages($gContent->mInfo['parsed_data']); +// ...page... stuff - TODO: this is cumbersome and should be cleaned up +$pages = $gContent->countSubPages($gContent->mInfo['parsed_data']); if( $pages > 1 ) { if(!isset($_REQUEST['pagenum'])) { $_REQUEST['pagenum']=1; } - $gContent->mInfo['parsed_data']=$gContent->get_page($gContent->mInfo['parsed_data'],$_REQUEST['pagenum']); + $gContent->mInfo['parsed_data']=$gContent->getSubPage($gContent->mInfo['parsed_data'],$_REQUEST['pagenum']); $gBitSmarty->assign('pages',$pages); if($pages>$_REQUEST['pagenum']) { $gBitSmarty->assign('next_page',$_REQUEST['pagenum']+1); @@ -122,6 +123,7 @@ if( $pages > 1 ) { $gBitSmarty->assign('last_page',$pages); $gBitSmarty->assign('pagenum',$_REQUEST['pagenum']); } + //$gBitSmarty->assign_by_ref('last_modified',date("l d of F, Y [H:i:s]",$gContent->mInfo["last_modified"])); $gBitSmarty->assign_by_ref('last_modified',$gContent->mInfo["last_modified"]); if(empty($gContent->mInfo["user"])) { diff --git a/like_pages.php b/like_pages.php index f826408..4b8974f 100644 --- a/like_pages.php +++ b/like_pages.php @@ -1,6 +1,6 @@ <?php /** - * $Header: /cvsroot/bitweaver/_bit_wiki/like_pages.php,v 1.10 2007/06/01 15:16:49 squareing Exp $ + * $Header: /cvsroot/bitweaver/_bit_wiki/like_pages.php,v 1.11 2007/06/01 16:01:30 squareing Exp $ * * Copyright (c) 2004 bitweaver.org * Copyright (c) 2003 tikwiki.org @@ -8,7 +8,7 @@ * All Rights Reserved. See copyright.txt for details and a complete list of authors. * Licensed under the GNU LESSER GENERAL PUBLIC LICENSE. See license.txt for details * - * $Id: like_pages.php,v 1.10 2007/06/01 15:16:49 squareing Exp $ + * $Id: like_pages.php,v 1.11 2007/06/01 16:01:30 squareing Exp $ * @package wiki * @subpackage functions */ @@ -25,13 +25,11 @@ $gBitSystem->verifyPermission( 'p_wiki_view_page', tra( "Permission denied you c // Get the page from the request var or default it to HomePage if( !$gContent->isValid() ) { - $gBitSmarty->assign('msg', tra("No page indicated")); - $gBitSystem->display( 'error.tpl' ); - die; + $gBitSystem->fatalError( tra( "No page indicated" )); } -$likepages = $gContent->get_like_pages( $gContent->mInfo['title'] ); -$gBitSmarty->assign_by_ref('likepages', $likepages); +$likepages = $gContent->getLikePages( $gContent->mInfo['title'] ); +$gBitSmarty->assign_by_ref( 'likepages', $likepages ); // Display the template $gBitSystem->display( 'bitpackage:wiki/like_pages.tpl'); diff --git a/modules/mod_comm_received_objects.php b/modules/mod_comm_received_objects.php index 066a160..d27fcce 100644 --- a/modules/mod_comm_received_objects.php +++ b/modules/mod_comm_received_objects.php @@ -1,6 +1,6 @@ <?php /** - * $Header: /cvsroot/bitweaver/_bit_wiki/modules/mod_comm_received_objects.php,v 1.3 2005/08/01 18:42:06 squareing Exp $ + * $Header: /cvsroot/bitweaver/_bit_wiki/modules/mod_comm_received_objects.php,v 1.4 2007/06/01 16:01:33 squareing Exp $ * * Copyright (c) 2004 bitweaver.org * Copyright (c) 2003 tikwiki.org @@ -8,7 +8,7 @@ * All Rights Reserved. See copyright.txt for details and a complete list of authors. * Licensed under the GNU LESSER GENERAL PUBLIC LICENSE. See license.txt for details * - * $Id: mod_comm_received_objects.php,v 1.3 2005/08/01 18:42:06 squareing Exp $ + * $Id: mod_comm_received_objects.php,v 1.4 2007/06/01 16:01:33 squareing Exp $ * @package wiki * @subpackage modules */ @@ -17,7 +17,7 @@ * required setup */ require_once( WIKI_PKG_PATH.'BitPage.php' ); -global $wikilib; +$wikilib = new WikiLib(); $ranking = $wikilib->list_received_pages(0, -1, $sort_mode = 'title_asc', ''); $gBitSmarty->assign('modReceivedPages', $ranking["cant"]); ?> diff --git a/received_pages.php b/received_pages.php index ee35115..845d9ec 100644 --- a/received_pages.php +++ b/received_pages.php @@ -1,6 +1,6 @@ <?php /** - * $Header: /cvsroot/bitweaver/_bit_wiki/Attic/received_pages.php,v 1.8 2006/04/11 13:10:33 squareing Exp $ + * $Header: /cvsroot/bitweaver/_bit_wiki/Attic/received_pages.php,v 1.9 2007/06/01 16:01:30 squareing Exp $ * * Copyright (c) 2004 bitweaver.org * Copyright (c) 2003 tikwiki.org @@ -8,7 +8,7 @@ * All Rights Reserved. See copyright.txt for details and a complete list of authors. * Licensed under the GNU LESSER GENERAL PUBLIC LICENSE. See license.txt for details * - * $Id: received_pages.php,v 1.8 2006/04/11 13:10:33 squareing Exp $ + * $Id: received_pages.php,v 1.9 2007/06/01 16:01:30 squareing Exp $ * @package wiki * @subpackage functions */ @@ -57,7 +57,7 @@ $gBitSmarty->assign('title', $info["title"]); $gBitSmarty->assign('data', $info["data"]); $gBitSmarty->assign('comment', $info["comment"]); // Assign parsed -$gBitSmarty->assign('parsed', $wikilib->parseData($info)); +$gBitSmarty->assign('parsed', $gContent->parseData($info)); if (isset($_REQUEST["remove"])) { $commlib->remove_received_page($_REQUEST["remove"]); @@ -94,6 +94,7 @@ if (isset($_REQUEST["find"])) { } $gBitSmarty->assign_by_ref('find', $find); +$wikilib = new WikiLib(); $channels = $wikilib->list_received_pages($offset, $max_records, $sort_mode, $find); $cant_pages = ceil($channels["cant"] / $max_records); $gBitSmarty->assign_by_ref('cant_pages', $cant_pages); diff --git a/slideshow.php b/slideshow.php index 2a963a4..5dfadaf 100755 --- a/slideshow.php +++ b/slideshow.php @@ -1,6 +1,6 @@ <?php /** - * $Header: /cvsroot/bitweaver/_bit_wiki/slideshow.php,v 1.16 2007/06/01 15:16:49 squareing Exp $ + * $Header: /cvsroot/bitweaver/_bit_wiki/slideshow.php,v 1.17 2007/06/01 16:01:30 squareing Exp $ * * Copyright (c) 2004 bitweaver.org * Copyright (c) 2003 tikwiki.org @@ -8,7 +8,7 @@ * All Rights Reserved. See copyright.txt for details and a complete list of authors. * Licensed under the GNU LESSER GENERAL PUBLIC LICENSE. See license.txt for details * - * $Id: slideshow.php,v 1.16 2007/06/01 15:16:49 squareing Exp $ + * $Id: slideshow.php,v 1.17 2007/06/01 16:01:30 squareing Exp $ * @package wiki * @subpackage functions */ @@ -17,10 +17,8 @@ * required setup */ require_once( '../bit_setup_inc.php' ); - require_once( 'BitPage.php' ); - $gBitSystem->verifyPackage( 'wiki' ); //print($GLOBALS["HTTP_REFERER"]); @@ -33,13 +31,11 @@ if (!isset($_SESSION["thedate"])) { require_once ( WIKI_PKG_PATH.'lookup_page_inc.php' ); // If the page doesn't exist then display an error if (!$gContent->isValid()) { - $gBitSmarty->fatalError(tra("Page cannot be found")); + $gBitSystem->fatalError(tra("Page cannot be found")); } // Now check permissions to access this page -if (!$gBitUser->hasPermission( 'p_wiki_view_page' )) { - $gBitSmarty->fatalError(tra("Permission denied you cannot view this page")); -} +$gBitSystem->verifyPermission( 'p_wiki_view_page' ); // Get page data include( WIKI_PKG_PATH.'lookup_page_inc.php' ); diff --git a/wiki_graph.php b/wiki_graph.php index 6fe1223..f15c6b0 100644 --- a/wiki_graph.php +++ b/wiki_graph.php @@ -1,6 +1,6 @@ <?php /** - * $Header: /cvsroot/bitweaver/_bit_wiki/wiki_graph.php,v 1.3 2006/03/20 15:58:38 squareing Exp $ + * $Header: /cvsroot/bitweaver/_bit_wiki/wiki_graph.php,v 1.4 2007/06/01 16:01:30 squareing Exp $ * * Copyright (c) 2004 bitweaver.org * Copyright (c) 2003 tikwiki.org @@ -8,7 +8,7 @@ * All Rights Reserved. See copyright.txt for details and a complete list of authors. * Licensed under the GNU LESSER GENERAL PUBLIC LICENSE. See license.txt for details * - * $Id: wiki_graph.php,v 1.3 2006/03/20 15:58:38 squareing Exp $ + * $Id: wiki_graph.php,v 1.4 2007/06/01 16:01:30 squareing Exp $ * @package wiki * @subpackage functions */ @@ -57,8 +57,9 @@ $garg = array( 'style' => $_REQUEST['edgestyle'] ) ); -$str = $wikilib->wiki_get_link_structure($_REQUEST['page'], $_REQUEST['level']); $graph = new Image_GraphViz(); +$wikilib = new WikiLib(); +$str = $wikilib->wiki_get_link_structure($_REQUEST['page'], $_REQUEST['level']); $wikilib->wiki_page_graph($str, $graph, $garg); $graph->image( 'png' ); ?> |
