From 02b80d0793215675e103c1ad17d60b78f471a444 Mon Sep 17 00:00:00 2001 From: Tim Starling Date: Sat, 26 Jun 2004 01:48:39 +0000 Subject: [PATCH] newbie detector --- includes/User.php | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/includes/User.php b/includes/User.php index 467fc2a0c9..2a06936a04 100644 --- a/includes/User.php +++ b/includes/User.php @@ -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; + } } ?> -- 2.20.1