require_once '/data/project/xtools/modules/WebTool.php'; //Load WebTool class $wt = new WebTool('sc'); $wt->setLimits(); $wt->getPageTemplate("form"); $ui = $wt->getUserInfo(); $user = $ui->user; $wi = $wt->wikiInfo; $lang = $wi->lang; $wiki = $wi->wiki; //Show form if &article parameter is not set (or empty) if (!$user) { $wt->showPage(); } $dbr = $wt->loadDatabase($lang, $wiki); $obj = getEditCounts($dbr, $user); $wt->content = ' <br /> <table class="leantable table-condensed xt-table" > <tr><td>{#username#}: </td><td><a href="//' . $lang . '.' . $wiki . '.org/wiki/User:'******'" >' . $user . '</a></td></tr> <tr><td>{#userid#}: </td><td>' . $obj->id . '</td></tr> <tr><td>{#groups#}: </td><td>' . $obj->groups . '</td></tr> <tr><td>{#deleted_edits#}: </td><td>' . $wt->numFmt($obj->deleted) . '</td></tr> <tr><td>{#live#}: </td><td>' . $wt->numFmt($obj->live) . '</td></tr> <tr><td>{#total#}: </td><td><b>' . $wt->numFmt($obj->live + $obj->deleted) . '</b></td></tr> </table> '; $wt->showPage(); function getEditCounts($dbr, $user) { $name = $dbr->strencode($user);
} $edit_count_total = $edit_count_live + $edit_count_deleted; return array($edit_count_total, $edit_count_live, $edit_count_deleted, $groups, $uid); } if (isset($_GET['debug'])) { echo "<span style=\"font-size:100%;\">" . wfMsg('executed', number_format(microtime(1) - $time, 2, '.', '')) . "</span>"; } if ($replag[0] > 120) { echo '<h2 class="replag">' . wfMsg('highreplag', $replag[1]) . '</h2>'; } unset($replag); //Output general stats echo '<h2>' . wfMsg('generalinfo') . '</h2>'; echo wfMsg('username') . ": <a href=\"https://{$oldlang}.{$oldwiki}.org/wiki/User:{$oldname}\">{$oldname}</a><br />"; flush(); $temp = getEditCounts(); $replag = getReplag(); $total = $temp[0]; $live = $temp[1]; $deleted = $temp[2]; $groups = $temp[3]; $uid = $temp[4]; unset($temp); //Just neatness if (isset($groups[0])) { //Because IPs and other new users don't have groups echo wfMsg('usergroups') . ": "; echo implode(', ', $groups); //Why is this in 3 lines? echo "<br />"; }
} else { $minn++; } //$min++; if ($rmin <= 149) { $rmin++; if ($row['rev_comment'] != '') { $redit_sum_min++; } } } } $last_month = strtotime(date('Ymd')); return array($edit_sum_maj, $edit_sum_min, $maj, $minn, $redit_sum_maj, $redit_sum_min, $rmaj, $rmin, $month_totals, $month_editsummary_totals, $first_month, $last_month); } $temp = getEditCounts($dbr); $edit_sum_maj = $temp[0]; $edit_sum_min = $temp[1]; $maj = $temp[2]; $min = $temp[3]; $redit_sum_maj = $temp[4]; $redit_sum_min = $temp[5]; $rmaj = $temp[6]; $rmin = $temp[7]; $month_totals = $temp[8]; $month_editsummary_totals = $temp[9]; $first_month = $temp[10]; $last_month = $temp[11]; //Output general stats echo '<h2>General user info</h2>'; echo "Username: <a href=\"//{$lang}.wiki.org/wiki/User:{$name}\">{$name}</a><br />";