<?php /** * Copyright (c) 2004 bitweaver.org * Copyright (c) 2003 tikwiki.org * Copyright (c) 2002-2003, Luis Argerich, Garland Foster, Eduardo Polidor, et. al. * All Rights Reserved. See below for details and a complete list of authors. * Licensed under the GNU LESSER GENERAL PUBLIC LICENSE. See http://www.gnu.org/copyleft/lesser.html for details * * @package wiki * @subpackage modules */ global $gQueryUserId, $moduleParams; $params = $moduleParams['module_params']; /** * required setup */ if ($gBitUser->hasPermission('p_wiki_view_page')) { require_once WIKI_PKG_PATH . 'BitPage.php'; $wp = new BitPage(); $listHash = array('max_records' => $moduleParams['module_rows'], 'sort_mode' => 'last_modified_desc', 'user_id' => $gQueryUserId); $modLastModif = $wp->getList($listHash); $_template->tpl_vars['modLastModif'] = new Smarty_variable($modLastModif); $_template->tpl_vars['maxlen'] = new Smarty_variable(isset($params["maxlen"])); }
<?php /** * Copyright (c) 2004 bitweaver.org * Copyright (c) 2003 tikwiki.org * Copyright (c) 2002-2003, Luis Argerich, Garland Foster, Eduardo Polidor, et. al. * All Rights Reserved. See below for details and a complete list of authors. * Licensed under the GNU LESSER GENERAL PUBLIC LICENSE. See http://www.gnu.org/copyleft/lesser.html for details * * @package wiki * @subpackage modules */ /** * Required files */ require_once WIKI_PKG_PATH . 'BitPage.php'; $wp = new BitPage(); if ($gBitUser->hasPermission('p_wiki_view_page')) { $listHash = array('sort_mode' => 'random', 'max_records' => $moduleParams['module_rows']); $pages = $wp->getList($listHash); $_template->tpl_vars['modRandomPages'] = new Smarty_variable($pages); }
<?php /** * Copyright (c) 2004 bitweaver.org * Copyright (c) 2003 tikwiki.org * Copyright (c) 2002-2003, Luis Argerich, Garland Foster, Eduardo Polidor, et. al. * All Rights Reserved. See below for details and a complete list of authors. * Licensed under the GNU LESSER GENERAL PUBLIC LICENSE. See http://www.gnu.org/copyleft/lesser.html for details * * @package wiki * @subpackage modules */ /** * required setup */ require_once WIKI_PKG_PATH . 'BitPage.php'; global $gQueryUser, $module_rows, $module_params; extract($moduleParams); if ($gBitUser->hasPermission('p_wiki_view_page')) { $modWiki = new BitPage(); $listHash = array('max_records' => $module_rows, 'sort_mode' => 'hits_desc', 'user_id' => !empty($module_params['user_pages']) ? $gQueryUser->mUserId : NULL); $modRank = $modWiki->getList($listHash); $_template->tpl_vars['modTopPages'] = new Smarty_variable($modRank); }
$gBitSystem->verifyPackage('rss'); $gBitSystem->verifyFeature('wiki_rss'); require_once WIKI_PKG_PATH . "BitPage.php"; require_once RSS_PKG_PATH . "rss_inc.php"; $rss->title = $gBitSystem->getConfig('wiki_rss_title', $gBitSystem->getConfig('site_title') . ' - ' . tra('Wiki')); $rss->description = $gBitSystem->getConfig('wiki_rss_description', $gBitSystem->getConfig('site_title') . ' - ' . tra('RSS Feed')); // check permission to view wiki pages if (!$gBitUser->hasPermission('p_wiki_view_page')) { require_once RSS_PKG_PATH . "rss_error.php"; } else { // check if we want to use the cache file $cacheFile = TEMP_PKG_PATH . RSS_PKG_NAME . '/' . WIKI_PKG_NAME . '/' . $cacheFileTail; $rss->useCached($rss_version_name, $cacheFile, $gBitSystem->getConfig('rssfeed_cache_time')); $wiki = new BitPage(); $listHash = array('max_records' => $gBitSystem->getConfig('wiki_rss_max_records', 10), 'sort_mode' => 'last_modified_desc', 'get_data' => TRUE); $feeds = $wiki->getList($listHash); // set the rss link $rss->link = 'http://' . $_SERVER['HTTP_HOST'] . WIKI_PKG_URL; // get all the data ready for the feed creator foreach ($feeds as $feed) { $item = new FeedItem(); $item->title = $feed['title']; $item->link = BIT_BASE_URI . $wiki->getDisplayUrl($feed['title']); $item->description = $wiki->parseData($feed); $item->date = (int) $feed['last_modified']; $item->source = 'http://' . $_SERVER['HTTP_HOST'] . BIT_ROOT_URL; $item->author = $gBitUser->getDisplayName(FALSE, array('real_name' => $feed['modifier_real_name'], 'login' => $feed['modifier_user'])); $item->descriptionTruncSize = $gBitSystem->getConfig('rssfeed_truncate', 5000); $item->descriptionHtmlSyndicated = FALSE; // pass the item on to the rss feed creator $rss->addItem($item);