GetUser()) { $max = $user['changescount']; } else { $max = 50; } $last_users = $this->LoadAll('SELECT name, signuptime, motto FROM '.$this->GetConfigValue('table_prefix').'users ORDER BY signuptime DESC LIMIT '.$max); if ($last_users) { if (!($link = $this->GetParameter('link'))) $link = $this->GetConfigValue('root_page'); if (!($format = $this->GetParameter('format'))) $format = 'rss1.0'; // Création de la sortie pour le contenu xml $output = ''."\n"; // En-tête du contenu xml switch ($format) { case 'rss1.0' : $output .= ''."\n"; $output .= 'Href('', $link).'">'."\n"; $output .= 'Derniers inscrits sur '.$this->GetConfigValue('wakka_name').''."\n"; $output .= ''.$this->Href('', $link).''."\n"; $output .= 'Derniers inscrits sur '.$this->GetConfigValue('wakka_name').''."\n"; $output .= "\n\n"; break; case 'rss2.0' : $output .= ''."\n"; $output .= ''."\n"; $output .= ''."\n"; $output .= 'Derniers inscrits sur '.$this->GetConfigValue('wakka_name').''."\n"; $output .= ''.$this->Href('', $link).''."\n"; $output .= 'Derniers inscrits sur '.$this->GetConfigValue('wakka_name').''."\n"; break; } // Corps du contenu XML $items = ''; foreach ($last_users as $i => $user) { $itemurl = $this->Href('', $user['name']); switch ($format) { case 'rss1.0' : $output .= ''; $items .= ''."\n"; $items .= ''.'Utilisateur '.htmlentities($user['name']).' - inscription le '.$user['signuptime'].''."\n"; $items .= ''.'L\'utilisateur '.htmlentities($user['name']).' s\'est inscrit le '.$user['signuptime']; if (!empty($user['motto'])) { $items .= ' avec pour devise "'.htmlentities($user['motto']).'"'; } $items .= ''."\n"; $items .= ''.$itemurl.''."\n"; $items .= ''."\n"; break; case 'rss2.0' : $output .= ''."\n"; $output .= ''.'Utilisateur '.htmlentities($user['name']).' - inscription le '.$user['signuptime'].''."\n"; $output .= ''.$itemurl.''."\n"; $output .= ''.$itemurl.''."\n"; $output .= ''.'L\'utilisateur '.htmlentities($user['name']).' s\'est inscrit le '.$user['signuptime']; if (!empty($user['motto'])) { $output .= ' avec pour devise "'.htmlentities($user['motto']).'"'; } $output .= ''."\n"; $output .= ''."\n"; break; } } //Pied du contenu XML switch ($format) { case 'rss1.0' : $output .= "\n\n\n"; $output .= $items . "\n"; break; case 'rss2.0' : $output .= ''."\n"; $output .= ''."\n"; break; } echo $output; } ?>