2 /********************************************************************************
3 * index.php : main page (newsgroups list)
6 * This file is part of the banana distribution
7 * Copyright: See COPYING files that comes with this distribution
8 ********************************************************************************/
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");
16 require("include/profile.inc.php");
18 $profile=getprofile();
19 require($profile['locale']);
21 require("include/header.inc.php");
23 $nntp = new nntp($news['server']);
24 if ($news['user']!="anonymous") {
25 $result = $nntp->authinfo($news["user"],$news["pass"]);
27 echo "<p class=\"error\">\n\t".$locale['error']['credentials']
29 require("include/footer.inc.php");
33 $groups = new groups($nntp,0);
34 $newgroups = new groups($nntp,1);
37 <div
class="<?php echo $css["title
"];?>">
38 <?php
echo $locale['index']['title'];?
>
42 if (!sizeof($groups->overview
)) {
43 echo "<p class=\"{$css['normal']}\">";
44 echo "\n".$locale['error']['nogroup']."\n";
46 require("include/footer.inc.php");
53 <table
class="<?php echo $css["bicol
"];?>" cellspacing
="0" cellpadding
="2"
54 summary
="<?php echo $locale['index']['summary'];?>">
57 <?php
echo $locale['index']['total'];?
>
60 <?php
echo $locale['index']['unread'];?
>
63 <?php
echo $locale['index']['name'];?
>
66 <?php
echo $locale['index']['description'];?
>
71 foreach ($groups->overview
as $g => $d) {
73 $groupinfo = $nntp->group($g);
74 $newarts = $nntp->newnews($profile['lastnews'],$g);
76 <tr
class="<?php echo ($pair?$css["pair
"]:$css["impair
"]);?>" >
77 <td
class="<?php echo $css["total
"]; ?>">
78 <?php
echo $groupinfo[0]; ?
>
80 <td
class="<?php echo $css["unread
"]; ?>">
81 <?php
echo sizeof($newarts); ?
>
83 <td
class="<?php echo $css["group
"]; ?>">
84 <?php
echo "<a href=\"thread.php?group=$g\">$g</a>";?
>
86 <td
class="<?php echo $css["description
"]; ?>">
95 if (count($newgroups->overview
) and count($profile['subscribe'])) {
98 <?php
echo $locale['index']['newgroupstext']; ?
>
100 <table
class="<?php echo $css["bicol
"];?>" cellspacing
="0" cellpadding
="2"
101 summary
="<?php echo $locale['index']['summary'];?>">
104 <?php
echo $locale['index']['total'];?
>
107 <?php
echo $locale['index']['name'];?
>
110 <?php
echo $locale['index']['description'];?
>
115 foreach ($newgroups->overview
as $g => $d) {
117 $groupinfo = $nntp->group($g);
119 <tr
class="<?php echo ($pair?$css["pair
"]:$css["impair
"]);?>" >
120 <td
class="<?php echo $css["total
"]; ?>">
121 <?php
echo $groupinfo[0]; ?
>
123 <td
class="<?php echo $css["group
"]; ?>">
124 <?php
echo "<a href=\"thread.php?group=$g\">$g</a>";?
>
126 <td
class="<?php echo $css["description
"]; ?>">
135 } // new newsgroups ?
140 require("include/footer.inc.php");