addHTML('This list list shows the order in which articles where created and the creation date.');
list( $limit, $offset ) = wfCheckLimits();
$app = new PageCreateOrderPage();
$app->doQuery( $offset, $limit );
}
function wfExtensionSpecialPageCreateOrder() {
global $IP;
require_once( "$IP/includes/SpecialPage.php" );
global $wgMessageCache;
$wgMessageCache->addMessages(array('pagecreateorder' => 'List Pages by Creation Date')); //will expand
SpecialPage::addPage( new SpecialPage( 'PageCreateOrder' ) );
require_once( "QueryPage.php" );
class PageCreateOrderPage extends QueryPage {
function getName() {
return "PageCreateOrder";
}
function isExpensive() {
return true;
}
function isSyndicated() { return false; }
function getSQL() {
$db =& wfGetDB( DB_SLAVE );
$page = $db->tableName( 'page' );
$revision = $db->tableName( 'revision' );
return
"SELECT 'PageCreateOrder' AS type,
a.page_namespace AS namespace,
a.page_title AS title,
UNIX_TIMESTAMP(MIN(b.rev_timestamp)) AS value,
rev_user_text
FROM $page a, $revision b
WHERE a.page_id=b.rev_page AND a.page_namespace=".NS_MAIN." AND a.page_is_redirect=0
GROUP BY page_id";
}
function sortDescending() {
return false;
}
function formatResult( $skin, $result ) {
global $wgLang, $wgContLang;
$d = $wgLang->timeanddate( wfTimestamp( TS_MW, $result->value ), true );
$title = Title::makeTitle( $result->namespace, $result->title );
$link = $skin->makeKnownLinkObj( $title, $wgContLang->convert( $title->getPrefixedText() ) );
# Until I can figure out how to auto-generate user links like the title is generated, I'll have
# to manually create the link for the user page.
$rev_user_text = $result->rev_user_text;
return "{$link} (created on {$d} by $rev_user_text)";
}
}
}
?>