dcElement('date', dcDate($article->getTimestamp()));
dcPerson('creator', $article->getUser());
- $contributors = dcContributors($article->mTitle);
+ $contributors = dcContributors($article);
foreach ($contributors as $user_name => $cid) {
dcPerson('contributor', $cid, $user_name);
}
}
-/* private */ function dcContributors($title) {
-
+/* private */ function dcContributors($article) {
+
+ $title = $article->mTitle;
+
$contribs = array();
$res = wfQuery("SELECT DISTINCT old_user,old_user_text" .
" FROM old " .
" WHERE old_namespace = " . $title->getNamespace() .
- " AND old_title = '" . $title->getDBkey() . "'", DB_READ);
+ " AND old_title = '" . $title->getDBkey() . "'" .
+ " AND old_user != 0 " .
+ " AND old_user != " . $article->getUser(), DB_READ);
while ( $line = wfFetchObject( $res ) ) {
$contribs[$line->old_user_text] = $line->old_user;
}
-
+
+ # Count anonymous users
+
+ $res = wfQuery("SELECT COUNT(*) AS cnt " .
+ " FROM old " .
+ " WHERE old_namespace = " . $title->getNamespace() .
+ " AND old_title = '" . $title->getDBkey() . "'" .
+ " AND old_user = 0 ", DB_READ);
+
+ while ( $line = wfFetchObject( $res ) ) {
+ $contribs[$line->cnt] = 0;
+ }
+
return $contribs;
}