# limit=10
#
#
# where limit is the maximum number of new pages to show.
#
# To activate the extension, include it from your LocalSettings.php
# with: require_once("extensions/NewPages.php");
#
# Author: Michael Meffie
# Date: Jan 17 2006
# Credits: This extension was derived from SpecialNewpages.php.
# License: GPL v2.0
#
$wgExtensionFunctions[] = "wfNewPagesExtension";
$wgExtensionCredits['parserhook'][] = array(
'name' => 'NewPages',
'author' => 'Michael Meffie',
'url' => 'http://meta.wikimedia.org/wiki/User:Meffiem',
);
function wfNewPagesExtension() {
global $wgParser;
$wgParser->setHook( "newpages", "renderNewPages" );
}
function renderNewPages( $input, $args=null, &$parser) {
$localParser = new Parser();
$output = "
Keine neuen Seiten
";
$limit = 5;
getBoxOption($limit,$input,'limit',true);
$dbr =& wfGetDB( DB_SLAVE );
extract( $dbr->tableNames( 'recentchanges', 'page' ) );
$query_limit = $limit + 1; # to determine if we should display (more...)
$sql = "SELECT rc_namespace AS namespace,
rc_title AS title,
rc_cur_id AS value,
rc_user AS user,
rc_user_text AS user_text,
rc_comment as comment,
rc_timestamp AS timestamp,
rc_id AS rcid,
page_len as length,
page_latest as rev_id
FROM $recentchanges,$page
WHERE rc_cur_id=page_id AND rc_new=1
AND rc_namespace=".NS_MAIN." AND page_is_redirect=0
ORDER BY value DESC
LIMIT $query_limit";
$result = $dbr->query( $sql );
$num = $dbr->numRows( $result );
if ($num > 0) {
$output = "