Thanks for this mod.
I've modified your SQL query into this:
$query = "
SELECT o.rc_title, o.rc_user_text, o.rc_new, o.rc_namespace, o.rc_timestamp
FROM " . $prefix . "recentchanges o,
(SELECT max(rc_timestamp) as xtimestamp, rc_title, rc_namespace FROM " . $prefix . "recentchanges WHERE ABS(rc_old_len - rc_new_len) > 20 AND rc_namespace IN (0,2,6,14) GROUP BY rc_title, rc_namespace) n
WHERE o.rc_title = n.rc_title
AND o.rc_namespace = n.rc_namespace
AND o.rc_timestamp = n.xtimestamp
ORDER BY rc_timestamp
DESC LIMIT " . $results;
Improvements:
- Namespace filtering is done in the nested SELECT
- Articles with same titles but in different namespaces are not lumped together ("Category:Vehicles" and "Vehicles" are two different articles, are they not?)
- filter out minute changes (detected by difference in articles length -- ABS(rc_old_len - rc_new_len) > 20 -- change 20 to minimum length difference)
.. and here is how I made the output list into more than one column:
Code:
// set $count = 0 outside this WHILE loop
// also set $columns to the number of columns you want
// owh and you need to set $wikiUrl to be your wiki url
if ($count % $columns == 0) $wik = $wik . '<tr>';
$wik = $wik .'<td class="alt'. (($count%$columns+intval($count/$columns))%2+1) .'" style="width:'. intval(100 / $columns) .'%">';
$wik = $wik . '<a href="' . $wikiUrl . $wTitle . '" title="' . $wTitleName . '"><strong>' . $wTitleName . '</strong></a><span class="smallfont">' . $new . 'by <a href="'. $wikiUrl .'User:'. $row['rc_user_text'] .'">' . $row['rc_user_text'] . '</a>';
$wik = $wik . "</span></td>";
if ($count % $columns == $columns - 1) $wik = $wik . '</tr>';
$count++;
Make sure you set the $results variable to be a multiple of the $columns (e.g. if $columns = 3 then $results = 3 or 6 or 9 or 12 or 15 etc
Sample @
http://www.recom.org/