MediaWiki REL1_33
SpecialAncientpages.php
Go to the documentation of this file.
1<?php
25
32
33 function __construct( $name = 'Ancientpages' ) {
34 parent::__construct( $name );
35 }
36
37 public function isExpensive() {
38 return true;
39 }
40
41 function isSyndicated() {
42 return false;
43 }
44
45 public function getQueryInfo() {
46 $tables = [ 'page', 'revision' ];
47 $conds = [
48 'page_namespace' => MWNamespace::getContentNamespaces(),
49 'page_is_redirect' => 0
50 ];
51 $joinConds = [
52 'revision' => [
53 'JOIN', [
54 'page_latest = rev_id'
55 ]
56 ],
57 ];
58
59 // Allow extensions to modify the query
60 Hooks::run( 'AncientPagesQuery', [ &$tables, &$conds, &$joinConds ] );
61
62 return [
63 'tables' => $tables,
64 'fields' => [
65 'namespace' => 'page_namespace',
66 'title' => 'page_title',
67 'value' => 'rev_timestamp'
68 ],
69 'conds' => $conds,
70 'join_conds' => $joinConds
71 ];
72 }
73
74 public function usesTimestamps() {
75 return true;
76 }
77
78 function sortDescending() {
79 return false;
80 }
81
82 public function preprocessResults( $db, $res ) {
84 }
85
91 function formatResult( $skin, $result ) {
92 $d = $this->getLanguage()->userTimeAndDate( $result->value, $this->getUser() );
93 $title = Title::makeTitle( $result->namespace, $result->title );
95 $link = $linkRenderer->makeKnownLink(
96 $title,
97 new HtmlArmor( MediaWikiServices::getInstance()->getContentLanguage()->
98 convert( htmlspecialchars( $title->getPrefixedText() ) ) )
99 );
100
101 return $this->getLanguage()->specialList( $link, htmlspecialchars( $d ) );
102 }
103
104 protected function getGroupName() {
105 return 'maintenance';
106 }
107}
and that you know you can do these things To protect your we need to make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights These restrictions translate to certain responsibilities for you if you distribute copies of the or if you modify it For if you distribute copies of such a whether gratis or for a you must give the recipients all the rights that you have You must make sure that receive or can get the source code And you must show them these terms so they know their rights We protect your rights with two and(2) offer you this license which gives you legal permission to copy
Implements Special:Ancientpages.
isExpensive()
Is this query expensive (for some definition of expensive)? Then we don't let it run in miser mode.
preprocessResults( $db, $res)
Do any necessary preprocessing of the result object.
__construct( $name='Ancientpages')
isSyndicated()
Sometime we don't want to build rss / atom feeds.
getQueryInfo()
Subclasses return an SQL query here, formatted as an array with the following keys: tables => Table(s...
formatResult( $skin, $result)
usesTimestamps()
Does this query return timestamps rather than integers in its 'value' field? If true,...
getGroupName()
Under which header this special page is listed in Special:SpecialPages See messages 'specialpages-gro...
sortDescending()
Override to sort by increasing values.
Marks HTML that shouldn't be escaped.
Definition HtmlArmor.php:28
MediaWikiServices is the service locator for the application scope of MediaWiki.
This is a class for doing query pages; since they're almost all the same, we factor out some of the f...
Definition QueryPage.php:35
executeLBFromResultWrapper(IResultWrapper $res, $ns=null)
Creates a new LinkBatch object, adds all pages from the passed ResultWrapper (MUST include title and ...
getLanguage()
Shortcut to get user's language.
MediaWiki Linker LinkRenderer null $linkRenderer
$res
Definition database.txt:21
this hook is for auditing only RecentChangesLinked and Watchlist Do not use this to implement individual filters if they are compatible with the ChangesListFilter and ChangesListFilterGroup structure use sub classes of those in conjunction with the ChangesListSpecialPageStructuredFilters hook This hook can be used to implement filters that do not implement that or custom behavior that is not an individual filter e g Watchlist & $tables
Definition hooks.txt:996
usually copyright or history_copyright This message must be in HTML not wikitext & $link
Definition hooks.txt:3069