--- includes/SpecialRecentchanges.1.91 2006-02-04 09:17:32.000000000 -0500 +++ includes/SpecialRecentchanges.php 2006-02-04 09:21:55.000000000 -0500 @@ -28,6 +28,7 @@ /* int */ 'days' => $wgUser->getDefaultOption('rcdays'), /* int */ 'limit' => $wgUser->getDefaultOption('rclimit'), /* bool */ 'hideminor' => false, + /* bool */ 'hideown' => false, /* bool */ 'hidebots' => true, /* bool */ 'hideliu' => false, /* bool */ 'hidepatrolled' => false, @@ -65,6 +66,7 @@ $namespace = $wgRequest->getIntOrNull( 'namespace' ); $invert = $wgRequest->getBool( 'invert', $defaults['invert'] ); + $hideown = $wgRequest->getBool( 'hideown', $defaults['hideown'] ); $hidebots = $wgRequest->getBool( 'hidebots', $defaults['hidebots'] ); $hideliu = $wgRequest->getBool( 'hideliu', $defaults['hideliu'] ); $hidepatrolled = $wgRequest->getBool( 'hidepatrolled', $defaults['hidepatrolled'] ); @@ -77,6 +79,7 @@ if ( 'hidebots' == $bit ) $hidebots = 1; if ( 'bots' == $bit ) $hidebots = 0; if ( 'hideminor' == $bit ) $hideminor = 1; + if ( 'hideown' == $bit ) $hideown = 1; if ( 'minor' == $bit ) $hideminor = 0; if ( 'hideliu' == $bit ) $hideliu = 1; if ( 'hidepatrolled' == $bit ) $hidepatrolled = 1; @@ -126,16 +129,16 @@ } } + $uid = $wgUser->getID(); + $hidem = $hideminor ? 'AND rc_minor=0' : ''; + $hidem .= $hideown ? " AND rc_user <> $uid" : ''; $hidem .= $hidebots ? ' AND rc_bot=0' : ''; $hidem .= $hideliu ? ' AND rc_user=0' : ''; $hidem .= $hidepatrolled ? ' AND rc_patrolled=0' : ''; $hidem .= is_null( $namespace ) ? '' : ' AND rc_namespace' . ($invert ? '!=' : '=') . $namespace; // This is the big thing! - - $uid = $wgUser->getID(); - // Perform query $sql2 = "SELECT * FROM $recentchanges FORCE INDEX (rc_timestamp) " . ($uid ? "LEFT OUTER JOIN $watchlist ON wl_user={$uid} AND wl_title=rc_title AND wl_namespace=rc_namespace " : "") . @@ -182,6 +185,7 @@ wfAppendToArrayIfNotDefault( 'days', $days, $defaults, $nondefaults); wfAppendToArrayIfNotDefault( 'limit', $limit , $defaults, $nondefaults); wfAppendToArrayIfNotDefault( 'hideminor', $hideminor, $defaults, $nondefaults); + wfAppendToArrayIfNotDefault( 'hideown', $hideown, $defaults, $nondefaults); wfAppendToArrayIfNotDefault( 'hidebots', $hidebots, $defaults, $nondefaults); wfAppendToArrayIfNotDefault( 'hideliu', $hideliu, $defaults, $nondefaults); wfAppendToArrayIfNotDefault( 'hidepatrolled', $hidepatrolled, $defaults, $nondefaults); @@ -419,8 +423,8 @@ /** * Used by Recentchangeslinked */ -function rcDayLimitLinks( $days, $limit, $page='Recentchanges', $more='', $doall = false, $minorLink = '', - $botLink = '', $liuLink = '', $patrLink = '' ) { +function rcDayLimitLinks( $days, $limit, $page='Recentchanges', $more='', $doall = false, $minorLink = '', + $ownLink = '', $botLink = '', $liuLink = '', $patrLink = '' ) { if ($more != '') $more .= '&'; $cl = rcCountLink( 50, $days, $page, $more ) . ' | ' . rcCountLink( 100, $days, $page, $more ) . ' | ' . @@ -433,12 +437,11 @@ rcDaysLink( $limit, 14, $page, $more ) . ' | ' . rcDaysLink( $limit, 30, $page, $more ) . ( $doall ? ( ' | ' . rcDaysLink( $limit, 0, $page, $more ) ) : '' ); - $shm = wfMsg( 'showhideminor', $minorLink, $botLink, $liuLink, $patrLink ); + $shm = wfMsg( 'showhideminor', $minorLink, $ownLink, $botLink, $liuLink, $patrLink ); $note = wfMsg( 'rclinks', $cl, $dl, $shm ); return $note; } - /** * Makes change an option link which carries all the other options */ @@ -483,17 +486,14 @@ $dl .= makeOptionsLink( $options_days[$i], array( 'days' => $options_days[$i], 'from' => '' ), $nondefaults) ; // show/hide links - $showhide = array( wfMsg( 'show' ), wfMsg( 'hide' )); - $minorLink = makeOptionsLink( $showhide[1-$options['hideminor']], - array( 'hideminor' => 1-$options['hideminor'] ), $nondefaults); - $botLink = makeOptionsLink( $showhide[1-$options['hidebots']], - array( 'hidebots' => 1-$options['hidebots'] ), $nondefaults); - $liuLink = makeOptionsLink( $showhide[1-$options['hideliu']], - array( 'hideliu' => 1-$options['hideliu'] ), $nondefaults); - $patrLink = makeOptionsLink( $showhide[1-$options['hidepatrolled']], - array( 'hidepatrolled' => 1-$options['hidepatrolled'] ), $nondefaults); + $showhide = array( wfMsg( 'show' ), wfMsg( 'hide' )); + $minorLink = makeOptionsLink( $showhide[1-$options['hideminor']], array( 'hideminor' => 1-$options['hideminor'] ), $nondefaults); + $ownLink = makeOptionsLink( $showhide[1-$options['hideown']], array( 'hideown' => 1-$options['hideown'] ), $nondefaults); + $botLink = makeOptionsLink( $showhide[1-$options['hidebots']], array( 'hidebots' => 1-$options['hidebots'] ), $nondefaults); + $liuLink = makeOptionsLink( $showhide[1-$options['hideliu']], array( 'hideliu' => 1-$options['hideliu'] ), $nondefaults); + $patrLink = makeOptionsLink( $showhide[1-$options['hidepatrolled']], array( 'hidepatrolled' => 1-$options['hidepatrolled'] ), $nondefaults); - $hl = wfMsg( 'showhideminor', $minorLink, $botLink, $liuLink, $patrLink ); + $hl = wfMsg( 'showhideminor', $minorLink, $ownLink, $botLink, $liuLink, $patrLink ); // show from this onward link $now = $wgLang->timeanddate( wfTimestampNow(), true ); --- includes/SpecialRecentchangeslinked.php.1.53 2006-02-04 09:15:34.000000000 -0500 +++ includes/SpecialRecentchangeslinked.php 2006-02-04 09:23:21.000000000 -0500 @@ -21,6 +21,7 @@ $days = $wgRequest->getInt( 'days' ); $target = isset($par) ? $par : $wgRequest->getText( 'target' ); $hideminor = $wgRequest->getBool( 'hideminor' ) ? 1 : 0; + $hideown = $wgRequest->getBool( 'hideown' ) ? 1 : 0; $wgOut->setPagetitle( wfMsg( 'recentchangeslinked' ) ); $sk = $wgUser->getSkin(); @@ -48,23 +49,32 @@ $dbr =& wfGetDB( DB_SLAVE ); $cutoff = $dbr->timestamp( time() - ( $days * 86400 ) ); - $hideminor = ($hideminor ? 1 : 0); + $uid = $wgUser->getID(); + if ( $hideminor ) { $mlink = $sk->makeKnownLink( $wgContLang->specialPage( 'Recentchangeslinked' ), wfMsg( 'show' ), 'target=' . htmlspecialchars( $nt->getPrefixedURL() ) . - "&days={$days}&limit={$limit}&hideminor=0" ); + "&days={$days}&limit={$limit}&hideminor=0&hideown={$hideown}" ); } else { $mlink = $sk->makeKnownLink( $wgContLang->specialPage( "Recentchangeslinked" ), wfMsg( "hide" ), "target=" . htmlspecialchars( $nt->getPrefixedURL() ) . - "&days={$days}&limit={$limit}&hideminor=1" ); + "&days={$days}&limit={$limit}&hideminor=1&hideown={$hideown}" ); } - if ( $hideminor ) { - $cmq = 'AND rc_minor=0'; - } else { $cmq = ''; } - + $andHideMinor = $hideminor ? "AND rc_minor=0" : ''; + + if ( $hideown ) { + $olink = $sk->makeKnownLink( $wgContLang->specialPage( 'Recentchangeslinked' ), + wfMsg( 'show' ), 'target=' . htmlspecialchars( $nt->getPrefixedURL() ) . + "&days={$days}&limit={$limit}&hideminor={$hideminor}&hideown=0" ); + } else { + $olink = $sk->makeKnownLink( $wgContLang->specialPage( "Recentchangeslinked" ), + wfMsg( "hide" ), "target=" . htmlspecialchars( $nt->getPrefixedURL() ) . + "&days={$days}&limit={$limit}&hideminor={$hideminor}&hideown=1" ); + } + extract( $dbr->tableNames( 'recentchanges', 'categorylinks', 'pagelinks', 'revision', 'page' , "watchlist" ) ); - $uid = $wgUser->getID(); + $andHideOwn = $hideown ? "AND ( rc_user <> $uid )" : ''; // If target is a Category, use categorylinks and invert from and to if( $nt->getNamespace() == NS_CATEGORY ) { @@ -88,7 +98,8 @@ 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} + {$andHideMinor} + {$andHideOwn} AND cl_from=rc_cur_id AND cl_to=$catkey GROUP BY rc_cur_id,rc_namespace,rc_title, @@ -118,7 +129,8 @@ FROM $pagelinks, $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} + {$andHideMinor} + {$andHideOwn} AND pl_namespace=rc_namespace AND pl_title=rc_title AND pl_from=$id @@ -135,8 +147,8 @@ $wgOut->addHTML( "
\n{$note}\n
" ); $note = rcDayLimitlinks( $days, $limit, "Recentchangeslinked", - "target=" . $nt->getPrefixedURL() . "&hideminor={$hideminor}", - false, $mlink ); + "target=" . $nt->getPrefixedURL() . "&hideminor={$hideminor}&hideown=${hideOwn}", + false, $mlink, $olink ); $wgOut->addHTML( $note."\n" ); --- languages/Messages.php.1.1 2006-02-02 14:40:14.000000000 -0500 +++ languages/Messages.php 2006-02-04 08:55:21.000000000 -0500 @@ -731,7 +731,7 @@ 'rcnote' => "Below are the last $1 changes in last $2 days.", 'rcnotefrom' => "Below are the changes since $2 (up to $1 shown).", 'rclistfrom' => "Show new changes starting from $1", -'showhideminor' => "$1 minor edits | $2 bots | $3 logged in users | $4 patrolled edits ", +'showhideminor' => "$1 minor edits | $2 own edits | $3 bots | $4 logged in users | $5 patrolled edits ", 'rclinks' => "Show last $1 changes in last $2 days
$3", 'rchide' => "in $4 form; $1 minor edits; $2 secondary namespaces; $3 multiple edits.", 'rcliu' => "; $1 edits from logged in users",