4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation; either version 2 of the License, or
7 * (at your option) any later version.
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
14 * You should have received a copy of the GNU General Public License along
15 * with this program; if not, write to the Free Software Foundation, Inc.,
16 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
17 * http://www.gnu.org/copyleft/gpl.html
22 * Implements Special:Ancientpages
23 * @ingroup SpecialPage
25 class AncientPagesPage
extends QueryPage
{
28 return "Ancientpages";
31 function isExpensive() {
35 function isSyndicated() { return false; }
39 $db = wfGetDB( DB_SLAVE
);
40 $page = $db->tableName( 'page' );
41 $revision = $db->tableName( 'revision' );
45 $epoch = 'UNIX_TIMESTAMP(rev_timestamp)';
48 // TODO implement proper conversion to a Unix epoch
49 $epoch = 'rev_timestamp';
52 $epoch = '((trunc(rev_timestamp) - to_date(\'19700101\',\'YYYYMMDD\')) * 86400)';
55 $epoch = 'rev_timestamp';
58 $epoch = 'DATEDIFF(s,CONVERT(datetime,\'1/1/1970\'),rev_timestamp)';
61 $epoch = 'EXTRACT(epoch FROM rev_timestamp)';
65 "SELECT 'Ancientpages' as type,
66 page_namespace as namespace,
70 WHERE page_namespace=".NS_MAIN
." AND page_is_redirect=0
71 AND page_latest=rev_id";
74 function sortDescending() {
78 function formatResult( $skin, $result ) {
79 global $wgLang, $wgContLang;
81 $d = $wgLang->timeanddate( wfTimestamp( TS_MW
, $result->value
), true );
82 $title = Title
::makeTitle( $result->namespace, $result->title
);
83 $link = $skin->linkKnown(
85 htmlspecialchars( $wgContLang->convert( $title->getPrefixedText() ) )
87 return wfSpecialList($link, htmlspecialchars($d) );
91 function wfSpecialAncientpages() {
92 list( $limit, $offset ) = wfCheckLimits();
94 $app = new AncientPagesPage();
96 $app->doQuery( $offset, $limit );