95f1fb2ce71cd8cac5907446fc4a4f0342ab746f
2 /********************************************************************************
3 * subscribe.php : subscriptions page
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/subscribe.inc.php");
18 require_once("include/error.inc.php");
20 $profile=getprofile();
21 require_once("include/header.inc.php");
23 $nntp = new nntp($news['server']);
24 if (!$nntp) error("nntpsock");
25 if ($news['user']!="anonymous") {
26 $result = $nntp->authinfo($news["user"],$news["pass"]);
27 if (!$result) error("nntpauth");
29 $groups = new groups($nntp,2);
33 <?php
echo _('Abonnements'); ?
>
38 if (isset($_POST['subscribe']) && isset($_POST['action'])
39 && $_POST['action']=="OK") {
40 update_subscriptions($_POST['subscribe']);
41 $profile['subscribe']=$_POST['subscribe'];
44 if (!sizeof($groups->overview
)) error("nntpgroups");
49 <form method
="post" action
="<?php echo $_SERVER['PHP_SELF'];?>">
50 <table
class="<?php echo $css["bicol
"];?>" cellspacing
="0" cellpadding
="2">
53 <?php
echo _('Total'); ?
>
56 <?php
echo _('Abonné'); ?
>
59 <?php
echo _('Nom'); ?
>
62 <?php
echo _('Description'); ?
>
67 foreach ($groups->overview
as $g => $d) {
69 $groupinfo = $nntp->group($g);
70 $newarts = $nntp->newnews($profile['lastnews'],$g);
72 <tr
class="<?php echo ($pair?$css["pair
"]:$css["impair
"]);?>" >
73 <td
class="<?php echo $css["total
"]; ?>">
74 <?php
echo $groupinfo[0]; ?
>
76 <td
class="<?php echo $css["unread
"]; ?>">
77 <input type
="checkbox" name
="subscribe[]" value
="<?php echo $g;?>"
78 <?php
echo (in_array($g,$profile['subscribe'])?
'checked="checked"'
81 <td
class="<?php echo $css["group
"]; ?>">
82 <?php
echo "<a href=\"thread.php?group=$g\">$g</a>";?
>
84 <td
class="<?php echo $css["description
"]; ?>">
91 <tr
class="<?php echo (!$pair?$css["pair
"]:$css["impair
"]); ?>">
92 <td colspan
="4" class="bouton">
93 <input type
="submit" name
="action" value
="OK" />
103 require_once("include/footer.inc.php");