2 /********************************************************************************
3 * install.d/config.inc.php : configuration file
4 * --------------------------
6 * This file is part of the banana distribution
7 * Copyright: See COPYING files that comes with this distribution
8 ********************************************************************************/
10 require_once("include/misc.inc.php");
11 require_once("include/error.inc.php");
17 var $hdecode = array('from','name','organization','subject');
18 var $parse_hdr = array('content-transfer-encoding', 'content-type', 'date', 'followup-to', 'from',
19 'message-id', 'newsgroups', 'organization', 'references', 'subject', 'x-face');
20 var $show_hdr = array('from', 'subject', 'newsgroups', 'followup', 'date', 'organization', 'references', 'x-face');
29 var $custom = "Content-Type: text/plain; charset=iso-8859-15\nMime-Version: 1.0\nContent-Transfer-Encoding: 8bit\nUser-Agent: Banana @VERSION@\n";
31 var $host = 'news://localhost:119/';
33 var $profile = Array( 'name' => 'Anonymous <anonymouse@example.com', 'sig' => '', 'org' => '',
34 'customhdr' =>'', 'display' => 0, 'lastnews' => 0, 'locale' => 'fr_FR', 'subscribe' => array());
44 if (function_exists('hook_banana')) {
47 $this->_setupProfile();
48 require_once('include/NetNNTP.inc.php');
49 $this->nntp
= new nntp($this->host
);
52 /**************************************************************************/
54 /**************************************************************************/
56 function action_listGroups()
58 $this->newGroup(BANANA_GROUP_SUB
);
60 $cuts = displayshortcuts();
61 $res = '<h1>'._b_('Les forums de Banana').'</h1>'.$cuts.$this->groups
->to_html();
62 if (count($this->newgroups
->overview
)) {
63 $res .= '<p>'._b_('Les forums suivants ont été créés depuis ton dernier passage :').'</p>';
64 $res .= $this->newgroups
->to_html();
71 function action_showThread($group, $first)
73 $this->newSpool($group, $this->profile
['display'], $this->profile
['lastnews']);
75 if ($first > count($this->spool
->overview
)) {
76 $first = count($this->spool
->overview
);
79 $first = $first - ($first %
$this->tmax
) +
1;
81 $cuts = displayshortcuts($first);
83 $res = '<h1>'.$group.'</h1>'.$cuts;
84 $res .= $this->spool
->to_html($first, $first+
$this->tmax
);
91 function action_showArticle($group, $id)
93 $this->newSpool($group, $this->profile
['display'], $this->profile
['lastnews']);
96 if ($this->nntp
->lasterrorcode
== "423") {
97 $this->spool
->delid($id);
100 return displayshortcuts().'<p class="error">'._b_('Impossible d\'accéder au message. Le message a peut-être été annulé').'</p>';
103 $cuts = displayshortcuts();
104 $res = '<h1>'._b_('Message').'</h1>'.$cuts;
105 $res .= $this->post
->to_html();
112 /**************************************************************************/
114 /**************************************************************************/
116 function newSpool($group, $disp=0, $since='') {
117 require_once('include/spool.inc.php');
118 $this->spool
= new BananaSpool($group, $disp, $since);
121 function newPost($id)
123 require_once("include/post.inc.php");
124 $this->post
= new BananaPost($id);
129 require_once("include/groups.inc.php");
130 $this->groups
= new BananaGroups(BANANA_GROUP_SUB
);
131 if ($this->groups
->type
== BANANA_GROUP_SUB
) {
132 $this->newgroups
= new BananaGroups(BANANA_GROUP_NEW
);
136 /**************************************************************************/
138 /**************************************************************************/
140 function _setupProfile()
142 if (function_exists('hook_getprofile')) {
143 $this->profile
= hook_getprofile();
146 setlocale(LC_ALL
, $this->profile
['locale']);
150 $banana = new Banana
;