* @param $_nntp RESOURCE handle to NNTP socket
*/
- function groups(&$_nntp) {
+ function groups(&$_nntp,$_type=0) {
+ global $profile;
$desc=$_nntp->xgtitle();
- $list=$_nntp->liste();
+ if ($_type==1) {
+ $list=$_nntp->newgroups($profile['lastnews']);
+ } else {
+ $list=$_nntp->liste();
+ }
if (!$list) {
- $this="list";
+ $this->overview=array();
return false;
}
if (isset($desc)) {
foreach ($desc as $g=>$d) {
- $this->overview[$g][0]=$d;
- $this->overview[$g][1]=$list[$g][0];
+ if ((($_type==0) and (in_array($g,$profile['subscribe']) or !count($profile['subscribe'])))
+ or (($_type==1) and in_array($g,array_keys($list)))
+ or ($_type==2)) {
+ $this->overview[$g][0]=$d;
+ $this->overview[$g][1]=$list[$g][0];
+ }
}
foreach (array_diff(array_keys($list),array_keys($desc)) as $g) {
- $this->overview[$g][0]="-";
- $this->overview[$g][1]=$list[$g][0];
+ if ((($_type==0) and (in_array($g,$profile['subscribe']) or !count($profile['subscribe'])))
+ or (($_type==1) and in_array($g,array_keys($list)))
+ or ($_type==2)) {
+ $this->overview[$g][0]="-";
+ $this->overview[$g][1]=$list[$g][0];
+ }
}
} else {
foreach ($list as $g=>$l) {
- $this->overview[$g][0]="-";
- $this->overview[$g][1]=$l[0];
+ if ((($_type==0) and (in_array($g,$profile['subscribe']) or !count($profile['subscribe'])))
+ or (($_type==1) and in_array($g,array_keys($list)))
+ or ($_type==2)) {
+ $this->overview[$g][0]="-";
+ $this->overview[$g][1]=$l[0];
+ }
}
}
return true;
exit;
}
}
-$groups = new groups($nntp);
-
+$groups = new groups($nntp,0);
+$newgroups = new groups($nntp,1);
?>
<div class="<?php echo $css["title"];?>">
?>
</table>
<?php
+if (count($newgroups->overview) and count($profile['subscribe'])) {
+?>
+<p class="normal">
+<?php echo $locale['index']['newgroupstext']; ?>
+</p>
+<table class="<?php echo $css["bicol"];?>" cellspacing="0" cellpadding="2"
+ summary="<?php echo $locale['index']['summary'];?>">
+ <tr>
+ <th>
+ <?php echo $locale['index']['total'];?>
+ </th>
+ <th>
+ <?php echo $locale['index']['name'];?>
+ </th>
+ <th>
+ <?php echo $locale['index']['description'];?>
+ </th>
+ </tr>
+<?php
+ $pair = true;
+ foreach ($newgroups->overview as $g => $d) {
+ $pair = !$pair;
+ $groupinfo = $nntp->group($g);
+?>
+ <tr class="<?php echo ($pair?$css["pair"]:$css["impair"]);?>" >
+ <td class="<?php echo $css["total"]; ?>">
+ <?php echo $groupinfo[0]; ?>
+ </td>
+ <td class="<?php echo $css["group"]; ?>">
+ <?php echo "<a href=\"thread.php?group=$g\">$g</a>";?>
+ </td>
+ <td class="<?php echo $css["description"]; ?>">
+ <?php echo $d[0];?>
+ </td>
+ </tr>
+<?php
+ } //foreach
+?>
+</table>
+<?php
+} // new newsgroups ?
displayshortcuts();
'unread' => "Nouveaux",
'name' => "Nom",
'description' => "Description",
+ 'newgroupstext' => "Les forums suivants ont été créés depuis ton dernier passage :"
+);
+
+$locale['subscribe'] = array(
+ 'title' => "Abonnements",
+ 'summary' => "Liste des forums",
+ 'total' => "Total",
+ 'subscribed' => "Abonné",
+ 'name' => "Nom",
+ 'description' => "Description",
);
$locale['article'] = array(