* (bug 1120) Updated the Czech translation
* A new magic word, {{SCRIPTPATH}}, returns $wgScriptPath
* A new magic word, {{SERVERNAME}}, returns $wgServerName
+* A new magic word, {{NUMBEROFFILES}}, returns the number of rows in the image table
* Special:Imagelist displays titles with " " instead of "_"
* Less gratuitous munging of content sample in delete summary
* badaccess/badaccesstext to supercede sysop*, developer* messages
define('MAG_REVISIONID', 40);
define('MAG_SCRIPTPATH', 41);
define('MAG_SERVERNAME', 42);
+define('MAG_NUMBEROFFILES', 43);
$wgVariableIDs = array(
MAG_CURRENTMONTH,
MAG_CURRENTYEAR,
MAG_CURRENTTIME,
MAG_NUMBEROFARTICLES,
+ MAG_NUMBEROFFILES,
MAG_SITENAME,
MAG_SERVER,
MAG_SERVERNAME,
return $varCache[$index] = $wgContLang->formatNum( date('w') );
case MAG_NUMBEROFARTICLES:
return $varCache[$index] = $wgContLang->formatNum( wfNumberOfArticles() );
+ case MAG_NUMBEROFFILES:
+ return $varCache[$index] = $wgContLang->formatNum( wfNumberOfFiles() );
case MAG_SITENAME:
return $wgSitename;
case MAG_SERVER:
return $wgNumberOfArticles;
}
+/**
+ * Return the number of files
+ */
+function wfNumberOfFiles() {
+ $fname = 'Parser::wfNumberOfFiles';
+
+ wfProfileIn( $fname );
+ $dbr =& wfGetDB( DB_SLAVE );
+ $res = $dbr->selectField('image', 'COUNT(*)', array(), $fname );
+ wfProfileOut( $fname );
+
+ return $res;
+}
+
/**
* Get various statistics from the database
* @private
MAG_CURRENTYEAR => array( 1, 'CURRENTYEAR' ),
MAG_CURRENTTIME => array( 1, 'CURRENTTIME' ),
MAG_NUMBEROFARTICLES => array( 1, 'NUMBEROFARTICLES' ),
+ MAG_NUMBEROFFILES => array( 1, 'NUMBEROFFILES' ),
MAG_PAGENAME => array( 1, 'PAGENAME' ),
MAG_PAGENAMEE => array( 1, 'PAGENAMEE' ),
MAG_NAMESPACE => array( 1, 'NAMESPACE' ),