PDA

View Full Version : Help with creating a custom php module



nyckidd
20 Oct 2010, 03:01 PM
hey,

am working on a bitweaver website, i need to list the last 10 wiki posts from a specific category though i have a number of modules i have gone ahead and duplicated 1 module which shows the last modified posts but my dilemna is not knowing what variable to change to show the last 10 from a specific category....

see the file below :




<?php
/**
* $Header: /cvsroot/bitweaver/_bit_wiki/modules/mod_last_modif_pages.php,v 1.10 2009/10/01 14:17:07 wjames5 Exp $
*
* 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
*
* $Id: mod_last_modif_pages.php,v 1.10 2009/10/01 14:17:07 wjames5 Exp $
* @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' => 'random',
'user_id' => $gQueryUserId,
);
$modLastModif = $wp->getList( $listHash );

$gBitSmarty->assign( 'modLastModif', $modLastModif );
$gBitSmarty->assign( 'maxlen', isset( $params["maxlen"] ) ? $params["maxlen"] : 0 );
}
?>