return $spool;
}
- private function compare(&$a, &$b)
+ private function compare($a, $b)
{
return ($b->date - $a->date);
}
// Remove from the message tree
if (!is_null($parent)) {
+ $time = time();
foreach ($parent->children as $key=>&$child) {
if ($child === $overview) {
unset($parent->children[$key]);
}
}
if (sizeof($overview->children)) {
- $parent->children = array_merge($parent->children, $overview->children);
foreach ($overview->children as &$child) {
+ $parent->children[] =& $child;
+ $child->time = $time;
$child->parent =& $parent;
}
}
- $time = time();
while (!is_null($parent)) {
$parent->desc--;
$parent->time = $time;
}
}
- public function formatDate(BananaSpoolHead &$head)
+ public function formatDate(BananaSpoolHead $head)
{
$stamp = $head->date;
$today = intval(time() / (24*3600));
return strftime($format, $stamp);
}
- public function formatSubject(BananaSpoolHead &$head)
+ public function formatSubject(BananaSpoolHead $head)
{
$subject = $popup = $head->subject;
$popup = $subject;
if (empty($subject)) {
$subject = _b_('(pas de sujet)');
}
- if ($head->id != Banana::$artid) {
+ if ($head->id !== Banana::$artid) {
$subject = Banana::$page->makeLink(Array('group' => $this->group, 'artid' => $head->id,
'text' => $subject, 'popup' => $popup));
}
return $subject . $link;
}
- public function formatFrom(BananaSpoolHead &$head)
+ public function formatFrom(BananaSpoolHead $head)
{
return BananaMessage::formatFrom($head->from);
}
return Banana::$first ? Banana::$spool_tmax : Banana::$spool_tcontext;
}
-
- /** computes linear post index
- * @param $_id INTEGER MSGNUM of post
- * @return INTEGER linear index of post
- */
- public function getNdX($_id)
- {
- $ndx = 1;
- $id_cur = $_id;
- while (true) {
- $id_parent = $this->overview[$id_cur]->parent;
- if (is_null($id_parent)) break;
- $pos = array_search($id_cur, $this->overview[$id_parent]->children);
-
- for ($i = 0; $i < $pos ; $i++) {
- $ndx += $this->overview[$this->overview[$id_parent]->children[$i]]->desc;
- }
- $ndx++; //noeud père
-
- $id_cur = $id_parent;
- }
-
- foreach ($this->roots as $i) {
- if ($i==$id_cur) {
- break;
- }
- $ndx += $this->overview[$i]->desc;
- }
- return $ndx;
- }
-
/** Return root message of the given thread
* @param id INTEGER id of a message
*/
/** Look for an unread message in the thread rooted by the message
* @param id INTEGER message number
*/
- private function _nextUnread(BananaSpoolHead &$cur)
+ private function _nextUnread(BananaSpoolHead $cur)
{
if (!$cur->isread) {
return $cur->id;