This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License along
with this program; if not, write to the Free Software Foundation, Inc.,
59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
<a href="http://www.gnu.org/copyleft/gpl.html" class="external free" target="_blank" title="http://www.gnu.org/copyleft/gpl.html" rel="nofollow">http://www.gnu.org/copyleft/gpl.html</a>
Current feature request list
1. Unset cached of calling page
2. Alternative formatting (not just unordered list)
3. Configurable sort order, ascending/descending
4. RSS feed output?
To install, add following to LocalSettings.php
include("extensions/intersection/DynamicPageList.php");
/
$wgDLPminCategories = 1; // Minimum number of categories to look for
$wgDLPmaxCategories = 6; // Maximum number of categories to look for
$wgDLPMinResultCount = 1; // Minimum number of results to allow
$wgDLPMaxResultCount = 50; // Maximum number of results to allow
$wgDLPAllowUnlimitedResults = true; // Allow unlimited results
$wgDLPAllowUnlimitedCategories = false; // Allow unlimited categories
$wgExtensionFunctions[] = "wfDynamicPageList";
$wgExtensionCredits['parserhook'][] = array(
'name' => 'DynamicPageList',
'description' => 'outputs a bulleted list of the most recent items residing in a category, or a union of several categories',
'url' => 'http://meta.wikimedia.org/wiki/DynamicPageList'
);
function wfDynamicPageList() {
global $wgParser, $wgMessageCache;
$wgMessageCache->addMessages( array(
'dynamicpagelist_toomanycats' => 'DynamicPageList: Too many categories!',
'dynamicpagelist_toofewcats' => 'DynamicPageList: Too few categories!',
'dynamicpagelist_noresults' => 'DynamicPageList: No results!',
'dynamicpagelist_noincludecats' => 'DynamicPageList: You need to include at least one category, or specify a namespace!',
)
);
// The callback function for converting the input text to HTML output
function DynamicPageList( $input ) {
global $wgUser;
global $wgLang;
global $wgContLang;
global $wgDLPminCategories, $wgDLPmaxCategories,$wgDLPMinResultCount, $wgDLPMaxResultCount;
global $wgDLPAllowUnlimitedResults, $wgDLPAllowUnlimitedCategories;
$aParams = array();
$bCountSet = false;