newbie detector
authorTim Starling <tstarling@users.mediawiki.org>
Sat, 26 Jun 2004 01:48:39 +0000 (01:48 +0000)
committerTim Starling <tstarling@users.mediawiki.org>
Sat, 26 Jun 2004 01:48:39 +0000 (01:48 +0000)
includes/User.php

index 467fc2a..2a06936 100644 (file)
@@ -715,6 +715,15 @@ class User {
        function getUserPage() {
                return Title::makeTitle( NS_USER, $this->mName );
        }
+
+       /* static */ function getMaxID() {
+               $row = wfGetArray( 'user', array('max(user_id) as m'), false );
+               return $row->m;
+       }
+
+       function isNewbie() {
+               return $this->mId > User::getMaxID() * 0.99 && !$this->isSysop() || $this->getID() == 0;
+       }
 }
 
 ?>