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