=20A=20l'heure=20actuelle=20seuls=20les=20x-faces=20semblent=20ne=20pas=20passer=20correctement...?=
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: 8bit
git-svn-id: svn+ssh://murphy/home/svn/banana/trunk@46
9869982d-c50d-0410-be91-
f2a2ec7c7c7b
$url = parse_url($_url);
$this->ns = fsockopen($url['host'], $url['port'], $errno, $errstr, $_timeout);
if (!$this->ns) {
- $this = false;
- return false;
+ return null;
}
$result = $this->gline();
$this->type = $_type;
$desc = $banana->nntp->xgtitle();
+
+ $this->load();
- if ($_type == BANANA_GROUP_NEW) {
+ if (empty($this->overview) && $_type == BANANA_GROUP_SUB) {
+ $this->type = BANANA_GROUP_ALL;
+ $this->load();
+ }
+ }
+
+ /** Load overviews
+ */
+ function load()
+ {
+ global $banana;
+
+ if ($this->type == BANANA_GROUP_NEW) {
$list = $banana->nntp->newgroups($banana->profile['lastnews']);
} else {
$list = $banana->nntp->liste();
- if ($_type == BANANA_GROUP_SUB) {
+ if ($this->type == BANANA_GROUP_SUB) {
$mylist = Array();
foreach ($banana->profile['subscribe'] as $g) {
if (isset($list[$g])) {
$this->overview[$g][1] = $l[0];
}
ksort($this->overview);
-
- if (empty($this->overview) && $_type == BANANA_GROUP_SUB) {
- $this = new BananaGroups(BANANA_GROUP_ALL);
- }
}
/** updates overview
$this->id = $_id;
$this->pj = array();
$this->messages = array();
- $this->_header();
+ if (!$this->_header()) {
+ return null;
+ }
+
if ($body = $banana->nntp->body($_id)) {
$this->body = join("\n", $body);
} else {
- return ($this = null);
+ return null;
}
if (isset($this->headers['content-transfer-encoding'])) {
global $banana;
$hdrs = $banana->nntp->head($this->id);
if (!$hdrs) {
- $this = null;
return false;
}
$this->name = $this->headers['from'];
$this->name = preg_replace('/<[^ ]*>/', '', $this->name);
$this->name = trim($this->name);
+ return true;
}
function checkcancel()
* Copyright: See COPYING files that comes with this distribution
********************************************************************************/
-if(!function_exists('_file_put_contents')) {
+if(!function_exists('file_put_contents')) {
function file_put_contents($filename, $data)
{
$fp = fopen($filename, 'w');
global $banana;
$this->group = $_group;
$groupinfo = $banana->nntp->group($_group);
- if (!$groupinfo) { return ($this = null); }
+ if (!$groupinfo) { return null; }
$this->_readFromFile();
{
$file = $this->_spoolfile();
if (file_exists($file)) {
- $this = unserialize(file_get_contents($file));
+ $temp = unserialize(file_get_contents($file));
+ foreach (get_object_vars($temp) as $key=>$val) {
+ $this->$key = $val;
+ }
}
}