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/misc.inc.php");
12 require_once("include/password.inc.php");
13 require_once("include/NetNNTP.inc.php");
14 require_once("include/groups.inc.php");
15 require_once("include/format.inc.php");
16 require_once("include/config.inc.php");
17 require_once("include/profile.inc.php");
18 require_once("include/subscribe.inc.php");
19 require_once("include/error.inc.php");
21 $profile=getprofile();
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 BananaGroups($nntp,2);
34 <?php
echo _b_('Abonnements'); ?
>
39 if (isset($_POST['subscribe']) && isset($_POST['action'])
40 && $_POST['action']=="OK") {
41 update_subscriptions($_POST['subscribe']);
42 $profile['subscribe']=$_POST['subscribe'];
45 if (!sizeof($groups->overview
)) error("nntpgroups");
50 <form method
="post" action
="<?php echo $_SERVER['PHP_SELF'];?>">
51 <table
class="<?php echo $css["bicol
"];?>" cellspacing
="0" cellpadding
="2">
54 <?php
echo _b_('Total'); ?
>
57 <?php
echo _b_('Abonné'); ?
>
60 <?php
echo _b_('Nom'); ?
>
63 <?php
echo _b_('Description'); ?
>
68 foreach ($groups->overview
as $g => $d) {
70 $groupinfo = $nntp->group($g);
71 $newarts = $nntp->newnews($profile['lastnews'],$g);
73 <tr
class="<?php echo ($pair?$css["pair
"]:$css["impair
"]);?>" >
74 <td
class="<?php echo $css["total
"]; ?>">
75 <?php
echo $groupinfo[0]; ?
>
77 <td
class="<?php echo $css["unread
"]; ?>">
78 <input type
="checkbox" name
="subscribe[]" value
="<?php echo $g;?>"
79 <?php
echo (in_array($g,$profile['subscribe'])?
'checked="checked"'
82 <td
class="<?php echo $css["group
"]; ?>">
83 <?php
echo "<a href=\"thread.php?group=$g\">$g</a>";?
>
85 <td
class="<?php echo $css["description
"]; ?>">
92 <tr
class="<?php echo (!$pair?$css["pair
"]:$css["impair
"]); ?>">
93 <td colspan
="4" class="bouton">
94 <input type
="submit" name
="action" value
="OK" />
104 require_once("include/footer.inc.php");