90962c86 |
1 | <?php |
2 | /******************************************************************************** |
3 | * index.php : main page (newsgroups list) |
4 | * ----------- |
5 | * |
6 | * This file is part of the banana distribution |
7 | * Copyright: See COPYING files that comes with this distribution |
8 | ********************************************************************************/ |
9 | |
2dbc0167 |
10 | require_once("include/banana.inc.php"); |
0d407ce1 |
11 | require_once("include/header.inc.php"); |
90962c86 |
12 | |
2dbc0167 |
13 | $groups = new BananaGroups(0); |
14 | if (!count($groups->overview)) { |
15 | $groups = new BananaGroups(2); |
16 | } else { |
17 | $newgroups = new BananaGroups(1); |
90962c86 |
18 | } |
2dbc0167 |
19 | |
90962c86 |
20 | ?> |
21 | |
40e27a11 |
22 | <h1> |
0a65ec9d |
23 | <?php echo _b_('Les forums de Banana'); ?> |
40e27a11 |
24 | </h1> |
90962c86 |
25 | |
26 | <?php |
a3b667fe |
27 | if (!sizeof($groups->overview)) error("nntpgroups"); |
90962c86 |
28 | |
29 | displayshortcuts(); |
30 | ?> |
31 | |
e2cae7e3 |
32 | <table class="<?php echo $css["bicol"];?>" cellspacing="0" cellpadding="2"> |
90962c86 |
33 | <tr> |
34 | <th> |
0a65ec9d |
35 | <?php echo _b_('Total'); ?> |
90962c86 |
36 | </th> |
37 | <th> |
0a65ec9d |
38 | <?php echo _b_('Nouveaux'); ?> |
90962c86 |
39 | </th> |
40 | <th> |
0a65ec9d |
41 | <?php echo _b_('Nom'); ?> |
90962c86 |
42 | </th> |
43 | <th> |
0a65ec9d |
44 | <?php echo _b_('Description'); ?> |
90962c86 |
45 | </th> |
46 | </tr> |
47 | <?php |
48 | $pair = true; |
49 | foreach ($groups->overview as $g => $d) { |
2dbc0167 |
50 | $pair = !$pair; |
51 | $groupinfo = $banana->nntp->group($g); |
52 | $newarts = $banana->nntp->newnews($banana->profile['lastnews'],$g); |
90962c86 |
53 | ?> |
7ce9f53d |
54 | <tr class="<?php echo ($pair?$css["pair"]:$css["impair"]);?>" > |
55 | <td class="<?php echo $css["total"]; ?>"> |
90962c86 |
56 | <?php echo $groupinfo[0]; ?> |
57 | </td> |
7ce9f53d |
58 | <td class="<?php echo $css["unread"]; ?>"> |
30359882 |
59 | <?php echo sizeof($newarts); ?> |
90962c86 |
60 | </td> |
7ce9f53d |
61 | <td class="<?php echo $css["group"]; ?>"> |
90962c86 |
62 | <?php echo "<a href=\"thread.php?group=$g\">$g</a>";?> |
63 | </td> |
7ce9f53d |
64 | <td class="<?php echo $css["description"]; ?>"> |
90962c86 |
65 | <?php echo $d[0];?> |
66 | </td> |
67 | </tr> |
68 | <?php |
69 | } |
70 | ?> |
71 | </table> |
72 | <?php |
2dbc0167 |
73 | if (count($newgroups->overview) and count($banana->profile['subscribe'])) { |
8f98c1e8 |
74 | ?> |
75 | <p class="normal"> |
0a65ec9d |
76 | <?php echo _b_('Les forums suivants ont été créés depuis ton dernier passage :'); ?> |
8f98c1e8 |
77 | </p> |
e2cae7e3 |
78 | <table class="<?php echo $css["bicol"];?>" cellspacing="0" cellpadding="2"> |
8f98c1e8 |
79 | <tr> |
80 | <th> |
0a65ec9d |
81 | <?php echo _b_('Total'); ?> |
8f98c1e8 |
82 | </th> |
83 | <th> |
0a65ec9d |
84 | <?php echo _b_('Nom'); ?> |
8f98c1e8 |
85 | </th> |
86 | <th> |
0a65ec9d |
87 | <?php echo _b_('Description'); ?> |
8f98c1e8 |
88 | </th> |
89 | </tr> |
90 | <?php |
2dbc0167 |
91 | $pair = true; |
92 | foreach ($newgroups->overview as $g => $d) { |
93 | $pair = !$pair; |
94 | $groupinfo = $banana->nntp->group($g); |
8f98c1e8 |
95 | ?> |
96 | <tr class="<?php echo ($pair?$css["pair"]:$css["impair"]);?>" > |
97 | <td class="<?php echo $css["total"]; ?>"> |
98 | <?php echo $groupinfo[0]; ?> |
99 | </td> |
100 | <td class="<?php echo $css["group"]; ?>"> |
101 | <?php echo "<a href=\"thread.php?group=$g\">$g</a>";?> |
102 | </td> |
103 | <td class="<?php echo $css["description"]; ?>"> |
104 | <?php echo $d[0];?> |
105 | </td> |
106 | </tr> |
107 | <?php |
2dbc0167 |
108 | } //foreach |
8f98c1e8 |
109 | ?> |
110 | </table> |
111 | <?php |
112 | } // new newsgroups ? |
90962c86 |
113 | |
114 | displayshortcuts(); |
115 | |
2dbc0167 |
116 | $banana->nntp->quit(); |
0d407ce1 |
117 | require_once("include/footer.inc.php"); |
90962c86 |
118 | ?> |