Example #1
0
function wfAutoPageCreateIsAnonUserpage($title)
{
    if (User::IsIP($title)) {
        if (!User::idFromName($title)) {
            return true;
        }
    }
    return false;
}
 function showUserStats($user)
 {
     global $wgOut, $wgUser;
     $this->topicList = $this->getTopicList();
     $data = $this->getAllVoteLists($user);
     $sk = $wgUser->getSkin();
     if ($user == $wgUser->getID()) {
         $wgOut->setPageTitle(wfMsg('val_my_stats_title'));
     } elseif (!User::IsIP($user)) {
         $wgOut->setPageTitle(wfMsg('val_user_stats_title', User::whoIs($user)));
     } else {
         $wgOut->setPageTitle(wfMsg('val_user_stats_title', $user));
     }
     $ret = "<table>\n";
     foreach ($data as $articleid => $revisions) {
         $title = Title::newFromID($articleid);
         $ret .= "<tr><th colspan='4'>";
         $ret .= $sk->makeKnownLinkObj($title, $title->getEscapedText());
         $ret .= "</th></tr>";
         krsort($revisions);
         foreach ($revisions as $revid => $revision) {
             $url = $title->getLocalURL("oldid={$revid}");
             $ret .= "<tr><th>";
             $ret .= $sk->makeKnownLinkObj($title, wfMsg('val_revision_number', $revid), "oldid={$revid}");
             $ret .= "</th>";
             ksort($revision);
             $initial = true;
             foreach ($revision as $topic => $rating) {
                 if (!$initial) {
                     $ret .= "<tr><td/>";
                 }
                 $initial = false;
                 $ret .= "<td>" . $this->getTopicLink($this->topicList[$topic]->val_comment) . "</td>";
                 $ret .= "<td>" . $this->getRatingText($rating->val_value, $this->topicList[$topic]->val_value) . "</td>";
                 $ret .= "<td>" . $sk->commentBlock($rating->val_comment) . "</td>";
                 $ret .= "</tr>";
             }
         }
         $ret .= "</tr>";
     }
     $ret .= "</table>";
     return $ret;
 }