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 | |
90962c86 |
10 | require("include/session.inc.php"); |
11 | require("include/password.inc.php"); |
12 | require("include/NetNNTP.inc.php"); |
13 | require("include/groups.inc.php"); |
14 | require("include/format.inc.php"); |
15 | require("include/config.inc.php"); |
e2625e72 |
16 | require("include/profile.inc.php"); |
17 | |
18 | $profile=getprofile(); |
19 | require($profile['locale']); |
90962c86 |
20 | |
21 | require("include/header.inc.php"); |
22 | |
23 | $nntp = new nntp($news['server']); |
24 | if ($news['user']!="anonymous") { |
25 | $result = $nntp->authinfo($news["user"],$news["pass"]); |
26 | if (!$result) { |
27 | echo "<p class=\"error\">\n\t".$locale['error']['credentials'] |
28 | ."\n</p>"; |
29 | require("include/footer.inc.php"); |
30 | exit; |
31 | } |
32 | } |
33 | $groups = new groups($nntp); |
34 | |
35 | ?> |
36 | |
7ce9f53d |
37 | <div class="<?php echo $css["title"];?>"> |
90962c86 |
38 | <?php echo $locale['index']['title'];?> |
39 | </div> |
40 | |
41 | <?php |
42 | if (!sizeof($groups->overview)) { |
7ce9f53d |
43 | echo "<p class=\"{$css['normal']}\">"; |
90962c86 |
44 | echo "\n".$locale['error']['nogroup']."\n"; |
45 | echo "</p>\n"; |
46 | require("include/footer.inc.php"); |
47 | exit; |
48 | } |
49 | |
50 | displayshortcuts(); |
51 | ?> |
52 | |
7ce9f53d |
53 | <table class="<?php echo $css["bicol"];?>" cellspacing="0" cellpadding="2" |
90962c86 |
54 | summary="<?php echo $locale['index']['summary'];?>"> |
55 | <tr> |
56 | <th> |
57 | <?php echo $locale['index']['total'];?> |
58 | </th> |
59 | <th> |
60 | <?php echo $locale['index']['unread'];?> |
61 | </th> |
62 | <th> |
63 | <?php echo $locale['index']['name'];?> |
64 | </th> |
65 | <th> |
66 | <?php echo $locale['index']['description'];?> |
67 | </th> |
68 | </tr> |
69 | <?php |
70 | $pair = true; |
71 | foreach ($groups->overview as $g => $d) { |
72 | $pair = !$pair; |
73 | $groupinfo = $nntp->group($g); |
30359882 |
74 | $newarts = $nntp->newnews($profile['lastnews'],$g); |
90962c86 |
75 | ?> |
7ce9f53d |
76 | <tr class="<?php echo ($pair?$css["pair"]:$css["impair"]);?>" > |
77 | <td class="<?php echo $css["total"]; ?>"> |
90962c86 |
78 | <?php echo $groupinfo[0]; ?> |
79 | </td> |
7ce9f53d |
80 | <td class="<?php echo $css["unread"]; ?>"> |
30359882 |
81 | <?php echo sizeof($newarts); ?> |
90962c86 |
82 | </td> |
7ce9f53d |
83 | <td class="<?php echo $css["group"]; ?>"> |
90962c86 |
84 | <?php echo "<a href=\"thread.php?group=$g\">$g</a>";?> |
85 | </td> |
7ce9f53d |
86 | <td class="<?php echo $css["description"]; ?>"> |
90962c86 |
87 | <?php echo $d[0];?> |
88 | </td> |
89 | </tr> |
90 | <?php |
91 | } |
92 | ?> |
93 | </table> |
94 | <?php |
95 | |
96 | displayshortcuts(); |
97 | |
98 | $nntp->quit(); |
99 | require("include/footer.inc.php"); |
100 | ?> |