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_once("include/session.inc.php");
11 require_once("include/password.inc.php");
12 require_once("include/NetNNTP.inc.php");
13 require_once("include/groups.inc.php");
14 require_once("include/format.inc.php");
15 require_once("include/config.inc.php");
16 require_once("include/profile.inc.php");
17 require_once("include/error.inc.php");
19 $profile=getprofile();
20 require_once($profile['locale']);
22 require_once("include/header.inc.php");
24 $nntp = new nntp($news['server']);
25 if (!$nntp) error("nntpsock");
26 if ($news['user']!="anonymous") {
27 $result = $nntp->authinfo($news["user"],$news["pass"]);
28 if (!$result) error("nntpauth");
30 $groups = new groups($nntp,0);
31 if (!count($groups->overview
)) $groups=new groups($nntp,2);
33 $newgroups = new groups($nntp,1);
37 <?php
echo $locale['index']['title'];?
>
41 if (!sizeof($groups->overview
)) error("nntpgroups");
46 <table
class="<?php echo $css["bicol
"];?>" cellspacing
="0" cellpadding
="2"
47 summary
="<?php echo $locale['index']['summary'];?>">
50 <?php
echo $locale['index']['total'];?
>
53 <?php
echo $locale['index']['unread'];?
>
56 <?php
echo $locale['index']['name'];?
>
59 <?php
echo $locale['index']['description'];?
>
64 foreach ($groups->overview
as $g => $d) {
66 $groupinfo = $nntp->group($g);
67 $newarts = $nntp->newnews($profile['lastnews'],$g);
69 <tr
class="<?php echo ($pair?$css["pair
"]:$css["impair
"]);?>" >
70 <td
class="<?php echo $css["total
"]; ?>">
71 <?php
echo $groupinfo[0]; ?
>
73 <td
class="<?php echo $css["unread
"]; ?>">
74 <?php
echo sizeof($newarts); ?
>
76 <td
class="<?php echo $css["group
"]; ?>">
77 <?php
echo "<a href=\"thread.php?group=$g\">$g</a>";?
>
79 <td
class="<?php echo $css["description
"]; ?>">
88 if (count($newgroups->overview
) and count($profile['subscribe'])) {
91 <?php
echo $locale['index']['newgroupstext']; ?
>
93 <table
class="<?php echo $css["bicol
"];?>" cellspacing
="0" cellpadding
="2"
94 summary
="<?php echo $locale['index']['summary'];?>">
97 <?php
echo $locale['index']['total'];?
>
100 <?php
echo $locale['index']['name'];?
>
103 <?php
echo $locale['index']['description'];?
>
108 foreach ($newgroups->overview
as $g => $d) {
110 $groupinfo = $nntp->group($g);
112 <tr
class="<?php echo ($pair?$css["pair
"]:$css["impair
"]);?>" >
113 <td
class="<?php echo $css["total
"]; ?>">
114 <?php
echo $groupinfo[0]; ?
>
116 <td
class="<?php echo $css["group
"]; ?>">
117 <?php
echo "<a href=\"thread.php?group=$g\">$g</a>";?
>
119 <td
class="<?php echo $css["description
"]; ?>">
128 } // new newsgroups ?
133 require_once("include/footer.inc.php");