* @param bool $patrolled
* @param string $nothing, string to use for empty space
* @param bool $bot
- * @param bool $newbie
* @return string
*/
- protected function recentChangesFlags( $new, $minor, $patrolled, $nothing = ' ', $bot = false, $newbie = false ) {
+ protected function recentChangesFlags( $new, $minor, $patrolled, $nothing = ' ', $bot = false ) {
$f = $new ? '<span class="newpage">' . $this->message['newpageletter'] . '</span>'
: $nothing;
$f .= $minor ? '<span class="minor">' . $this->message['minoreditletter'] . '</span>'
: $nothing;
$f .= $bot ? '<span class="bot">' . $this->message['boteditletter'] . '</span>' : $nothing;
$f .= $patrolled ? '<span class="unpatrolled">!</span>' : $nothing;
- $f .= $newbie ? '<span class="newuser">*</span>' : $nothing;
return $f;
}
-
- protected static function userIsNew( Array $attribs ) {
- global $wgAutoConfirmCount, $wgAutoConfirmAge;
- if( !array_key_exists('user_editcount',$attribs) || !array_key_exists('user_registration',$attribs) ) {
- return false; // missing input!
- }
- static $time;
- $time = time();
- $edits = $attribs['user_editcount'];
- $age = $attribs['user_registration'];
- if( $wgAutoConfirmCount && !$edits || $wgAutoConfirmAge && !$age ) {
- return true;
- } else if( $wgAutoConfirmCount && $edits < $wgAutoConfirmCount ) {
- return true;
- } else if( $wgAutoConfirmAge && ($time - wfTimestampOrNull(TS_UNIX,$age)) < $wgAutoConfirmAge ) {
- return true;
- }
- return false;
- }
/**
* Returns text for the start of the tabular part of RC
$dateheader = ""; // $s now contains only <li>...</li>, for hooks' convenience.
$this->insertDateHeader($dateheader,$rc_timestamp);
- $s = '<li>';
+ $s = '';
// Moved pages
if( $rc_type == RC_MOVE || $rc_type == RC_MOVE_OVER_REDIRECT ) {
wfProfileIn($fname.'-page');
$this->insertDiffHist($s, $rc, $unpatrolled);
+
# M, N, b and ! (minor, new, bot and unpatrolled)
- $newbie = self::userIsNew( $rcObj->mAttribs );
- $s .= $this->recentChangesFlags( $rc_type == RC_NEW, $rc_minor, $unpatrolled, '',
- $rc_bot, $newbie );
+ $s .= $this->recentChangesFlags( $rc_type == RC_NEW, $rc_minor, $unpatrolled, '', $rc_bot );
$this->insertArticleLink($s, $rc, $unpatrolled, $watched);
wfProfileOut($fname.'-page');
$s .= ' ' . wfMsg('number_of_watching_users_RCview', $wgContLang->formatNum($rc->numberofWatchingusers));
}
- $s .= "</li>\n";
-
- wfRunHooks('OldChangesListRecentChangesLine', array(&$this, &$s, &$rc));
+ wfRunHooks( 'OldChangesListRecentChangesLine', array(&$this, &$s, $rc) );
+
+ $s = "<li>$s</li>\n";
wfProfileOut( $fname.'-rest' );
# Collate list of users
$userlinks = array();
# Other properties
- $unpatrolled = $isnew = $newbie = false;
+ $unpatrolled = false;
+ $isnew = false;
$curId = $currentRevision = 0;
# Some catalyst variables...
$namehidden = true;
$alllogs = true;
foreach( $block as $rcObj ) {
$oldid = $rcObj->mAttribs['rc_last_oldid'];
- if( $rcObj->mAttribs['rc_type'] == RC_NEW ) {
+ if( $rcObj->mAttribs['rc_new'] ) {
$isnew = true;
}
// If all log actions to this page were hidden, then don't
if( $rcObj->mAttribs['rc_type'] != RC_LOG ) {
$alllogs = false;
}
- if( self::userIsNew( $rcObj->mAttribs ) ) {
- $newbie = true;
- }
# Get the latest entry with a page_id and oldid
# since logs may not have these.
if( !$curId && $rcObj->mAttribs['rc_cur_id'] ) {
$r .= '<td valign="top" style="white-space: nowrap"><tt>'.$tl.' ';
# Main line
- $r .= $this->recentChangesFlags( $isnew, false, $unpatrolled, ' ', $bot, $newbie );
+ $r .= $this->recentChangesFlags( $isnew, false, $unpatrolled, ' ', $bot );
# Timestamp
$r .= ' '.$block[0]->timestamp.' </tt></td><td>';
#$r .= '<tr><td valign="top">'.$this->spacerArrow();
$r .= '<tr><td valign="top">';
$r .= '<tt>'.$this->spacerIndent() . $this->spacerIndent();
- $newbie = self::userIsNew( $rcObj->mAttribs );
- $r .= $this->recentChangesFlags( $rc_new, $rc_minor, $rcObj->unpatrolled, ' ', $rc_bot, $newbie );
+ $r .= $this->recentChangesFlags( $rc_new, $rc_minor, $rcObj->unpatrolled, ' ', $rc_bot );
$r .= ' </tt></td><td valign="top">';
$o = '';
$curIdEq = 'curid='.$rc_cur_id;
$r = '<table cellspacing="0" cellpadding="0" border="0" style="background: none"><tr>';
+
$r .= '<td valign="top" style="white-space: nowrap"><tt>' . $this->spacerArrow() . ' ';
# Flag and Timestamp
if( $rc_type == RC_MOVE || $rc_type == RC_MOVE_OVER_REDIRECT ) {
$r .= ' '; // 4 flags -> 4 spaces
} else {
- $newbie = self::userIsNew( $rcObj->mAttribs );
- $r .= $this->recentChangesFlags( $rc_type == RC_NEW, $rc_minor, $rcObj->unpatrolled,
- ' ', $rc_bot, $newbie );
+ $r .= $this->recentChangesFlags( $rc_type == RC_NEW, $rc_minor, $rcObj->unpatrolled, ' ', $rc_bot );
}
$r .= ' '.$rcObj->timestamp.' </tt></td><td>';
}
# Diff and hist links
- if( $rc_type != RC_LOG ) {
+ if ( $rc_type != RC_LOG ) {
$r .= ' ('. $rcObj->difflink . $this->message['semicolon-separator'];
$r .= $this->skin->makeKnownLinkObj( $rcObj->getTitle(), wfMsg( 'hist' ), $curIdEq.'&action=history' ) . ')';
}