* Load the revision (including text) into this object
*/
function loadContent() {
- global $wgOut, $wgRequest;
-
if ( $this->mContentLoaded ) return;
# Query variables :P
* @access private
*/
function loadLastEdit() {
- global $wgOut;
-
if ( -1 != $this->mUser )
return;
* @access private
*/
function insertNewArticle( $text, $summary, $isminor, $watchthis, $suppressRC=false, $comment=false ) {
- global $wgOut, $wgUser, $wgUseSquid;
+ global $wgUser;
$fname = 'Article::insertNewArticle';
wfProfileIn( $fname );
* first set $wgUser, and clean up $wgDeferredUpdates after each edit.
*/
function updateArticle( $text, $summary, $minor, $watchthis, $forceBot = false, $sectionanchor = '' ) {
- global $wgOut, $wgUser, $wgDBtransactions, $wgMwRedir, $wgUseSquid;
+ global $wgUser, $wgDBtransactions, $wgUseSquid;
global $wgPostCommitUpdateList, $wgUseFileCache;
$fname = 'Article::updateArticle';
* the link tables and redirect to the new page.
*/
function showArticle( $text, $subtitle , $sectionanchor = '', $me2, $now, $summary, $oldid ) {
- global $wgOut, $wgUser;
- global $wgUseEnotif;
+ global $wgOut;
$fname = 'Article::showArticle';
wfProfileIn( $fname );
* @return bool true on success
*/
function updateRestrictions( $limit = array(), $reason = '' ) {
- global $wgUser, $wgOut, $wgRequest;
+ global $wgUser;
if ( !$wgUser->isAllowed( 'protect' ) ) {
return false;
* Perform a deletion and output success or failure messages
*/
function doDelete( $reason ) {
- global $wgOut, $wgUser, $wgContLang;
+ global $wgOut, $wgUser;
$fname = 'Article::doDelete';
wfDebug( $fname."\n" );
* Returns success
*/
function doDeleteArticle( $reason ) {
- global $wgUser, $wgUseSquid, $wgDeferredUpdateList;
+ global $wgUseSquid, $wgDeferredUpdateList;
global $wgPostCommitUpdateList, $wgUseTrackbacks;
$fname = 'Article::doDeleteArticle';
# Parse the text
$options = new ParserOptions;
- $options->setTidy(true);
+ $options->setTidy(true);
$poutput = $wgParser->parse( $text, $this->mTitle, $options, true, true, $newid );
# Save it to the parser cache
$touched = $this->mTouched;
$cache = new CacheManager( $this->mTitle );
if($cache->isFileCacheGood( $touched )) {
- global $wgOut;
wfDebug( " tryFileCache() - about to load\n" );
$cache->loadFromFileCache();
return true;
function insertTimestamp(&$s, &$rc) {
global $wgLang;
- # Timestamp
- $s .= '; ' . $wgLang->time( $rc->mAttribs['rc_timestamp'], true, true ) . ' . . ';
+ # Timestamp
+ $s .= '; ' . $wgLang->time( $rc->mAttribs['rc_timestamp'], true, true ) . ' . . ';
}
/** Insert links to user page, user talk page and eventually a blocking link */
* Format a line using the old system (aka without any javascript).
*/
function recentChangesLine( &$rc, $watched = false ) {
- global $wgLang, $wgContLang, $wgUser, $wgSysopUserBans;
+ global $wgContLang;
$fname = 'ChangesList::recentChangesLineOld';
wfProfileIn( $fname );
* Format a line for enhanced recentchange (aka with javascript and block of lines).
*/
function recentChangesLine( &$baseRC, $watched = false ) {
- global $wgLang, $wgContLang, $wgUser, $wgSysopUserBans;
+ global $wgLang, $wgContLang;
# Create a specialised object
$rc = RCCacheEntry::newFromParent( $baseRC );
* This is largely cadged from PageHistory::history
*/
function showCreditsPage($article) {
- global $wgOut;
+ global $wgOut;
- $fname = 'showCreditsPage';
+ $fname = 'showCreditsPage';
- wfProfileIn( $fname );
-
- $wgOut->setPageTitle( $article->mTitle->getPrefixedText() );
- $wgOut->setSubtitle( wfMsg( 'creditspage' ) );
- $wgOut->setArticleFlag( false );
- $wgOut->setArticleRelated( true );
- $wgOut->setRobotpolicy( 'noindex,nofollow' );
-
- if( $article->mTitle->getArticleID() == 0 ) {
+ wfProfileIn( $fname );
+
+ $wgOut->setPageTitle( $article->mTitle->getPrefixedText() );
+ $wgOut->setSubtitle( wfMsg( 'creditspage' ) );
+ $wgOut->setArticleFlag( false );
+ $wgOut->setArticleRelated( true );
+ $wgOut->setRobotpolicy( 'noindex,nofollow' );
+
+ if( $article->mTitle->getArticleID() == 0 ) {
$s = wfMsg( 'nocredits' );
- } else {
+ } else {
$s = getCredits($article, -1);
- }
+ }
- $wgOut->addHTML( $s );
+ $wgOut->addHTML( $s );
- wfProfileOut( $fname );
+ wfProfileOut( $fname );
}
function getCredits($article, $cnt, $showIfMax=true) {
$fname = 'getCredits';
wfProfileIn( $fname );
- $s = '';
+ $s = '';
- if (isset($cnt) && $cnt != 0) {
+ if (isset($cnt) && $cnt != 0) {
$s = getAuthorCredits($article);
if ($cnt > 1 || $cnt < 0) {
$s .= ' ' . getContributorCredits($article, $cnt - 1, $showIfMax);
}
- }
+ }
wfProfileOut( $fname );
- return $s;
+ return $s;
}
/**
*
*/
function getAuthorCredits($article) {
- global $wgLang, $wgAllowRealName;
+ global $wgLang, $wgAllowRealName;
- $last_author = $article->getUser();
+ $last_author = $article->getUser();
- if ($last_author == 0) {
+ if ($last_author == 0) {
$author_credit = wfMsg('anonymous');
- } else {
+ } else {
if($wgAllowRealName) { $real_name = User::whoIsReal($last_author); }
$user_name = User::whoIs($last_author);
} else {
$author_credit = wfMsg('siteuser', creditLink($user_name));
}
- }
+ }
- $timestamp = $article->getTimestamp();
- if ($timestamp) {
+ $timestamp = $article->getTimestamp();
+ if ($timestamp) {
$d = $wgLang->timeanddate($article->getTimestamp(), true);
- } else {
+ } else {
$d = '';
- }
- return wfMsg('lastmodifiedby', $d, $author_credit);
+ }
+ return wfMsg('lastmodifiedby', $d, $author_credit);
}
/**
*/
function getContributorCredits($article, $cnt, $showIfMax) {
- global $wgLang, $wgAllowRealName;
+ global $wgLang, $wgAllowRealName;
- $contributors = $article->getContributors();
+ $contributors = $article->getContributors();
- $others_link = '';
+ $others_link = '';
- # Hmm... too many to fit!
+ # Hmm... too many to fit!
- if ($cnt > 0 && count($contributors) > $cnt) {
+ if ($cnt > 0 && count($contributors) > $cnt) {
$others_link = creditOthersLink($article);
if (!$showIfMax) {
return wfMsg('othercontribs', $others_link);
} else {
$contributors = array_slice($contributors, 0, $cnt);
}
- }
+ }
- $real_names = array();
- $user_names = array();
+ $real_names = array();
+ $user_names = array();
- $anon = '';
+ $anon = '';
- # Sift for real versus user names
+ # Sift for real versus user names
- foreach ($contributors as $user_parts) {
+ foreach ($contributors as $user_parts) {
if ($user_parts[0] != 0) {
if ($wgAllowRealName && !empty($user_parts[2])) {
$real_names[] = creditLink($user_parts[1], $user_parts[2]);
} else {
$anon = wfMsg('anonymous');
}
- }
+ }
- # Two strings: real names, and user names
+ # Two strings: real names, and user names
- $real = $wgLang->listToText($real_names);
- $user = $wgLang->listToText($user_names);
+ $real = $wgLang->listToText($real_names);
+ $user = $wgLang->listToText($user_names);
- # "ThisSite user(s) A, B and C"
+ # "ThisSite user(s) A, B and C"
- if (!empty($user)) {
- $user = wfMsg('siteusers', $user);
- }
+ if (!empty($user)) {
+ $user = wfMsg('siteusers', $user);
+ }
- # This is the big list, all mooshed together. We sift for blank strings
+ # This is the big list, all mooshed together. We sift for blank strings
- $fulllist = array();
+ $fulllist = array();
- foreach (array($real, $user, $anon, $others_link) as $s) {
+ foreach (array($real, $user, $anon, $others_link) as $s) {
if (!empty($s)) {
array_push($fulllist, $s);
}
- }
+ }
- # Make the list into text...
+ # Make the list into text...
- $creds = $wgLang->listToText($fulllist);
+ $creds = $wgLang->listToText($fulllist);
- # "Based on work by ..."
+ # "Based on work by ..."
- return (empty($creds)) ? '' : wfMsg('othercontribs', $creds);
+ return (empty($creds)) ? '' : wfMsg('othercontribs', $creds);
}
/**
*
*/
function creditLink($user_name, $link_text = '') {
- global $wgUser, $wgContLang;
- $skin = $wgUser->getSkin();
- return $skin->makeLink($wgContLang->getNsText(NS_USER) . ':' . $user_name,
- htmlspecialchars( (empty($link_text)) ? $user_name : $link_text ));
+ global $wgUser, $wgContLang;
+ $skin = $wgUser->getSkin();
+ return $skin->makeLink($wgContLang->getNsText(NS_USER) . ':' . $user_name,
+ htmlspecialchars( (empty($link_text)) ? $user_name : $link_text ));
}
/**
*
*/
function creditOthersLink($article) {
- global $wgUser, $wgLang;
- $skin = $wgUser->getSkin();
- return $skin->makeKnownLink($article->mTitle->getPrefixedText(), wfMsg('others'), 'action=credits');
+ global $wgUser;
+ $skin = $wgUser->getSkin();
+ return $skin->makeKnownLink($article->mTitle->getPrefixedText(), wfMsg('others'), 'action=credits');
}
?>
* If errors are explicitly ignored, returns success
*/
function query( $sql, $fname = '', $tempIgnore = false ) {
- global $wgProfiling, $wgCommandLineMode;
+ global $wgProfiling;
if ( $wgProfiling ) {
# generalizeSQL will probably cut down the query to reasonable
# return "TO_TIMESTAMP('" . $this->strencode(wfTimestamp(TS_DB, $ts)) . "', 'RRRR-MM-DD HH24:MI:SS')";
}
- /**
- * Return aggregated value function call
- */
- function aggregateValue ($valuedata,$valuename='value') {
- return $valuedata;
- }
+ /**
+ * Return aggregated value function call
+ */
+ function aggregateValue ($valuedata,$valuename='value') {
+ return $valuedata;
+ }
function reportQueryError( $error, $errno, $sql, $fname, $tempIgnore = false ) {
function immediateCommit( $fname = 'Database::immediateCommit' ) {
oci_commit($this->mConn);
$this->mTrxLevel = 0;
- }
+ }
function rollback( $fname = 'Database::rollback' ) {
oci_rollback($this->mConn);
$this->mTrxLevel = 0;
function fetchRow( $res ) {
@$row = pg_fetch_array( $res );
if( pg_last_error($this->mConn) ) {
- wfDebugDieBacktrace( 'SQL error: ' . htmlspecialchars( pg_last_error($this->mConn) ) );
- }
+ wfDebugDieBacktrace( 'SQL error: ' . htmlspecialchars( pg_last_error($this->mConn) ) );
+ }
return $row;
}
}
function limitResult($sql, $limit,$offset) {
- return "$sql LIMIT $limit ".(is_numeric($offset)?" OFFSET {$offset} ":"");
+ return "$sql LIMIT $limit ".(is_numeric($offset)?" OFFSET {$offset} ":"");
}
/**
return wfTimestamp(TS_DB,$ts);
}
- /**
- * Return aggregated value function call
- */
- function aggregateValue ($valuedata,$valuename='value') {
- return $valuedata;
- }
+ /**
+ * Return aggregated value function call
+ */
+ function aggregateValue ($valuedata,$valuename='value') {
+ return $valuedata;
+ }
function reportQueryError( $error, $errno, $sql, $fname, $tempIgnore = false ) {
# If the port is a non-standard one, add it to the URL
if( isset( $_SERVER['SERVER_PORT'] )
&& ( ( $wgProto == 'http' && $_SERVER['SERVER_PORT'] != 80 )
- || ( $wgProto == 'https' && $_SERVER['SERVER_PORT'] != 443 ) ) ) {
+ || ( $wgProto == 'https' && $_SERVER['SERVER_PORT'] != 443 ) ) ) {
$wgServer .= ":" . $_SERVER['SERVER_PORT'];
}
}
function showDiffPage() {
- global $wgUser, $wgOut, $wgContLang, $wgOnlySysopsCanPatrol,
- $wgUseExternalEditor, $wgUseRCPatrol;
+ global $wgUser, $wgOut, $wgContLang, $wgOnlySysopsCanPatrol;
+ global $wgUseExternalEditor, $wgUseRCPatrol;
$fname = 'DifferenceEngine::showDiffPage';
wfProfileIn( $fname );
* Returns false on error
*/
function getDiffBody() {
- global $wgContLang, $wgMemc, $wgDBname;
+ global $wgMemc, $wgDBname;
$fname = 'DifferenceEngine::getDiffBody';
wfProfileIn( $fname );
}
function _start_block( $header ) {
- global $wgOut;
echo $header;
}
* the newly-edited page.
*/
function edit() {
- global $wgOut, $wgUser, $wgRequest, $wgTitle,
- $wgEmailConfirmToEdit;
+ global $wgOut, $wgUser, $wgRequest, $wgTitle;
+ global $wgEmailConfirmToEdit;
if ( ! wfRunHooks( 'AlternateEdit', array( &$this ) ) )
return;
} else if(preg_match("/\\.js$/", $wgTitle->getText() ) ) {
$previewtext = wfMsg('userjspreview');
}
- $parserOptions->setTidy(true);
+ $parserOptions->setTidy(true);
$parserOutput = $wgParser->parse( $previewtext , $wgTitle, $parserOptions );
$wgOut->addHTML( $parserOutput->mText );
wfProfileOut( $fname );
}
if ( $this->mMetaData != "" ) $toparse .= "\n" . $this->mMetaData ;
- $parserOptions->setTidy(true);
+ $parserOptions->setTidy(true);
$parserOutput = $wgParser->parse( $this->mArticle->preSaveTransform( $toparse ) ."\n\n",
$wgTitle, $parserOptions );
* @return string HTML
*/
function getDiff() {
- global $wgUser;
-
require_once( 'DifferenceEngine.php' );
$oldtext = $this->mArticle->fetchContent();
$newtext = $this->mArticle->replaceSection(
}
function fetchFromURL($url) {
- global $wgExternalServers;
#
# URLs have the form DB://cluster/id or DB://cluster/id/itemid for concatenated storage
#
* @return string URL
*/
function store( $cluster, $data ) {
- global $wgExternalServers;
$fname = 'ExternalStoreDB::store';
$dbw =& $this->getMaster( $cluster );
class ExternalStoreHttp {
/* Fetch data from given URL */
function fetchFromURL($url) {
- ini_set( "allow_url_fopen", true );
- $ret = file_get_contents( $url );
- ini_set( "allow_url_fopen", false );
+ ini_set( "allow_url_fopen", true );
+ $ret = file_get_contents( $url );
+ ini_set( "allow_url_fopen", false );
return $ret;
}
* @todo document
*/
function outHeader() {
- global $wgVersion, $wgOut;
+ global $wgVersion;
$this->outXmlHeader();
?><feed xmlns="http://www.w3.org/2005/Atom" xml:lang="<?php print $this->getLanguage() ?>">
* @todo document
*/
function wfViewPrevNext( $offset, $limit, $link, $query = '', $atend = false ) {
- global $wgUser, $wgLang;
+ global $wgLang;
$fmtLimit = $wgLang->formatNum( $limit );
$prev = wfMsg( 'prevn', $fmtLimit );
$next = wfMsg( 'nextn', $fmtLimit );
* @todo document
*/
function wfNumLink( $offset, $limit, &$title, $query = '' ) {
- global $wgUser, $wgLang;
+ global $wgLang;
if ( '' == $query ) { $q = ''; }
else { $q = $query.'&'; }
$q .= 'limit='.$limit.'&offset='.$offset;
/**
* @param mixed $outputtype A timestamp in one of the supported formats, the
- * function will autodetect which format is supplied
- and act accordingly.
+ * function will autodetect which format is supplied
+ and act accordingly.
* @return string Time in the format specified in $outputtype
*/
function wfTimestamp($outputtype=TS_UNIX,$ts=0) {
/**
* Increment a statistics counter
*/
-function wfIncrStats( $key ) {
- global $wgDBname, $wgMemc;
- /* LIVE HACK AVOID MEMCACHED ACCESSES DURING HIGH LOAD */
- if ($wgDBname != 'enwiki' and $wgDBname != 'dewiki' and $wgDBname != 'commonswiki' and $wgDBname != 'testwiki')
- return true;
- static $socket;
- if (!$socket) {
- $socket=socket_create(AF_INET, SOCK_DGRAM, SOL_UDP);
- $statline="{$wgDBname} - 1 1 1 1 1 -total\n";
- socket_sendto($socket,$statline,strlen($statline),0,"webster","3811");
- }
- $statline="{$wgDBname} - 1 1 1 1 1 {$key}\n";
- socket_sendto($socket,$statline,strlen($statline),0,"webster","3811");
- return true;
-
- $key = "$wgDBname:stats:$key";
- if ( is_null( $wgMemc->incr( $key ) ) ) {
- $wgMemc->add( $key, 1 );
- }
-}
+ function wfIncrStats( $key ) {
+ global $wgDBname, $wgMemc;
+ /* LIVE HACK AVOID MEMCACHED ACCESSES DURING HIGH LOAD */
+ if ($wgDBname != 'enwiki' and $wgDBname != 'dewiki' and $wgDBname != 'commonswiki' and $wgDBname != 'testwiki')
+ return true;
+ static $socket;
+ if (!$socket) {
+ $socket=socket_create(AF_INET, SOCK_DGRAM, SOL_UDP);
+ $statline="{$wgDBname} - 1 1 1 1 1 -total\n";
+ socket_sendto($socket,$statline,strlen($statline),0,"webster","3811");
+ }
+ $statline="{$wgDBname} - 1 1 1 1 1 {$key}\n";
+ socket_sendto($socket,$statline,strlen($statline),0,"webster","3811");
+ return true;
+
+ $key = "$wgDBname:stats:$key";
+ if ( is_null( $wgMemc->incr( $key ) ) ) {
+ $wgMemc->add( $key, 1 );
+ }
+ }
/**
* @param mixed $nr The number to format
* @param integer $id Group database id
*/
function newFromId($id) {
- global $wgMemc, $wgDBname;
+ global $wgMemc;
$fname = 'Group::newFromId';
$staticGroups =& Group::getStaticGroups();
/**
* Sets the location (old_id) of the referring object
*/
- function setReferrer( $id ) {
- $this->mRef = $id;
- }
+ function setReferrer( $id ) {
+ $this->mRef = $id;
+ }
/**
* Gets the location of the referring object
*/
- function getReferrer() {
- return $this->mRef;
- }
+ function getReferrer() {
+ return $this->mRef;
+ }
/** @todo document */
function getText() {
* if $timeout is 'default', $wgHTTPTimeout is used
*/
function wfGetHTTP( $url, $timeout = 'default' ) {
- global $wgHTTPTimeout, $wgHTTPProxy, $wgVersion, $wgTitle, $wgCommandLineMode;
+ global $wgHTTPTimeout, $wgHTTPProxy, $wgVersion, $wgTitle;
# Use curl if available
if ( function_exists( 'curl_init' ) ) {
* Load metadata from the file itself
*/
function loadFromFile() {
- global $wgUseSharedUploads, $wgSharedUploadDirectory, $wgContLang,
- $wgShowEXIF;
+ global $wgUseSharedUploads, $wgSharedUploadDirectory, $wgContLang, $wgShowEXIF;
$fname = 'Image::loadFromFile';
wfProfileIn( $fname );
$this->imagePath = $this->getFullPath();
$base = $wgUploadBaseUrl;
$path = $wgUploadPath;
}
- $url = "{$base}{$path}" . wfGetHashPath($name, $fromSharedDirectory) . "{$name}";
- return wfUrlencode( $url );
+ $url = "{$base}{$path}" . wfGetHashPath($name, $fromSharedDirectory) . "{$name}";
+ return wfUrlencode( $url );
}
/**
*/
function renderThumb( $width, $useScript = true ) {
global $wgUseSquid, $wgInternalServer;
- global $wgThumbnailScriptPath, $wgSharedThumbnailScriptPath;
global $wgSVGMaxSize, $wgMaxImageArea, $wgThumbnailEpoch;
$fname = 'Image::renderThumb';
* @access private
*/
function reallyRenderThumb( $thumbPath, $width, $height ) {
- global $wgSVGConverters, $wgSVGConverter,
- $wgUseImageMagick, $wgImageMagickConvertCommand;
+ global $wgSVGConverters, $wgSVGConverter;
+ global $wgUseImageMagick, $wgImageMagickConvertCommand;
$this->load();
}
function checkDBSchema(&$db) {
- global $wgCheckDBSchema;
+ global $wgCheckDBSchema;
if (!$wgCheckDBSchema) {
return;
}
* @access public
*/
function wfImageArchiveDir( $fname , $subdir='archive', $shared=false ) {
- global $wgUploadDirectory, $wgHashedUploadDirectory,
- $wgSharedUploadDirectory, $wgHashedSharedUploadDirectory;
+ global $wgUploadDirectory, $wgHashedUploadDirectory;
+ global $wgSharedUploadDirectory, $wgHashedSharedUploadDirectory;
$dir = $shared ? $wgSharedUploadDirectory : $wgUploadDirectory;
$hashdir = $shared ? $wgHashedSharedUploadDirectory : $wgHashedUploadDirectory;
if (!$hashdir) { return $dir.'/'.$subdir; }
}
function doDelete() {
- global $wgOut, $wgUser, $wgRequest, $wgUseSquid, $wgInternalServer;
+ global $wgOut, $wgRequest, $wgUseSquid, $wgInternalServer;
global $wgPostCommitUpdateList;
$fname = 'ImagePage::doDelete';
* @param mixed $version The version of MediaWiki needed to use the page
*/
function versionRequired( $version ) {
- global $wgUser;
-
$this->setPageTitle( wfMsg( 'versionrequired', $version ) );
$this->setHTMLTitle( wfMsg( 'versionrequired', $version ) );
$this->setRobotpolicy( 'noindex,nofollow' );
*/
function headElement() {
global $wgDocType, $wgDTD, $wgContLanguageCode, $wgOutputEncoding, $wgMimeType;
- global $wgUser, $wgContLang, $wgRequest, $wgUseTrackbacks, $wgTitle;
+ global $wgUser, $wgContLang, $wgUseTrackbacks, $wgTitle;
if( $wgMimeType == 'text/xml' || $wgMimeType == 'application/xhtml+xml' || $wgMimeType == 'application/xml' ) {
$ret = "<?xml version=\"1.0\" encoding=\"$wgOutputEncoding\" ?>\n";
}
function getHeadLinks() {
- global $wgRequest, $wgStylePath;
+ global $wgRequest;
$ret = '';
foreach ( $this->mMetatags as $tag ) {
if ( 0 == strcasecmp( 'http:', substr( $tag[0], 0, 5 ) ) ) {
* @returns nothing
*/
function history() {
- global $wgUser, $wgOut, $wgRequest, $wgTitle;
+ global $wgOut, $wgRequest, $wgTitle;
/*
* Allow client caching.
/** @todo document */
function fetchRevisions($limit, $offset, $direction) {
- global $wgUser, $wgShowUpdatedMarker;
$fname = 'PageHistory::fetchRevisions';
$dbr =& wfGetDB( DB_SLAVE );
/** @todo document */
function makeNavbar($revisions, $offset, $limit, $direction) {
- global $wgTitle, $wgLang;
+ global $wgLang;
$revisions = array_slice($revisions, 0, $limit);
* @access private
*/
function internalParse( $text ) {
- global $wgContLang;
$args = array();
$isMain = true;
$fname = 'Parser::internalParse';
* @access private
*/
function getUserSig( &$user ) {
- global $wgContLang;
-
$username = $user->getName();
$nickname = $user->getOption( 'nickname' );
$nickname = $nickname === '' ? $username : $nickname;
* @return string
*/
function replaceLinkHoldersText( $text ) {
- global $wgUser;
- global $wgOutputReplace;
-
$fname = 'Parser::replaceLinkHoldersText';
wfProfileIn( $fname );
* Parse image options text and use it to make an image
*/
function makeImage( &$nt, $options ) {
- global $wgContLang, $wgUseImageResize, $wgUser;
+ global $wgUseImageResize;
$align = '';
/** Get user options */
function initialiseFromUser( &$userInput ) {
- global $wgUseTeX, $wgUseDynamicDates, $wgInterwikiMagic, $wgAllowExternalImages,
- $wgAllowExternalImagesFrom, $wgAllowSpecialInclusion;
+ global $wgUseTeX, $wgUseDynamicDates, $wgInterwikiMagic, $wgAllowExternalImages;
+ global $wgAllowExternalImagesFrom, $wgAllowSpecialInclusion;
$fname = 'ParserOptions::initialiseFromUser';
wfProfileIn( $fname );
if ( !$userInput ) {
}
function save( $parserOutput, &$article, &$user ){
- global $wgParserCacheExpireTime;
+ global $wgParserCacheExpireTime;
$key = $this->getKey( $article, $user );
$now = wfTimestampNow();
$parserOutput->setCacheTime( $now );
function wfProfileIn( $fn = '' ) {
global $hackwhere, $wgDBname, $haveProctitle;
if ($haveProctitle) {
- $hackwhere[] = $fn;
+ $hackwhere[] = $fn;
setproctitle($fn . " [$wgDBname]");
- }
+ }
}
function wfProfileOut( $fn = '' ) {
global $hackwhere, $wgDBname, $haveProctitle;
- if (!$haveProctitle)
- return;
- if (count($hackwhere))
+ if (!$haveProctitle)
+ return;
+ if (count($hackwhere))
array_pop($hackwhere);
if (count($hackwhere))
setproctitle($hackwhere[count($hackwhere)-1] . " [$wgDBname]");
}
function getArticleText() {
- global $wgParser;
-
if( $this->mTitle ) {
$text = '';
" $field @@ to_tsquery ('$match') " ;
}
- function update( $id, $title, $text ) {
- $dbw=& wfGetDB(DB_MASTER);
+ function update( $id, $title, $text ) {
+ $dbw=& wfGetDB(DB_MASTER);
$searchindex = $dbw->tableName( 'searchindex' );
$sql = "DELETE FROM $searchindex WHERE si_page={$id}";
$dbw->query($sql,"SearchTsearch2:update");
"'),to_tsvector('".
$dbw->strencode( $text)."')) ";
$dbw->query($sql,"SearchTsearch2:update");
- }
+ }
- function updateTitle($id,$title) {
- $dbw=& wfGetDB(DB_MASTER);
- $searchindex = $dbw->tableName( 'searchindex' );
- $sql = "UPDATE $searchindex SET si_title=to_tsvector('" .
- $db->strencode( $title ) .
- "') WHERE si_page={$id}";
+ function updateTitle($id,$title) {
+ $dbw=& wfGetDB(DB_MASTER);
+ $searchindex = $dbw->tableName( 'searchindex' );
+ $sql = "UPDATE $searchindex SET si_title=to_tsvector('" .
+ $db->strencode( $title ) .
+ "') WHERE si_page={$id}";
- $dbw->query( $sql, "SearchMySQL4::updateTitle" );
- }
+ $dbw->query( $sql, "SearchMySQL4::updateTitle" );
+ }
}
# get the user/site-specific stylesheet, SkinTemplate loads via RawPage.php (settings are cached that way)
function getUserStylesheet() {
- global $wgOut, $wgStylePath, $wgRequest, $wgContLang, $wgSquidMaxage;
+ global $wgStylePath, $wgRequest, $wgContLang, $wgSquidMaxage;
$sheet = $this->getStylesheet();
$action = $wgRequest->getText('action');
$s = "@import \"$wgStylePath/$sheet\";\n";
* Return html code that include User stylesheets
*/
function getUserStyles() {
- global $wgOut, $wgStylePath;
$s = "<style type='text/css'>\n";
$s .= "/*/*/ /*<![CDATA[*/\n"; # <-- Hide the styles from Netscape 4 without hiding them from IE/Mac
$s .= $this->getUserStylesheet();
* Some styles that are set by user through the user settings interface.
*/
function doGetUserStyles() {
- global $wgUser, $wgContLang, $wgUser, $wgRequest, $wgTitle, $wgAllowUserCss;
+ global $wgUser, $wgUser, $wgRequest, $wgTitle, $wgAllowUserCss;
$s = '';
}
function doBeforeContent() {
- global $wgOut, $wgTitle, $wgContLang;
+ global $wgContLang;
$fname = 'Skin::doBeforeContent';
wfProfileIn( $fname );
function doAfterContent() { }
function pageTitleLinks() {
- global $wgOut, $wgTitle, $wgUser, $wgContLang, $wgRequest;
+ global $wgOut, $wgTitle, $wgUser, $wgRequest;
extract( $wgRequest->getValues( 'oldid', 'diff' ) );
$action = $wgRequest->getText( 'action' );
}
function pageTitle() {
- global $wgOut, $wgTitle, $wgUser;
+ global $wgOut;
$s = '<h1 class="pagetitle">' . htmlspecialchars( $wgOut->getPageTitle() ) . '</h1>';
return $s;
}
function getCopyrightIcon() {
- global $wgRightsPage, $wgRightsUrl, $wgRightsText, $wgRightsIcon, $wgCopyrightIcon;
+ global $wgRightsUrl, $wgRightsText, $wgRightsIcon, $wgCopyrightIcon;
$out = '';
if ( isset( $wgCopyrightIcon ) && $wgCopyrightIcon ) {
$out = $wgCopyrightIcon;
* @TODO crash bug913. Need to be rewrote completly.
*/
function specialPagesList() {
- global $wgUser, $wgOut, $wgContLang, $wgServer, $wgRedirectScript, $wgAvailableRights;
+ global $wgUser, $wgContLang, $wgServer, $wgRedirectScript, $wgAvailableRights;
require_once('SpecialPage.php');
$a = array();
$pages = SpecialPage::getPages();
}
function editThisPage() {
- global $wgOut, $wgTitle, $wgRequest;
+ global $wgOut, $wgTitle;
if ( ! $wgOut->isArticleRelated() ) {
$s = wfMsg( 'protectedpage' );
}
function deleteThisPage() {
- global $wgUser, $wgOut, $wgTitle, $wgRequest;
+ global $wgUser, $wgTitle, $wgRequest;
$diff = $wgRequest->getVal( 'diff' );
if ( $wgTitle->getArticleId() && ( ! $diff ) && $wgUser->isAllowed('delete') ) {
}
function protectThisPage() {
- global $wgUser, $wgOut, $wgTitle, $wgRequest;
+ global $wgUser, $wgTitle, $wgRequest;
$diff = $wgRequest->getVal( 'diff' );
if ( $wgTitle->getArticleId() && ( ! $diff ) && $wgUser->isAllowed('protect') ) {
}
function watchThisPage() {
- global $wgUser, $wgOut, $wgTitle;
+ global $wgOut, $wgTitle;
if ( $wgOut->isArticleRelated() ) {
if ( $wgTitle->userIsWatching() ) {
}
function otherLanguages() {
- global $wgOut, $wgContLang, $wgTitle, $wgHideInterlanguageLinks;
+ global $wgOut, $wgContLang, $wgHideInterlanguageLinks;
if ( $wgHideInterlanguageLinks ) {
return '';
}
function commentLink() {
- global $wgContLang, $wgTitle;
+ global $wgTitle;
if ( $wgTitle->getNamespace() == NS_SPECIAL ) {
return '';
* @access private
*/
function buildSidebar() {
- global $wgTitle, $action, $wgDBname, $parserMemc;
+ global $wgDBname, $parserMemc;
global $wgLanguageCode, $wgContLanguageCode;
$fname = 'SkinTemplate::buildSidebar';
* @access private
*/
function buildPersonalUrls() {
- global $wgTitle, $wgShowIPinHeader, $wgContLang;
+ global $wgTitle, $wgShowIPinHeader;
$fname = 'SkinTemplate::buildPersonalUrls';
$pageurl = $wgTitle->getLocalURL();
* @access private
*/
function buildContentActionUrls () {
- global $wgContLang, $wgDBprefix;
+ global $wgContLang;
$fname = 'SkinTemplate::buildContentActionUrls';
wfProfileIn( $fname );
wfProfileIn( $fname );
global $wgUser, $wgRequest;
- global $wgSiteSupportPage, $wgEnableUploads, $wgUploadNavigationUrl;
+ global $wgEnableUploads, $wgUploadNavigationUrl;
$action = $wgRequest->getText( 'action' );
$oldid = $wgRequest->getVal( 'oldid' );
$diff = $wgRequest->getVal( 'diff' );
$nav_urls = array();
- $nav_urls['mainpage'] = array('href' => $this->makeI18nUrl('mainpage'));
+ $nav_urls['mainpage'] = array('href' => $this->makeI18nUrl('mainpage'));
if( $wgEnableUploads ) {
if ($wgUploadNavigationUrl) {
$nav_urls['upload'] = array('href' => $wgUploadNavigationUrl );
$fname = 'SkinTemplate::getUserStylesheet';
wfProfileIn( $fname );
- global $wgUser;
$s = "/* generated user stylesheet */\n";
$s .= $this->reallyDoGetUserStyles();
wfProfileOut( $fname );
* @param string $from Article name we are starting listing at.
*/
function namespaceForm ( $namespace = NS_MAIN, $from = '' ) {
- global $wgContLang, $wgScript;
+ global $wgScript;
$t = Title::makeTitle( NS_SPECIAL, $this->name );
$namespaceselect = HTMLnamespaceselector($namespace, null);
* @param integer $namespace (default NS_MAIN)
*/
function showToplevel ( $namespace = NS_MAIN, $including = false ) {
- global $wgOut, $wgContLang, $wgRequest, $wgUser;
+ global $wgOut, $wgUser;
$sk = $wgUser->getSkin();
$fname = "indexShowToplevel";
* @param integer $namespace (Default NS_MAIN)
*/
function showline( $inpoint, $outpoint, $namespace = NS_MAIN ) {
- global $wgOut, $wgUser;
+ global $wgUser;
$sk = $wgUser->getSkin();
$dbr =& wfGetDB( DB_SLAVE );
}
function showForm( $err ) {
- global $wgOut, $wgUser, $wgRequest, $wgSysopUserBans;
+ global $wgOut, $wgUser, $wgSysopUserBans;
$wgOut->setPagetitle( wfMsg( 'blockip' ) );
$wgOut->addWikiText( wfMsg( 'blockiptext' ) );
}
function showSuccess() {
- global $wgOut, $wgUser;
+ global $wgOut;
$wgOut->setPagetitle( wfMsg( 'blockip' ) );
$wgOut->setSubtitle( wfMsg( 'blockipsuccesssub' ) );
* @param string $par (optional) user name of the user for which to show the contributions
*/
function wfSpecialContributions( $par = null ) {
- global $wgUser, $wgOut, $wgLang, $wgContLang, $wgRequest, $wgTitle,
- $wgScript;
+ global $wgUser, $wgOut, $wgLang, $wgContLang, $wgRequest, $wgTitle, $wgScript;
$fname = 'wfSpecialContributions';
$target = isset($par) ? $par : $wgRequest->getVal( 'target' );
}
if ($wgRequest->getText('go') == 'first' && $target != 'newbies') {
- $prevts = $finder->get_first_offset_for_paging();
+ $prevts = $finder->get_first_offset_for_paging();
$prevurl = $title->getLocalURL($urlbits . "&offset=$prevts&limit=$limit$nsurl$boturl");
$wgOut->redirect($prevurl);
return;
$firstlink = "<a href=\"$myurl&limit=$limit$xnsurl$boturl&go=first\">$firsttext</a>";
$nextlink = "<a href=\"$myurl&offset=$lastts&limit=$limit$xnsurl$boturl\">$nexttext</a>";
}
- if ($target == 'newbies') {
- $firstlast ="($lastlink)";
- } else {
- $firstlast = "($lastlink | $firstlink)";
- }
+ if ($target == 'newbies') {
+ $firstlast ="($lastlink)";
+ } else {
+ $firstlast = "($lastlink | $firstlink)";
+ }
$urls = array();
foreach (array(20, 50, 100, 250, 500) as $num)
$fname = 'ucListEdit';
wfProfileIn( $fname );
- global $wgLang, $wgOut, $wgUser, $wgRequest;
+ global $wgLang, $wgUser, $wgRequest;
static $messages;
if( !isset( $messages ) ) {
foreach( explode( ' ', 'uctop diff newarticle rollbacklink diff hist minoreditletter' ) as $msg ) {
$dp = Title::newFromText(wfMsgForContent('disambiguationspage'));
$id = $dp->getArticleId();
- $dns = $dp->getNamespace();
- $dtitle = $dbr->addQuotes( $dp->getDBkey() );
+ $dns = $dp->getNamespace();
+ $dtitle = $dbr->addQuotes( $dp->getDBkey() );
if($dns != NS_TEMPLATE) {
# FIXME we assume the disambiguation message is a template but
function formatResult( $skin, $result ) {
$title = Title::newFromId( $result->value );
- $dp = Title::makeTitle( $result->namespace, $result->title );
+ $dp = Title::makeTitle( $result->namespace, $result->title );
$from = $skin->makeKnownLinkObj( $title,'');
$edit = $skin->makeBrokenLinkObj( $title, "(".wfMsg("qbedit").")" , 'redirect=no');
}
function showSuccess() {
- global $wgOut, $wgUser;
+ global $wgOut;
$wgOut->setPagetitle( wfMsg( "emailsent" ) );
$wgOut->addHTML( wfMsg( "emailsenttext" ) );
}
function newFromUpload( $fieldname = "xmlimport" ) {
- global $wgOut;
-
$upload =& $_FILES[$fieldname];
if( !isset( $upload ) ) {
}
function doSubmit() {
- global $wgOut, $wgUser;
+ global $wgOut;
$block = new Block();
$this->ip = trim( $this->ip );
}
function formatResult( $skin, $result ) {
- global $wgContLang;
-
# Make a link to the redirect itself
$rd_title = Title::makeTitle( $result->namespace, $result->title );
$rd_link = $skin->makeKnownLinkObj( $rd_title, '', 'redirect=no' );
}
function showSuccess() {
- global $wgOut, $wgUser;
+ global $wgOut;
$wgOut->setPagetitle( wfMsg( 'lockdb' ) );
$wgOut->setSubtitle( wfMsg( 'lockdbsuccesssub' ) );
*
*/
function wfSpecialNewimages( $par, $specialPage ) {
- global $wgUser, $wgOut, $wgLang, $wgContLang, $wgRequest,
- $wgGroupPermissions;
+ global $wgUser, $wgOut, $wgLang, $wgContLang, $wgRequest, $wgGroupPermissions;
$wpIlMatch = $wgRequest->getText( 'wpIlMatch' );
$dbr =& wfGetDB( DB_SLAVE );
# FIXME: text will break with compression
return
"SELECT 'Newpages' as type,
- rc_namespace AS namespace,
- rc_title AS title,
- rc_cur_id AS cur_id,
- rc_user AS user,
- rc_user_text AS user_text,
- rc_comment as comment,
- rc_timestamp AS timestamp,
- rc_timestamp AS value,
- '{$usepatrol}' as usepatrol,
- rc_patrolled AS patrolled,
- rc_id AS rcid,
- page_len as length,
- page_latest as rev_id
+ rc_namespace AS namespace,
+ rc_title AS title,
+ rc_cur_id AS cur_id,
+ rc_user AS user,
+ rc_user_text AS user_text,
+ rc_comment as comment,
+ rc_timestamp AS timestamp,
+ rc_timestamp AS value,
+ '{$usepatrol}' as usepatrol,
+ rc_patrolled AS patrolled,
+ rc_id AS rcid,
+ page_len as length,
+ page_latest as rev_id
FROM $recentchanges,$page
WHERE rc_cur_id=page_id AND rc_new=1
AND rc_namespace=" . $this->namespace . " AND page_is_redirect=0";
* @param $including output is being captured for use in {{special:whatever}}
*/
function executePath( &$title, $including = false ) {
- global $wgSpecialPages, $wgOut, $wgTitle;
+ global $wgOut, $wgTitle;
$fname = 'SpecialPage::executePath';
wfProfileIn( $fname );
* Checks user permissions, calls the function given in mFunction
*/
function execute( $par ) {
- global $wgUser, $wgOut, $wgTitle;
+ global $wgUser;
$this->setHeaders();
* @access private
*/
function savePreferences() {
- global $wgUser, $wgLang, $wgOut, $wgParser;
+ global $wgUser, $wgOut, $wgParser;
global $wgEnableUserEmail, $wgEnableEmail;
global $wgEmailAuthentication, $wgMinimalPasswordLength;
global $wgAuth;
* @access private
*/
function namespacesCheckboxes() {
- global $wgContLang, $wgUser;
+ global $wgContLang;
# Determine namespace checkboxes
$namespaces = $wgContLang->getNamespaces();
} else if ( '' != $status ) {
$wgOut->addWikitext( $message . "\n----" );
}
-
+
$qbs = $wgLang->getQuickbarSettings();
$skinNames = $wgLang->getSkinNames();
$mathopts = $wgLang->getMathNames();
# Enotif
if ($wgEnableEmail) {
$wgOut->addHTML( '<fieldset><legend>' . wfMsg( 'email' ) . '</legend>' );
- $wgOut->addHTML(
- $emailauthenticated.
- $enotifrevealaddr.
- $enotifwatchlistpages.
- $enotifusertalkpages.
- $enotifminoredits );
+ $wgOut->addHTML(
+ $emailauthenticated.
+ $enotifrevealaddr.
+ $enotifwatchlistpages.
+ $enotifusertalkpages.
+ $enotifminoredits );
if ($wgEnableUserEmail) {
$emf = wfMsg( 'allowemail' );
$disabled = $disableEmailPrefs ? ' disabled="disabled"' : '';
}
$wgOut->addHTML( '</fieldset>' );
- }
+ }
# </FIXME>
if ($wgAllowRealName || $wgEnableEmail) {
}
$wgOut->addHTML( "{$imageThumbOptions}</select></div></fieldset>\n\n");
- # Date format
- #
+ # Date format
+ #
# Date/Time
#
<input type='hidden' name='wpEditToken' value='{$token}' />
</div></form>\n" );
- $wgOut->addWikiText( '<div class="prefcache">' . wfMsg('clearyourcache') . '</div>' );
-
+ $wgOut->addWikiText( '<div class="prefcache">' . wfMsg('clearyourcache') . '</div>' );
+
}
}
?>
$fromTitle = Title::newFromURL( $from );
if ($namespace == NS_MAIN and $fromTitle) {
- $namespace = $fromTitle->getNamespace();
- }
+ $namespace = $fromTitle->getNamespace();
+ }
$fromKey = is_null( $fromTitle ) ? '' : $fromTitle->getDBkey();
}
function rcDoOutputFeed( $rows, &$feed ) {
- global $wgSitename, $wgFeedClasses, $wgContLanguageCode;
$fname = 'rcDoOutputFeed';
wfProfileIn( $fname );
* Makes change an option link which carries all the other options
*/
function makeOptionsLink( $title, $override, $options ) {
- global $wgUser, $wgLang, $wgContLang;
+ global $wgUser, $wgContLang;
$sk = $wgUser->getSkin();
return $sk->makeKnownLink( $wgContLang->specialPage( 'Recentchanges' ),
$title, wfArrayToCGI( $override, $options ) );
* @return string
*/
function rcNamespaceForm( $namespace, $invert, $nondefaults, $categories_any ) {
- global $wgContLang, $wgScript, $wgAllowCategorizedRecentChanges, $wgRequest;
+ global $wgScript, $wgAllowCategorizedRecentChanges, $wgRequest;
$t = Title::makeTitle( NS_SPECIAL, 'Recentchanges' );
$namespaceselect = HTMLnamespaceselector($namespace, '');
if( $nt->getNamespace() == NS_CATEGORY ) {
$catkey = $dbr->addQuotes( $nt->getDBKey() );
$sql = "SELECT /* wfSpecialRecentchangeslinked */
- rc_id,
- rc_cur_id,
- rc_namespace,
- rc_title,
- rc_this_oldid,
- rc_last_oldid,
- rc_user,
- rc_comment,
- rc_user_text,
- rc_timestamp,
- rc_minor,
- rc_new,
- rc_patrolled,
- rc_type
+ rc_id,
+ rc_cur_id,
+ rc_namespace,
+ rc_title,
+ rc_this_oldid,
+ rc_last_oldid,
+ rc_user,
+ rc_comment,
+ rc_user_text,
+ rc_timestamp,
+ rc_minor,
+ rc_new,
+ rc_patrolled,
+ rc_type
" . ($uid ? ",wl_user" : "") . "
- FROM $categorylinks, $recentchanges
+ FROM $categorylinks, $recentchanges
" . ($uid ? "LEFT OUTER JOIN $watchlist ON wl_user={$uid} AND wl_title=rc_title AND wl_namespace=rc_namespace " : "") . "
- WHERE rc_timestamp > '{$cutoff}'
- {$cmq}
- AND cl_from=rc_cur_id
- AND cl_to=$catkey
- GROUP BY rc_cur_id,rc_namespace,rc_title,
- rc_user,rc_comment,rc_user_text,rc_timestamp,rc_minor,
- rc_new
- ORDER BY rc_timestamp DESC
- LIMIT {$limit};
+ WHERE rc_timestamp > '{$cutoff}'
+ {$cmq}
+ AND cl_from=rc_cur_id
+ AND cl_to=$catkey
+ GROUP BY rc_cur_id,rc_namespace,rc_title,
+ rc_user,rc_comment,rc_user_text,rc_timestamp,rc_minor,
+ rc_new
+ ORDER BY rc_timestamp DESC
+ LIMIT {$limit};
";
} else {
$sql =
rc_cur_id,
rc_namespace,
rc_title,
- rc_user,
+ rc_user,
rc_comment,
rc_user_text,
rc_this_oldid,
AND pl_title=rc_title
AND pl_from=$id
GROUP BY rc_cur_id,rc_namespace,rc_title,
- rc_user,rc_comment,rc_user_text,rc_timestamp,rc_minor,
- rc_new
+ rc_user,rc_comment,rc_user_text,rc_timestamp,rc_minor,
+ rc_new
ORDER BY rc_timestamp DESC
LIMIT {$limit}";
}
$wgOut->addHTML( "<hr />\n{$note}\n<br />" );
$note = rcDayLimitlinks( $days, $limit, "Recentchangeslinked",
- "target=" . $nt->getPrefixedURL() . "&hideminor={$hideminor}",
- false, $mlink );
+ "target=" . $nt->getPrefixedURL() . "&hideminor={$hideminor}",
+ false, $mlink );
$wgOut->addHTML( $note."\n" );
$tm = $wgContLang->convertForSearchResult( $matches->termMatches() );
$terms = implode( '|', $tm );
- global $wgOut;
$off = $this->offset + 1;
$out = "<ol start='{$off}'>\n";
* @return bool
*/
function undelete( $timestamps ) {
- global $wgDeferredUpdateList, $wgParser, $wgDBtype;
+ global $wgParser, $wgDBtype;
$fname = "doUndeleteArticle";
$restoreAll = empty( $timestamps );
}
function doSubmit() {
- global $wgOut, $wgUser, $wgRequest, $wgReadOnlyFile;
+ global $wgOut, $wgRequest, $wgReadOnlyFile;
$wpLockConfirm = $wgRequest->getCheck( 'wpLockConfirm' );
if ( ! $wpLockConfirm ) {
}
function showSuccess() {
- global $wgOut, $wgUser;
+ global $wgOut;
global $ip;
$wgOut->setPagetitle( wfMsg( "unlockdb" ) );
* @access private
*/
function processUpload() {
- global $wgUser, $wgOut, $wgUploadDirectory;
+ global $wgUser, $wgOut;
/* Check for PHP error if any, requires php 4.2 or newer */
if ( $this->mUploadError == 1/*UPLOAD_ERR_INI_SIZE*/ ) {
* is a PHP-managed upload temporary
*/
function saveUploadedFile( $saveName, $tempName, $useRename = false ) {
- global $wgUploadDirectory, $wgOut;
+ global $wgOut;
$fname= "SpecialUpload::saveUploadedFile";
* @access private
*/
function uploadWarning( $warning ) {
- global $wgOut, $wgUser, $wgUploadDirectory, $wgRequest;
+ global $wgOut;
global $wgUseCopyrightUpload;
$this->mSessionKey = $this->stashSession();
* @access private
*/
function mainUploadForm( $msg='' ) {
- global $wgOut, $wgUser, $wgUploadDirectory, $wgRequest;
+ global $wgOut, $wgUser;
global $wgUseCopyrightUpload;
$cols = intval($wgUser->getOption( 'cols' ));
* Entry point
*/
function wfSpecialUploadMogile() {
- global $wgRequest;
- $form = new UploadFormMogile( $wgRequest );
- $form->execute();
+ global $wgRequest;
+ $form = new UploadFormMogile( $wgRequest );
+ $form->execute();
}
/** @package MediaWiki */
* @access private
*/
function addNewAccount() {
- global $wgUser, $wgOut, $wgEmailAuthentication;
+ global $wgUser, $wgEmailAuthentication;
$u = $this->addNewAccountInternal();
* @access private
*/
function mailPassword() {
- global $wgUser, $wgDBname;
-
if ( '' == $this->mName ) {
$this->mainLoginForm( wfMsg( 'noname' ) );
return;
* @access private
*/
function mailPasswordInternal( $u ) {
- global $wgPasswordSender, $wgIP;
global $wgCookiePath, $wgCookieDomain, $wgCookiePrefix, $wgCookieSecure;
if ( '' == $u->getEmail() ) {
* @access private
*/
function mainLoginForm( $msg, $msgtype = 'error' ) {
- global $wgUser, $wgOut, $wgLang;
+ global $wgUser, $wgOut;
global $wgAllowRealName, $wgEnableEmail;
global $wgCookiePrefix;
global $wgAuth;
* @access private
*/
function cookieRedirectCheck( $type ) {
- global $wgOut, $wgLang;
+ global $wgOut;
$titleObj = Title::makeTitle( NS_SPECIAL, 'Userlogin' );
$check = $titleObj->getFullURL( 'wpCookieCheck='.$type );
$dbr =& wfGetDB( DB_SLAVE );
extract( $dbr->tableNames( 'page', 'revision', 'watchlist', 'recentchanges' ) );
- $sql = "SELECT COUNT(*) AS n FROM $watchlist WHERE wl_user=$uid";
- $res = $dbr->query( $sql, $fname );
- $s = $dbr->fetchObject( $res );
-
- # Patch *** A1 *** (see A2 below)
+ $sql = "SELECT COUNT(*) AS n FROM $watchlist WHERE wl_user=$uid";
+ $res = $dbr->query( $sql, $fname );
+ $s = $dbr->fetchObject( $res );
+
+# Patch *** A1 *** (see A2 below)
# adjust for page X, talk:page X, which are both stored separately, but treated together
$nitems = floor($s->n / 2);
# $nitems = $s->n;
$docutoff = "AND rev_timestamp > '" .
( $cutoff = $dbr->timestamp( time() - intval( $days * 86400 ) ) )
. "'";
- /*
- $sql = "SELECT COUNT(*) AS n FROM $page, $revision WHERE rev_timestamp>'$cutoff' AND page_id=rev_page";
- $res = $dbr->query( $sql, $fname );
- $s = $dbr->fetchObject( $res );
- $npages = $s->n;
- */
- $npages = 40000 * $days;
+ /*
+ $sql = "SELECT COUNT(*) AS n FROM $page, $revision WHERE rev_timestamp>'$cutoff' AND page_id=rev_page";
+ $res = $dbr->query( $sql, $fname );
+ $s = $dbr->fetchObject( $res );
+ $npages = $s->n;
+ */
+ $npages = 40000 * $days;
}
"\n\n" );
}
- $sql = "SELECT
- rc_namespace page_namespace,rc_title page_title,
- rc_comment rev_comment, rc_cur_id page_id,
- rc_user rev_user,rc_user_text rev_user_text,
- rc_timestamp rev_timestamp,rc_minor rev_minor_edit,
- rc_this_oldid rev_id,
- rc_last_oldid,
- rc_new page_is_new,wl_notificationtimestamp
- FROM $watchlist,$recentchanges,$page
- WHERE wl_user=$uid
- AND wl_namespace=rc_namespace
- AND wl_title=rc_title
- AND rc_timestamp > '$cutoff'
- AND rc_cur_id=page_id
- $andHideOwn
- $andHideBotsOptional
- ORDER BY rc_timestamp DESC";
+ $sql = "SELECT
+ rc_namespace page_namespace,rc_title page_title,
+ rc_comment rev_comment, rc_cur_id page_id,
+ rc_user rev_user,rc_user_text rev_user_text,
+ rc_timestamp rev_timestamp,rc_minor rev_minor_edit,
+ rc_this_oldid rev_id,
+ rc_last_oldid,
+ rc_new page_is_new,wl_notificationtimestamp
+ FROM $watchlist,$recentchanges,$page
+ WHERE wl_user=$uid
+ AND wl_namespace=rc_namespace
+ AND wl_title=rc_title
+ AND rc_timestamp > '$cutoff'
+ AND rc_cur_id=page_id
+ $andHideOwn
+ $andHideBotsOptional
+ ORDER BY rc_timestamp DESC";
$res = $dbr->query( $sql, $fname );
$numRows = $dbr->numRows( $res );
}
function execute() {
- global $wgUser, $wgOut;
+ global $wgOut;
$this->limit = min( $this->request->getInt( 'limit', 50 ), 5000 );
if ( $this->limit <= 0 ) {
* @access private
*/
function showIndirectLinks( $level, $target, $limit, $from = 0, $dir = 'next' ) {
- global $wgOut, $wgUser;
+ global $wgOut;
$fname = 'WhatLinksHerePage::showIndirectLinks';
$dbr =& wfGetDB( DB_READ );
var $mArticleID; # Article ID, fetched from the link cache on demand
var $mLatestID; # ID of most recent revision
var $mRestrictions; # Array of groups allowed to edit this article
- # Only null or "sysop" are supported
+ # Only null or "sysop" are supported
var $mRestrictionsLoaded; # Boolean for initialisation on demand
var $mPrefixedText; # Text form including namespace/interwiki, initialised on demand
var $mDefaultNamespace; # Namespace index when there is no namespace
- # Zero except in {{transclusion}} tags
- var $mWatched; # Is $wgUser watching this page? NULL if unfilled, accessed through userIsWatching()
+ # Zero except in {{transclusion}} tags
+ var $mWatched; # Is $wgUser watching this page? NULL if unfilled, accessed through userIsWatching()
/**#@-*/
* @access public
*/
function getPrefixedText() {
- global $wgContLang;
if ( empty( $this->mPrefixedText ) ) { // FIXME: bad usage of empty() ?
$s = $this->prefix( $this->mTextform );
$s = str_replace( '_', ' ', $s );
* @access public
*/
function getFullText() {
- global $wgContLang;
$text = $this->getPrefixedText();
if( '' != $this->mFragment ) {
$text .= '#' . $this->mFragment;
* @access public
*/
function getEditURL() {
- global $wgServer, $wgScript;
-
if ( '' != $this->mInterwiki ) { return ''; }
$s = $this->getLocalURL( 'action=edit' );
# protect global styles and js
if ( NS_MEDIAWIKI == $this->mNamespace
- && preg_match("/\\.(css|js)$/", $this->mTextform )
+ && preg_match("/\\.(css|js)$/", $this->mTextform )
&& !$wgUser->isAllowed('editinterface') ) {
wfProfileOut( $fname );
return false;
AND pl_title=page_title
WHERE pl_from=?
AND page_namespace IS NULL
- !",
+ !",
$db->tableName( 'pagelinks' ),
$db->tableName( 'page' ),
$this->getArticleId(),
* @access public
*/
function isValidMoveOperation( &$nt, $auth = true ) {
- global $wgUser;
if( !$this or !$nt ) {
return 'badtitletext';
}
* @access private
*/
function moveOverExistingRedirect( &$nt, $reason = '' ) {
- global $wgUser, $wgUseSquid, $wgMwRedir;
+ global $wgUseSquid, $wgMwRedir;
$fname = 'Title::moveOverExistingRedirect';
$comment = wfMsgForContent( '1movedto2', $this->getPrefixedText(), $nt->getPrefixedText() );
* @access private
*/
function moveToNewTitle( &$nt, $reason = '' ) {
- global $wgUser, $wgUseSquid;
+ global $wgUseSquid;
global $wgMwRedir;
$fname = 'MovePageForm::moveToNewTitle';
$comment = wfMsgForContent( '1movedto2', $this->getPrefixedText(), $nt->getPrefixedText() );
* @access public
*/
function createRedirect( $dest, $comment ) {
- global $wgUser;
if ( $this->getArticleID() ) {
return false;
}
* @access public
*/
function getParentCategories() {
- global $wgContLang,$wgUser;
+ global $wgContLang;
$titlekey = $this->getArticleId();
$dbr =& wfGetDB( DB_SLAVE );
$fname = 'User::loadDefaults' . $n;
wfProfileIn( $fname );
- global $wgContLang, $wgCookiePrefix;
+ global $wgCookiePrefix;
global $wgNamespacesToBeSearchedDefault;
$this->mId = 0;
* Save object settings into database
*/
function saveSettings() {
- global $wgMemc, $wgDBname, $wgUseEnotif;
+ global $wgMemc, $wgDBname;
$fname = 'User::saveSettings';
if ( wfReadOnly() ) { return; }
*/
function doDuplicateEntries( $ot, $nt ) {
$fname = "WatchedItem::duplicateEntries";
- global $wgMemc, $wgDBname;
$oldnamespace = $ot->getNamespace();
$newnamespace = $nt->getNamespace();
$oldtitle = $ot->getDBkey();