- $real_names = array();
- $user_names = array();
-
- $anon = '';
-
- # Sift for real versus user names
-
- foreach ($contributors as $user_parts) {
- if ($user_parts[0] != 0) {
- if ($wgAllowRealName && !empty($user_parts[2])) {
- $real_names[] = creditLink($user_parts[1], $user_parts[2]);
+ /**
+ * Get a list of contributors of $article
+ * @param $article Article object
+ * @param $cnt Int: maximum list of contributors to show
+ * @param $showIfMax Bool: whether to contributors if there more than $cnt
+ * @return String: html
+ */
+ protected static function getContributors( Article $article, $cnt, $showIfMax ) {
+ global $wgLang, $wgHiddenPrefs;
+
+ $contributors = $article->getContributors();
+
+ $others_link = false;
+
+ # Hmm... too many to fit!
+ if( $cnt > 0 && $contributors->count() > $cnt ){
+ $others_link = self::othersLink( $article );
+ if( !$showIfMax )
+ return wfMsgExt( 'othercontribs', 'parsemag', $others_link, $contributors->count() );
+ }
+
+ $real_names = array();
+ $user_names = array();
+ $anon_ips = array();
+
+ # Sift for real versus user names
+ foreach( $contributors as $user ) {
+ $cnt--;
+ if( $user->isLoggedIn() ){
+ $link = self::link( $user );
+ if( !in_array( 'realname', $wgHiddenPrefs ) && $user->getRealName() )
+ $real_names[] = $link;
+ else
+ $user_names[] = $link;