*/
function wfSpecialAllpages( $par=NULL ) {
global $indexMaxperpage, $toplevelMaxperpage, $wgRequest, $wgOut, $wgContLang;
+ # Config
$indexMaxperpage = 480;
$toplevelMaxperpage = 50;
+ # GET values
$from = $wgRequest->getVal( 'from' );
$namespace = $wgRequest->getInt( 'namespace' );
+ $invert = $wgRequest->getInt( 'invert' );
+
$names = $wgContLang->getNamespaces();
+
if( !isset( $names[$namespace] ) ) {
$namespace = 0;
}
- $wgOut->setPagetitle ( $namespace > 0 ? wfMsg ( 'allpagesnamespace', $names[$namespace] )
- : wfMsg ( 'allarticles' ) );
+ if ($invert) {
+ $wgOut->setPagetitle( $namespace > 0 ?
+ wfMsg( 'allnotinnamespace', $names[$namespace] ) :
+ wfMsg( 'allnonarticles' )
+ );
+ } else {
+ $wgOut->setPagetitle( $namespace > 0 ?
+ wfMsg( 'allinnamespace', $names[$namespace] ) :
+ wfMsg( 'allarticles' )
+ );
+ }
+
if ( $par ) {
- indexShowChunk( $par, $namespace );
+ indexShowChunk( $namespace, $par, $invert );
} elseif ( $from ) {
- indexShowChunk( $from, $namespace );
+ indexShowChunk( $namespace, $from, $invert );
} else {
- indexShowToplevel ( $namespace );
+ indexShowToplevel ( $namespace, $invert );
}
}
* @param integer $namespace A namespace constant (default NS_MAIN).
* @param string $from Article name we are starting listing at.
*/
-function namespaceForm ( $namespace = NS_MAIN, $from = '' ) {
+function namespaceForm ( $namespace = NS_MAIN, $from = '', $invert = 0) {
global $wgContLang, $wgScript;
-
$t = Title::makeTitle( NS_SPECIAL, "Allpages" );
$namespaceselect = '<select name="namespace">';
$frombox = '<input type="text" size="20" name="from" value="'
. htmlspecialchars ( $from ) . '"/>';
$submitbutton = '<input type="submit" value="' . wfMsg( 'allpagessubmit' ) . '" />';
+
+ $invertbox = "<input type='checkbox' name='invert' value='1'" . ( $invert == 1 ? ' checked="checked"' : '' ) . ' />';
$out = "<div class='namespaceselector'><form method='get' action='{$wgScript}'>";
$out .= '<input type="hidden" name="title" value="'.$t->getPrefixedText().'" />';
- $out .= wfMsg ( 'allpagesformtext1', $frombox ) . '<br />';
- $out .= wfMsg ( 'allpagesformtext2', $namespaceselect, $submitbutton );
+ $out .= wfMsg ( 'allpagesformtext', $frombox, $namespaceselect, $submitbutton, $invertbox );
$out .= '</form></div>';
return $out;
}
* @todo Document
* @param integer $namespace (default NS_MAIN)
*/
-function indexShowToplevel ( $namespace = NS_MAIN ) {
+function indexShowToplevel ( $namespace = NS_MAIN, $invert = 0 ) {
global $wgOut, $indexMaxperpage, $toplevelMaxperpage, $wgContLang, $wgRequest, $wgUser;
$sk = $wgUser->getSkin();
$fname = "indexShowToplevel";
$dbr =& wfGetDB( DB_SLAVE );
$page = $dbr->tableName( 'page' );
- $fromwhere = "FROM $page WHERE page_namespace=$namespace";
+ $invsql = ($invert) ? '!' : '';
+ $fromwhere = "FROM $page WHERE page_namespace$invsql=$namespace";
$order_arr = array ( 'ORDER BY' => 'page_title' );
$order_str = 'ORDER BY page_title';
$out = "";
$count = $dbr->selectField( 'page', 'COUNT(*)', $where, $fname );
$sections = ceil( $count / $indexMaxperpage );
-
+
if ( $sections < 3 ) {
# If there are only two or less sections, don't even display them.
# Instead, display the first section directly.
- indexShowChunk( '', $namespace );
+ indexShowChunk( $namespace, '', $invert );
return;
}
$lines = array();
# If we are going to show n rows, we need n+1 queries to find the relevant titles.
- for ( $i = $offset; $i <= $stopat; $i++ ) {
+ for ( $i = $offset; $i <= $stopat; ++$i ) {
if ( $i == $sections ) # if we're displaying the last section, we need to
$from = $count-1; # find the last page_title in the DB
else if ( $i > $offset )
$out .= indexShowline ( $inpoint, $outpoint, $namespace );
}
$out .= '</table>';
-
- $nsForm = namespaceForm ( $namespace );
+
+ $nsForm = namespaceForm ( $namespace, '', $invert );
# Is there more?
$morelinks = '';
return '<tr><td align="right">'.$out.'</td></tr>';
}
-function indexShowChunk( $from, $namespace = NS_MAIN ) {
+function indexShowChunk( $namespace = NS_MAIN, $from, $invert ) {
global $wgOut, $wgUser, $indexMaxperpage, $wgContLang;
$sk = $wgUser->getSkin();
$maxPlusOne = $indexMaxperpage + 1;
$fromTitle = Title::newFromURL( $from );
$fromKey = is_null( $fromTitle ) ? '' : $fromTitle->getDBkey();
- $sql = "SELECT page_title FROM $page WHERE page_namespace=$namespacee" .
+ $invsql = ($invert) ? '!' : '';
+ $sql = "SELECT page_title FROM $page WHERE page_namespace$invsql=$namespacee" .
" AND page_title >= ". $dbr->addQuotes( $fromKey ) .
" ORDER BY page_title LIMIT " . $maxPlusOne;
$res = $dbr->query( $sql, 'indexShowChunk' );
$out .= '</tr>';
}
$out .= '</table>';
-
- $nsForm = namespaceForm ( $namespace, $from );
+
+ $nsForm = namespaceForm ( $namespace, $from, $invert );
$out2 = '<table style="background: inherit;" width="100%" cellpadding="0" cellspacing="0" border="0">';
$out2 .= '<tr valign="top"><td align="left">' . $nsForm;
$out2 .= '</td><td align="right" style="font-size: smaller; margin-bottom: 1em;">' .
wfMsg ( 'allpages' ) );
if ( ($n == $indexMaxperpage) && ($s = $dbr->fetchObject( $res )) ) {
$namespaceparam = $namespace ? "&namespace=$namespace" : "";
+ $invertparam = $invert ? "&invert=$invert" : '';
$out2 .= " | " . $sk->makeKnownLink(
$wgContLang->specialPage( "Allpages" ),
wfMsg ( 'nextpage', $s->page_title ),
- "from=" . wfUrlEncode ( $s->page_title ) . $namespaceparam );
+ "from=" . wfUrlEncode ( $s->page_title ) . $namespaceparam . $invertparam );
}
$out2 .= "</td></tr></table><hr />";
$out .= '<input type="hidden" name="title" value="'.$wgContLang->specialpage( 'Contributions' ).'" />';
$out .= '<input type="hidden" name="target" value="'.htmlspecialchars( $target ).'" />';
$out .= '<input type="hidden" name="hideminor" value="'.$hideminor.'" />';
- $out .= wfMsg ( 'allpagesformtext2', $namespaceselect, $submitbutton );
+ $out .= wfMsg ( 'contributionsformtext', $namespaceselect, $submitbutton );
$out .= '</form></div>';
return $out;
}
# Special:Allpages
'nextpage' => 'Next page ($1)',
'articlenamespace' => '(articles)',
-'allpagesformtext1' => 'Display pages starting at: $1',
-'allpagesformtext2' => 'Choose namespace: $1 $2',
-'allarticles' => 'All articles',
-'allpagesprev' => 'Previous',
-'allpagesnext' => 'Next',
-'allpagesnamespace' => 'All pages ($1 namespace)',
-'allpagessubmit' => 'Go',
-
-# Email this user
+'allpagesformtext' => '
+<table border="0">
+ <tr>
+ <td align="right">Display pages starting at:</td>
+ <td align="left">$1</td>
+ </tr>
+ <tr>
+ <td align="right">Namespace:</td>
+ <td align="left">$2 $3</td>
+ </tr>
+ <tr>
+ <td align="right">$4</td>
+ <td align="left">Invert</td>
+ </tr>
+</table>',
+'allarticles' => 'All articles',
+'allnonarticles' => 'All non-articles',
+'allinnamespace' => 'All pages ($1 namespace)',
+'allnotinnamespace' => 'All pages (not in $1 namespace)',
+'allpagesprev' => 'Previous',
+'allpagesnext' => 'Next',
+'allpagessubmit' => 'Go',
+
+# E this user
#
'mailnologin' => 'No send address',
'mailnologintext' => "You must be <a href=\"{{localurl:Special:Userlogin\">logged in</a>
'contributions' => 'User contributions',
'mycontris' => 'My contributions',
'contribsub' => "For $1",
+'contributionsformtext' => '
+<table border="0">
+ <tr>
+ <td align="right">Namespace:</td>
+ <td align="left">$1 $2</td>
+ </tr>
+</table>',
'nocontribs' => 'No changes were found matching these criteria.',
'ucnote' => "Below are this user's last <b>$1</b> changes in the last <b>$2</b> days.",
'uclinks' => "View the last $1 changes; view the last $2 days.",
global $wgUser, $wgLocalTZoffset;
if (!$tz) {
- $tz = $wgUser->getOption( 'timecorrection' );
+ $tz = $wgUser->getOption( 'timecorrection' );
}
if ( $tz === '' ) {
}
return $this->formatNum( $t );
}
-
+
function timeanddate( $ts, $adj = false, $format = MW_DATE_USER_FORMAT, $timecorrection = false, $dateandtime = false) {
global $wgUser;
$ts=wfTimestamp(TS_MW,$ts);
# Special:Allpages
'nextpage' => 'Next page ($1)',
'articlenamespace' => '(artículos)',
-'allpagesformtext1' => 'Mostrar páginas que comiencen por: $1',
-'allpagesformtext2' => 'Elige espacio de nombres: $1 $2',
'allarticles' => 'Todos los artículos',
'allpagesprev' => 'Anterior',
'allpagesnext' => 'Siguiente',
-'allpagesnamespace' => 'Todas las páginas (espacio $1)',
+'allinnamespace' => 'Todas las páginas (espacio $1)',
'allpagessubmit' => 'Mostrar',
# Patrolling
'allarticles' => 'Kaikki artikkelit',
'allpagesprev' => 'Edellinen',
'allpagesnext' => 'Seuraaa',
-'allpagesnamespace' => 'Kaikki sivut (nimiavaruudessa $1 )',
+'allinnamespace' => 'Kaikki sivut (nimiavaruudessa $1 )',
'allpagessubmit' => 'Mene',
# Email this user
# All pages
#
-'allpagesformtext1' => "Afficher les pages à partir de : $1",
-'allpagesformtext2' => "Choisir un <i>namespace</i> : $1 $2",
-'allpagesnamespace' => "Toutes les pages (espace $1)",
+'allinnamespace' => "Toutes les pages (espace $1)",
'allpagesnext' => "Suivant",
'allpagesprev' => "Précédent",
'allpagessubmit' => "Valider",
'allmessages' => 'Kerfismeldingar',
'allmessagestext' => 'Listi yfir meldingar í kerfismeldingarýminu.',
'allpages' => 'Allar síður',
-'allpagesformtext2' => 'Nafnrými: $1 $2',
'alphaindexline' => '$1 til $2',
'alreadyloggedin' => '<font color=red><b>Notandinn $1 er þegar innskráður!</b></font><br />',
'ancientpages' => 'Elstu síður',
# Special:Allpages
'nextpage' => 'tokamen Siet ($1)',
'articlenamespace' => '(Artikels)',
-'allpagesformtext1' => 'Wies Sieten, anfungen bi: $1',
-'allpagesformtext2' => 'Wähl Naamruum: $1 $2',
'allarticles' => 'Alle Artikels',
'allpagesprev' => 'vörig',
'allpagesnext' => 'tokamen',
-'allpagesnamespace' => 'Alle Sieten ($1 Naamruum)',
+'allinnamespace' => 'Alle Sieten ($1 Naamruum)',
'allpagessubmit' => 'Los',
# Oppasslist
# Special:Allpages
'nextpage' => 'Neste side ($1)',
'articlenamespace' => '(innhaldssider)',
-'allpagesformtext1' => 'Vis sider frå: $1',
-'allpagesformtext2' => 'Velj namnerom: $1 $2',
'allarticles' => 'Alle innhaldssider',
'allpagesprev' => 'Førre',
'allpagesnext' => 'Neste',
-'allpagesnamespace' => 'Alle sider ($1 namnerom)',
+'allinnamespace' => 'Alle sider ($1 namnerom)',
'allpagessubmit' => 'Utfør',
# Email this user
# Special:Allpages
'nextpage' => 'Следующая страница ($1)',
'articlenamespace' => '(статьи)',
-'allpagesformtext1' => 'Показать страницы начиная с: $1',
-'allpagesformtext2' => 'Выберите пространство имён: $1 $2',
'allarticles' => 'Все статьи',
'allpagesprev' => 'Предыдущие',
'allpagesnext' => 'Следующие',
-'allpagesnamespace' => 'Все страницы ($1 пространство имён)',
+'allinnamespace' => 'Все страницы ($1 пространство имён)',
'allpagessubmit' => 'Выполнить',
# Email this user
'allmessages' => "系统界面", //"All system messages",
'allmessagesnotsupportedDB' => "系统界面功能处于关闭状态 (wgUseDatabaseMessages)。", //"Special:AllMessages not supported because wgUseDatabaseMessages is off.",
'allmessagestext' => "这里列出所有可定制的系统界面。", //"This is a list of all system messages available in the MediaWiki: namespace.",
-'allpagesformtext1' => "列出从 $1 起的条目", //"Display pages starting at: $1",
-'allpagesformtext2' => "选定名字空间: $1 $2", //"Choose namespace: $1 $2",
-'allpagesnamespace' => "所有 $1 名字空间的条目", //"All pages ($1 namespace)",
+'allinnamespace' => "所有 $1 名字空间的条目", //"All pages ($1 namespace)",
'allpagesnext' => "下一页", //"Next",
'allpagesprev' => "上一页", //"Previous",
'allpagessubmit' => "提交", //"Go",
'allmessages' => "系統界面", //"All system messages",
'allmessagesnotsupportedDB' => "系統界面功能處於關閉狀態 (wgUseDatabaseMessages)。", //"Special:AllMessages not supported because wgUseDatabaseMessages is off.",
'allmessagestext' => "這裡列出所有可定製的系統界面。", //"This is a list of all system messages available in the MediaWiki: namespace.",
-'allpagesformtext1' => "列出從 $1 起的條目", //"Display pages starting at: $1",
-'allpagesformtext2' => "選定名字空間: $1 $2", //"Choose namespace: $1 $2",
-'allpagesnamespace' => "所有 $1 名字空間的條目", //"All pages ($1 namespace)",
+'allinnamespace' => "所有 $1 名字空間的條目", //"All pages ($1 namespace)",
'allpagesnext' => "下一頁", //"Next",
'allpagesprev' => "上一頁", //"Previous",
'allpagessubmit' => "提交", //"Go",