phpgroupware-cvs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Phpgroupware-cvs] CVS: forum/inc bar.inc.php,1.9,1.10 class.boforum.inc


From: Miles Lott <address@hidden>
Subject: [Phpgroupware-cvs] CVS: forum/inc bar.inc.php,1.9,1.10 class.boforum.inc.php,1.6,1.7 class.soforum.inc.php,1.6,1.7 class.uiforum.inc.php,1.6,1.7 functions.inc.php,1.14,1.15
Date: Wed, 20 Mar 2002 07:38:10 -0500

Update of /cvsroot/phpgroupware/forum/inc
In directory subversions:/tmp/cvs-serv10877

Modified Files:
        bar.inc.php class.boforum.inc.php class.soforum.inc.php 
        class.uiforum.inc.php functions.inc.php 
Log Message:
formatting

Index: bar.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/forum/inc/bar.inc.php,v
retrieving revision 1.9
retrieving revision 1.10
diff -C2 -r1.9 -r1.10
*** bar.inc.php 14 Jul 2001 01:32:27 -0000      1.9
--- bar.inc.php 20 Mar 2002 12:37:42 -0000      1.10
***************
*** 5,11 ****
        * Written by Jani Hirvinen <address@hidden>                             
  *
        * -------------------------------------------                           
      *
!       *  This program is free software; you   can redistribute it and/or 
modify it   *
!       *  under the terms of   the GNU General Public License as published by 
the  *
!       *  Free Software Foundation; either version 2   of the License, or (at 
your *
        *  option) any later version.                                           
      *
        
\*****************************************************************************/
--- 5,11 ----
        * Written by Jani Hirvinen <address@hidden>                             
  *
        * -------------------------------------------                           
      *
!       *  This program is free software; you   can redistribute it and/or 
modify it  *
!       *  under the terms of   the GNU General Public License as published by 
the    *
!       *  Free Software Foundation; either version 2   of the License, or (at 
your   *
        *  option) any later version.                                           
      *
        
\*****************************************************************************/
***************
*** 13,26 ****
        /* $Id$ */
  
!  // Forums bar is created here
! 
!  echo "<font size=-1>";
!  echo "[ <a href=" . 
$phpgw->link("/forum/post.php","$catfor&type=new&col=$col") . ">" . lang("New 
Topic") . "</a> | ";
!  if(!$col) echo "<a href=" . 
$phpgw->link("/forum/threads.php","$catfor&col=1") . ">" . lang("View Threads") 
. "</a>  ";
!  if($col) echo "<a href=" . 
$phpgw->link("/forum/threads.php","$catfor&col=0") . ">" . lang("Collapse 
Threads") . "</a> ";
!  //echo "<a href=" . $phpgw->link("/forum/search.php","$catfor") . ">" . 
lang("Search") . "</a> ";
! 
!  echo "]</font><br><br>";
  
  ?>
- 
--- 13,29 ----
        /* $Id$ */
  
!       // Forums bar is created here
!       echo '<font size=-1>';
!       echo '[ <a href="' . 
$GLOBALS['phpgw']->link('/forum/post.php',"$catfor&type=new&col=$col") . '">' . 
lang('New Topic') . '</a> | ';
!       if(!$col)
!       {
!               echo '<a href="' . 
$GLOBALS['phpgw']->link('/forum/threads.php',"$catfor&col=1") . '">' . 
lang('View Threads') . '</a>  ';
!       }
!       if($col)
!       {
!               echo '<a href="' . 
$GLOBALS['phpgw']->link('/forum/threads.php',"$catfor&col=0") . '">' . 
lang('Collapse Threads') . '</a> ';
!       }
!       //echo '<a href="' . 
$GLOBALS['phpgw']->link('/forum/search.php',"$catfor") . '">' . lang('Search') 
. '</a> ';
  
+       echo ']</font><br><br>';
  ?>

Index: class.boforum.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/forum/inc/class.boforum.inc.php,v
retrieving revision 1.6
retrieving revision 1.7
diff -C2 -r1.6 -r1.7
*** class.boforum.inc.php       15 Feb 2002 03:55:11 -0000      1.6
--- class.boforum.inc.php       20 Mar 2002 12:37:42 -0000      1.7
***************
*** 19,30 ****
                        'reply' => True,
                        'post'  => True,
!                       'delete_category'       => True,
!                       'delete_forum'  => True,
!                       'category'      => True,
!                       'forum' => True
                );
  
                var $debug = False;
!               
                var $so;
  
--- 19,30 ----
                        'reply' => True,
                        'post'  => True,
!                       'delete_category' => True,
!                       'delete_forum'    => True,
!                       'category' => True,
!                       'forum' => True
                );
  
                var $debug = False;
! 
                var $so;
  
***************
*** 92,100 ****
                        {
                                $data = Array(
!                                       'cat_id'        => 
$GLOBALS['HTTP_POST_VARS']['cat_id'],
!                                       'forum_id'      => 
$GLOBALS['HTTP_POST_VARS']['forum_id'],
!                                       'postdate'      => time() - ((60 * 60) 
* intval($GLOBALS['phpgw_info']['user']['preferences']['common']['tz_offset'])),
!                                       'subject'       => 
$GLOBALS['HTTP_POST_VARS']['subject'],
!                                       'message'       => 
$GLOBALS['HTTP_POST_VARS']['message']
                                );
  
--- 92,100 ----
                        {
                                $data = Array(
!                                       'cat_id'   => 
$GLOBALS['HTTP_POST_VARS']['cat_id'],
!                                       'forum_id' => 
$GLOBALS['HTTP_POST_VARS']['forum_id'],
!                                       'postdate' => time() - ((60 * 60) * 
intval($GLOBALS['phpgw_info']['user']['preferences']['common']['tz_offset'])),
!                                       'subject'  => 
$GLOBALS['HTTP_POST_VARS']['subject'],
!                                       'message'  => 
$GLOBALS['HTTP_POST_VARS']['message']
                                );
  
***************
*** 126,137 ****
                                $data = Array(
                                        'pos' => 
$GLOBALS['HTTP_POST_VARS']['pos'],
!                                       'thread'        => 
$GLOBALS['HTTP_POST_VARS']['thread'],
!                                       'depth' => 
$GLOBALS['HTTP_POST_VARS']['depth'],
!                                       'postdate'      => time() - ((60 * 60) 
* intval($GLOBALS['phpgw_info']['user']['preferences']['common']['tz_offset'])),
!                                       'parent'        => 
$GLOBALS['HTTP_POST_VARS']['msg'],
!                                       'cat_id'        => 
$GLOBALS['HTTP_POST_VARS']['cat_id'],
!                                       'forum_id'      => 
$GLOBALS['HTTP_POST_VARS']['forum_id'],
!                                       'subject'       => 
$GLOBALS['HTTP_POST_VARS']['subject'],
!                                       'message'       => 
$GLOBALS['HTTP_POST_VARS']['message']
                                );
  
--- 126,137 ----
                                $data = Array(
                                        'pos' => 
$GLOBALS['HTTP_POST_VARS']['pos'],
!                                       'thread'   => 
$GLOBALS['HTTP_POST_VARS']['thread'],
!                                       'depth'    => 
$GLOBALS['HTTP_POST_VARS']['depth'],
!                                       'postdate' => time() - ((60 * 60) * 
intval($GLOBALS['phpgw_info']['user']['preferences']['common']['tz_offset'])),
!                                       'parent'   => 
$GLOBALS['HTTP_POST_VARS']['msg'],
!                                       'cat_id'   => 
$GLOBALS['HTTP_POST_VARS']['cat_id'],
!                                       'forum_id' => 
$GLOBALS['HTTP_POST_VARS']['forum_id'],
!                                       'subject'  => 
$GLOBALS['HTTP_POST_VARS']['subject'],
!                                       'message'  => 
$GLOBALS['HTTP_POST_VARS']['message']
                                );
  

Index: class.soforum.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/forum/inc/class.soforum.inc.php,v
retrieving revision 1.6
retrieving revision 1.7
diff -C2 -r1.6 -r1.7
*** class.soforum.inc.php       15 Mar 2002 03:52:34 -0000      1.6
--- class.soforum.inc.php       20 Mar 2002 12:37:42 -0000      1.7
***************
*** 17,21 ****
        {
                var $debug=False;
!               
                var $db;
  
--- 17,21 ----
        {
                var $debug=False;
! 
                var $db;
  
***************
*** 96,102 ****
                        $this->db->query('insert into phpgw_forum_threads 
(pos,thread,depth,postdate,main,parent,cat_id,for_id,thread_owner,subject,stat,n_replies)
 '
                                
.'VALUES('.$data['pos'].','.$data['thread'].','.$data['depth'].",'".$this->db->to_timestamp($data['postdate'])."',"
!                                       . ($this->get_max_body_id() + 
1).','.$data['parent'].','.$data['cat_id'].','
!                                       . 
$data['forum_id'].','.$GLOBALS['phpgw_info']['user']['account_id'].",'"
!                                       . 
$this->db->db_addslashes($data['subject']) . "',0,0)",__LINE__,__FILE__);
                        $this->db->query('update phpgw_forum_threads set 
n_replies = n_replies+1 where thread='.$data['thread'],__LINE__,__FILE__);
                        $this->db->query('insert into phpgw_forum_body 
(cat_id,for_id,message) VALUES 
('.$data['cat_id'].','.$data['forum_id'].",'".$this->db->db_addslashes($data['message'])."')",__LINE__,__FILE__);
--- 96,102 ----
                        $this->db->query('insert into phpgw_forum_threads 
(pos,thread,depth,postdate,main,parent,cat_id,for_id,thread_owner,subject,stat,n_replies)
 '
                                
.'VALUES('.$data['pos'].','.$data['thread'].','.$data['depth'].",'".$this->db->to_timestamp($data['postdate'])."',"
!                               . ($this->get_max_body_id() + 
1).','.$data['parent'].','.$data['cat_id'].','
!                               . 
$data['forum_id'].','.$GLOBALS['phpgw_info']['user']['account_id'].",'"
!                               . $this->db->db_addslashes($data['subject']) . 
"',0,0)",__LINE__,__FILE__);
                        $this->db->query('update phpgw_forum_threads set 
n_replies = n_replies+1 where thread='.$data['thread'],__LINE__,__FILE__);
                        $this->db->query('insert into phpgw_forum_body 
(cat_id,for_id,message) VALUES 
('.$data['cat_id'].','.$data['forum_id'].",'".$this->db->db_addslashes($data['message'])."')",__LINE__,__FILE__);
***************
*** 109,113 ****
                                .'VALUES 
(0,'.$next_f_body_id.",0,'".$this->db->to_timestamp($data['postdate'])."',".$next_f_body_id.',-1,'.$data['cat_id'].','.$data['forum_id']
                                
.','.$GLOBALS['phpgw_info']['user']['account_id'] . 
",'".$this->db->db_addslashes($data['subject'])."',0,0)",__LINE__,__FILE__);
!                               
                        $this->db->query('insert into phpgw_forum_body 
(cat_id,for_id,message) VALUES 
('.$data['cat_id'].','.$data['forum_id'].",'".$this->db->db_addslashes($data['message'])."')",__LINE__,__FILE__);
                }
--- 109,113 ----
                                .'VALUES 
(0,'.$next_f_body_id.",0,'".$this->db->to_timestamp($data['postdate'])."',".$next_f_body_id.',-1,'.$data['cat_id'].','.$data['forum_id']
                                
.','.$GLOBALS['phpgw_info']['user']['account_id'] . 
",'".$this->db->db_addslashes($data['subject'])."',0,0)",__LINE__,__FILE__);
! 
                        $this->db->query('insert into phpgw_forum_body 
(cat_id,for_id,message) VALUES 
('.$data['cat_id'].','.$data['forum_id'].",'".$this->db->db_addslashes($data['message'])."')",__LINE__,__FILE__);
                }
***************
*** 153,159 ****
                        {
                                $cat[] = Array(
!                                       'id'    => $this->db->f('id'),
!                                       'name'  => $this->db->f('name'),
!                                       'descr' => $this->db->f('descr')
                                );
                        }
--- 153,159 ----
                        {
                                $cat[] = Array(
!                                       'id'    => $this->db->f('id'),
!                                       'name'  => $this->db->f('name'),
!                                       'descr' => $this->db->f('descr')
                                );
                        }
***************
*** 168,174 ****
                                $this->db->next_record();
                                $cat = Array(
!                                       'id'    =>      $cat_id,
!                                       'name'  => $this->db->f('name'),
!                                       'descr' => $this->db->f('descr')
                                );
                        }
--- 168,174 ----
                                $this->db->next_record();
                                $cat = Array(
!                                       'id'    => $cat_id,
!                                       'name'  => $this->db->f('name'),
!                                       'descr' => $this->db->f('descr')
                                );
                        }
***************
*** 213,220 ****
                        {
                                $forum[] = Array(
!                                       'cat_id'        =>      $cat_id,
!                                       'id'    => $this->db->f('id'),
!                                       'name'  => $this->db->f('name'),
!                                       'descr' => $this->db->f('descr')
                                );
                        }
--- 213,220 ----
                        {
                                $forum[] = Array(
!                                       'cat_id' => $cat_id,
!                                       'id'     => $this->db->f('id'),
!                                       'name'   => $this->db->f('name'),
!                                       'descr'  => $this->db->f('descr')
                                );
                        }
***************
*** 242,254 ****
                                }
                                $thread[] = Array(
!                                       'id'    => $this->db->f('id'),
!                                       'subject'       => 
$this->db->f('subject'),
!                                       'author'                => 
$this->db->f('thread_owner'),
!                                       'replies'       => 
$this->db->f('n_replies'),
!                                       'pos'           => $this->db->f('pos'),
!                                       'depth' => $this->db->f('depth'),
                                        'last_reply'=> 
($last_post?$last_post:$GLOBALS['phpgw']->common->show_date($this->db->from_timestamp($this->db->f('postdate'))))
                                );
- 
                        }
                        return $thread;
--- 242,253 ----
                                }
                                $thread[] = Array(
!                                       'id'      => $this->db->f('id'),
!                                       'subject' => $this->db->f('subject'),
!                                       'author'  => 
$this->db->f('thread_owner'),
!                                       'replies' => $this->db->f('n_replies'),
!                                       'pos'     => $this->db->f('pos'),
!                                       'depth'   => $this->db->f('depth'),
                                        'last_reply'=> 
($last_post?$last_post:$GLOBALS['phpgw']->common->show_date($this->db->from_timestamp($this->db->f('postdate'))))
                                );
                        }
                        return $thread;
***************
*** 268,272 ****
                        {
                                $subject = $this->db->f('subject');
!                               if (!$subject)
                                {
                                        $subject = '[ ' . lang('No subject') . 
' ]';
--- 267,271 ----
                        {
                                $subject = $this->db->f('subject');
!                               if(!$subject)
                                {
                                        $subject = '[ ' . lang('No subject') . 
' ]';
***************
*** 278,293 ****
  
                                $msg[] = Array(
!                                       'id'    => $this->db->f('id'),
!                                       'main'  => $this->db->f('main'),
!                                       'parent'        => 
$this->db->f('parent'),
!                                       'thread'        => 
$this->db->f('thread'),
!                                       'depth' => ($this->db->f('depth') + 1),
!                                       'pos'           => $this->db->f('pos'),
!                                       'subject'       => $subject,
!                                       'thread_owner'  => 
$this->db->f('thread_owner'),
!                                       'postdate'      => 
$this->db->f('postdate'),
!                                       'message'       => $message
                                );
- 
                        }
                        return $msg;
--- 277,291 ----
  
                                $msg[] = Array(
!                                       'id'       => $this->db->f('id'),
!                                       'main'     => $this->db->f('main'),
!                                       'parent'   => $this->db->f('parent'),
!                                       'thread'   => $this->db->f('thread'),
!                                       'depth'    => ($this->db->f('depth') + 
1),
!                                       'pos'      => $this->db->f('pos'),
!                                       'subject'  => $subject,
!                                       'thread_owner' => 
$this->db->f('thread_owner'),
!                                       'postdate' => $this->db->f('postdate'),
!                                       'message'  => $message
                                );
                        }
                        return $msg;

Index: class.uiforum.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/forum/inc/class.uiforum.inc.php,v
retrieving revision 1.6
retrieving revision 1.7
diff -C2 -r1.6 -r1.7
*** class.uiforum.inc.php       15 Feb 2002 03:55:11 -0000      1.6
--- class.uiforum.inc.php       20 Mar 2002 12:37:42 -0000      1.7
***************
*** 16,26 ****
        class uiforum
        {
- 
                var $public_functions = array(
                        'index' => True,
                        'forum' => True,
!                       'threads'       => True,
!                       'read'  => True,
!                       'post'  => True                 
                );
  
--- 16,25 ----
        class uiforum
        {
                var $public_functions = array(
                        'index' => True,
                        'forum' => True,
!                       'threads' => True,
!                       'read'  => True,
!                       'post'  => True
                );
  
***************
*** 52,59 ****
                {
                        $data = array(
!                               'view'=> $this->bo->view,
!                               'location'      => $this->bo->location,
!                               'cat_id'=> $this->bo->cat_id,
!                               'forum_id'      => $this->bo->forum_id
                        );
                        echo '<br>UI:';
--- 51,58 ----
                {
                        $data = array(
!                               'view'     => $this->bo->view,
!                               'location' => $this->bo->location,
!                               'cat_id'   => $this->bo->cat_id,
!                               'forum_id' => $this->bo->forum_id
                        );
                        echo '<br>UI:';
***************
*** 65,72 ****
                {
                        $data = array(
!                               'view'=> $this->bo->view,
!                               'location'      => $this->bo->location,
!                               'cat_id'=> $this->bo->cat_id,
!                               'forum_id'      => $this->bo->forum_id
                        );
                        $this->bo->save_sessiondata($data);
--- 64,71 ----
                {
                        $data = array(
!                               'view'     => $this->bo->view,
!                               'location' => $this->bo->location,
!                               'cat_id'   => $this->bo->cat_id,
!                               'forum_id' => $this->bo->forum_id
                        );
                        $this->bo->save_sessiondata($data);
***************
*** 83,87 ****
                        $this->template->set_file(
                                Array(
!                                       'INDEX' => 'index.body.tpl'
                                )
                        );
--- 82,86 ----
                        $this->template->set_file(
                                Array(
!                                       'INDEX' => 'index.body.tpl'
                                )
                        );
***************
*** 89,95 ****
  
                        $var = Array(
!                               'CAT_IMG'       => 
$GLOBALS['phpgw']->common->image('forum','category'),
!                               'BGROUND'       => 
$GLOBALS['phpgw_info']['theme']['th_bg'],
!                               'FORUM' => lang('Forum')
                        );
                        $this->template->set_var($var);
--- 88,94 ----
  
                        $var = Array(
!                               'CAT_IMG' => 
$GLOBALS['phpgw']->common->image('forum','category'),
!                               'BGROUND' => 
$GLOBALS['phpgw_info']['theme']['th_bg'],
!                               'FORUM'   => lang('Forum')
                        );
                        $this->template->set_var($var);
***************
*** 101,111 ****
                                $tr_color = 
$GLOBALS['phpgw']->nextmatchs->alternate_row_color($tr_color);
                                $var = Array(
!                                       'COLOR' => $tr_color,
!                                       'CAT'   => $cat['name'],
!                                       'DESC'  => $cat['descr'],
!                                       'CAT_LINK'      => 
$GLOBALS['phpgw']->link('/index.php',
                                                        Array(
!                                                               'menuaction'    
=> 'forum.uiforum.forum',
!                                                               'cat_id'        
=> $cat['id']
                                                        )
                                                ),
--- 100,110 ----
                                $tr_color = 
$GLOBALS['phpgw']->nextmatchs->alternate_row_color($tr_color);
                                $var = Array(
!                                       'COLOR' => $tr_color,
!                                       'CAT'   => $cat['name'],
!                                       'DESC'  => $cat['descr'],
!                                       'CAT_LINK' => 
$GLOBALS['phpgw']->link('/index.php',
                                                        Array(
!                                                               'menuaction' => 
'forum.uiforum.forum',
!                                                               'cat_id'     => 
$cat['id']
                                                        )
                                                ),
***************
*** 130,134 ****
                        $this->template->set_file(
                                Array(
!                                       '_list' => 'forums.body.tpl'
                                )
                        );
--- 129,133 ----
                        $this->template->set_file(
                                Array(
!                                       '_list' => 'forums.body.tpl'
                                )
                        );
***************
*** 140,148 ****
  
                        $var = Array(
!                               'BGROUND'       => 
$GLOBALS['phpgw_info']['theme']['th_bg'],
                                'FORUM_IMG' => 
$GLOBALS['phpgw']->common->image('forum','forum'),
!                               'CATEGORY'       => $cat['name'],
!                               'LANG_MAIN'      => lang('Forum'),
!                               'MAIN_LINK'      => 
$GLOBALS['phpgw']->link('/index.php','menuaction=forum.uiforum.index')
                        );
                        $this->template->set_var($var);
--- 139,147 ----
  
                        $var = Array(
!                               'BGROUND'   => 
$GLOBALS['phpgw_info']['theme']['th_bg'],
                                'FORUM_IMG' => 
$GLOBALS['phpgw']->common->image('forum','forum'),
!                               'CATEGORY'  => $cat['name'],
!                               'LANG_MAIN' => lang('Forum'),
!                               'MAIN_LINK' => 
$GLOBALS['phpgw']->link('/index.php','menuaction=forum.uiforum.index')
                        );
                        $this->template->set_var($var);
***************
*** 163,174 ****
                                        $this->template->set_var(
                                                Array(
!                                                       'NAME'              => 
$forum['name'],
!                                                       'DESC'              => 
$forum['descr'],
!                                                       'THREADS_LINK'      => 
$GLOBALS['phpgw']->link('/index.php',
!                                                                       Array(
!                                                                               
'menuaction'    => 'forum.uiforum.threads',
!                                                                               
'forum_id'      => $forum['id']
!                                                                       )
!                                                        ),
                                                        'value_last_post' => 
$forum['last_post'],
                                                        'value_total'     => 
$forum['total']
--- 162,173 ----
                                        $this->template->set_var(
                                                Array(
!                                                       'NAME'         => 
$forum['name'],
!                                                       'DESC'         => 
$forum['descr'],
!                                                       'THREADS_LINK' => 
$GLOBALS['phpgw']->link('/index.php',
!                                                               Array(
!                                                                       
'menuaction' => 'forum.uiforum.threads',
!                                                                       
'forum_id'   => $forum['id']
!                                                               )
!                                                       ),
                                                        'value_last_post' => 
$forum['last_post'],
                                                        'value_total'     => 
$forum['total']
***************
*** 192,196 ****
                        $forum = 
$this->bo->get_forum_info($this->bo->cat_id,$this->bo->forum_id);
  
!                       $pre_var        = array(
                                'BGROUND'        => 
$GLOBALS['phpgw_info']['theme']['th_bg'],
                                'LANG_TOPIC'     => lang('Topic'),
--- 191,195 ----
                        $forum = 
$this->bo->get_forum_info($this->bo->cat_id,$this->bo->forum_id);
  
!                       $pre_var = array(
                                'BGROUND'        => 
$GLOBALS['phpgw_info']['theme']['th_bg'],
                                'LANG_TOPIC'     => lang('Topic'),
***************
*** 203,218 ****
                                'LANG_FORUM'     => $forum['name'],
                                'FORUM_LINK'     => 
$GLOBALS['phpgw']->link('/index.php',
!                                               Array(
!                                                       'menuaction'    => 
'forum.uiforum.forum',
!                                                       'cat_id'        =>      
$this->bo->cat_id
!                                               )
!                                       ),
                                'MAIN_LINK'      => 
$GLOBALS['phpgw']->link('/index.php','menuaction=forum.uiforum.index'),
                                'POST_LINK'      => 
$GLOBALS['phpgw']->link('/index.php',
!                                               Array(
!                                                       'menuaction' => 
'forum.uiforum.post',
!                                                       'type'  => 'new'
!                                               )
                                        )
                        );
  
--- 202,217 ----
                                'LANG_FORUM'     => $forum['name'],
                                'FORUM_LINK'     => 
$GLOBALS['phpgw']->link('/index.php',
!                                       Array(
!                                               'menuaction' => 
'forum.uiforum.forum',
!                                               'cat_id'     => 
$this->bo->cat_id
!                                       )
!                               ),
                                'MAIN_LINK'      => 
$GLOBALS['phpgw']->link('/index.php','menuaction=forum.uiforum.index'),
                                'POST_LINK'      => 
$GLOBALS['phpgw']->link('/index.php',
!                                       Array(
!                                               'menuaction' => 
'forum.uiforum.post',
!                                               'type'       => 'new'
                                        )
+                               )
                        );
  
***************
*** 223,227 ****
                                $this->template->set_file(
                                        Array(
!                                               'COLLAPSE'      => 
'collapse.threads.tpl'
                                        )
                                );
--- 222,226 ----
                                $this->template->set_file(
                                        Array(
!                                               'COLLAPSE' => 
'collapse.threads.tpl'
                                        )
                                );
***************
*** 236,250 ****
                                        
                                        $var = Array(
!                                               'COLOR' => $GLOBALS['tr_color'],
!                                               'TOPIC' => 
($thread['subject']?$thread['subject']:'[No subject]'),
!                                               'AUTHOR'        => 
($thread['author']?$GLOBALS['phpgw']->common->grab_owner_name($thread['author']):lang('Unknown')),
!                                               'REPLIES'       => 
$thread['replies'],
!                                               'READ_LINK'     => 
$GLOBALS['phpgw']->link('/index.php',
!                                                               Array(
!                                                                       
'menuaction'    => 'forum.uiforum.read',
!                                                                       'msg'   
=> $thread['id']
!                                                               )
!                                                       ),
!                                               'LATESTREPLY'   => 
$thread['last_reply']
                                        );
                                        $this->template->set_var($var);
--- 235,249 ----
                                        
                                        $var = Array(
!                                               'COLOR'     => 
$GLOBALS['tr_color'],
!                                               'TOPIC'     => 
($thread['subject']?$thread['subject']:'[No subject]'),
!                                               'AUTHOR'    => 
($thread['author']?$GLOBALS['phpgw']->common->grab_owner_name($thread['author']):lang('Unknown')),
!                                               'REPLIES'   => 
$thread['replies'],
!                                               'READ_LINK' => 
$GLOBALS['phpgw']->link('/index.php',
!                                                       Array(
!                                                               'menuaction' => 
'forum.uiforum.read',
!                                                               'msg'        => 
$thread['id']
!                                                       )
!                                               ),
!                                               'LATESTREPLY' => 
$thread['last_reply']
                                        );
                                        $this->template->set_var($var);
***************
*** 252,261 ****
                                }
                                $var = Array(
!                                       'THREADS_LINK'  => 
$GLOBALS['phpgw']->link('/index.php',
!                                                       Array(
!                                                               'menuaction'    
=> 'forum.uiforum.threads',
!                                                               'view'  => 
'threads'
!                                                       )
!                                               ),
                                        'LANG_THREADS' => lang('View Threads')
                                );
--- 251,260 ----
                                }
                                $var = Array(
!                                       'THREADS_LINK' => 
$GLOBALS['phpgw']->link('/index.php',
!                                               Array(
!                                                       'menuaction' => 
'forum.uiforum.threads',
!                                                       'view'       => 
'threads'
!                                               )
!                                       ),
                                        'LANG_THREADS' => lang('View Threads')
                                );
***************
*** 268,272 ****
                                $this->template->set_file(
                                        Array(
!                                               'NORMAL'        => 
'normal.threads.tpl'
                                        )
                                );
--- 267,271 ----
                                $this->template->set_file(
                                        Array(
!                                               'NORMAL' => 'normal.threads.tpl'
                                        )
                                );
***************
*** 287,303 ****
  
                                        $var = Array(
!                                               'COLOR' => $GLOBALS['tr_color'],
!                                               'TOPIC' => 
($thread['subject']?$thread['subject']:'[No subject]'),
!                                               'AUTHOR'        => 
($thread['author']?$GLOBALS['phpgw']->common->grab_owner_name($thread['author']):lang('Unknown')),
!                                               'REPLIES'       => 
$thread['replies'],
!                                               'READ_LINK'     => 
$GLOBALS['phpgw']->link('/index.php',
!                                                               Array(
!                                                                       
'menuaction'    => 'forum.uiforum.read',
!                                                                       'msg'   
=> $thread['id'],
!                                                                       'pos'   
=> $thread['pos']
!                                                               )
!                                                       ),
!                                               'LATESTREPLY'   => 
$thread['last_reply'],
!                                               'DEPTH' => $move
                                        );
                                        $this->template->set_var($var);
--- 286,302 ----
  
                                        $var = Array(
!                                               'COLOR'     => 
$GLOBALS['tr_color'],
!                                               'TOPIC'     => 
($thread['subject']?$thread['subject']:'[No subject]'),
!                                               'AUTHOR'    => 
($thread['author']?$GLOBALS['phpgw']->common->grab_owner_name($thread['author']):lang('Unknown')),
!                                               'REPLIES'   => 
$thread['replies'],
!                                               'READ_LINK' => 
$GLOBALS['phpgw']->link('/index.php',
!                                                       Array(
!                                                               'menuaction' => 
'forum.uiforum.read',
!                                                               'msg'        => 
$thread['id'],
!                                                               'pos'        => 
$thread['pos']
!                                                       )
!                                               ),
!                                               'LATESTREPLY' => 
$thread['last_reply'],
!                                               'DEPTH' => $move
                                        );
                                        $this->template->set_var($var);
***************
*** 306,315 ****
  
                                $var = Array(
!                                       'THREADS_LINK'  => 
$GLOBALS['phpgw']->link('/index.php',
!                                                       Array(
!                                                               'menuaction'    
=> 'forum.uiforum.threads',
!                                                               'view'  => 
'collapsed'
!                                                       )
!                                               ),
                                        'LANG_THREADS' => lang('Collapse 
Threads')
                                );
--- 305,314 ----
  
                                $var = Array(
!                                       'THREADS_LINK' => 
$GLOBALS['phpgw']->link('/index.php',
!                                               Array(
!                                                       'menuaction' => 
'forum.uiforum.threads',
!                                                       'view'       => 
'collapsed'
!                                               )
!                                       ),
                                        'LANG_THREADS' => lang('Collapse 
Threads')
                                );
***************
*** 330,334 ****
                        $this->template->set_file(
                                Array(
!                                       'READ'  => 'read.body.tpl'
                                )
                        );
--- 329,333 ----
                        $this->template->set_file(
                                Array(
!                                       'READ' => 'read.body.tpl'
                                )
                        );
***************
*** 362,370 ****
                                'MAIN_LINK'     => 
$GLOBALS['phpgw']->link('/index.php','menuaction=forum.uiforum.index'),
                                'POST_LINK'     => 
$GLOBALS['phpgw']->link('/index.php',
!                                               Array(
!                                                       'menuaction' => 
'forum.uiforum.post',
!                                                       'type'  => 'new'
!                                               )
!                                       ),
                                'THREADS_LINK' => 
$GLOBALS['phpgw']->link('/index.php','menuaction=forum.uiforum.threads'),
                                'SEARCH_LINK'  => 
$GLOBALS['phpgw']->link('/index.php','menuaction=forum.uiforum.search'),
--- 361,369 ----
                                'MAIN_LINK'     => 
$GLOBALS['phpgw']->link('/index.php','menuaction=forum.uiforum.index'),
                                'POST_LINK'     => 
$GLOBALS['phpgw']->link('/index.php',
!                                       Array(
!                                               'menuaction' => 
'forum.uiforum.post',
!                                               'type'       => 'new'
!                                       )
!                               ),
                                'THREADS_LINK' => 
$GLOBALS['phpgw']->link('/index.php','menuaction=forum.uiforum.threads'),
                                'SEARCH_LINK'  => 
$GLOBALS['phpgw']->link('/index.php','menuaction=forum.uiforum.search'),
***************
*** 381,385 ****
                                'LANG_SUBMIT'  => lang('Submit'),
                                'LANG_MESSAGE' => lang('Message'),
!                               'LANG_THREADS'  => lang('Return to forums')
  /*
                                'THREADS_LINK' => 
$GLOBALS['phpgw']->link('/index.php','menuaction=forum.uiforum.threads'),
--- 380,384 ----
                                'LANG_SUBMIT'  => lang('Submit'),
                                'LANG_MESSAGE' => lang('Message'),
!                               'LANG_THREADS' => lang('Return to forums')
  /*
                                'THREADS_LINK' => 
$GLOBALS['phpgw']->link('/index.php','menuaction=forum.uiforum.threads'),
***************
*** 396,402 ****
                                {
                                        $var = Array(
!                                               'THREAD'       => 
$message['thread'],
!                                               'DEPTH'        => 
$message['depth'],
!                                               'RE_SUBJECT'    => (!strpos(' 
'.$message['subject'],'RE: ')?'RE: ':'').$message['subject']
                                        );
                                        $this->template->set_var($var);
--- 395,401 ----
                                {
                                        $var = Array(
!                                               'THREAD'     => 
$message['thread'],
!                                               'DEPTH'      => 
$message['depth'],
!                                               'RE_SUBJECT' => (!strpos(' 
'.$message['subject'],'RE: ')?'RE: ':'').$message['subject']
                                        );
                                        $this->template->set_var($var);
***************
*** 407,420 ****
                                        'POSTDATE'     => 
$GLOBALS['phpgw']->common->show_date($GLOBALS['phpgw']->db->from_timestamp($message['postdate'])),
                                        'SUBJECT_LINK' => 
$GLOBALS['phpgw']->link('/index.php',
!                                                       Array(
!                                                               'menuaction'    
=> 'forum.uiforum.read',
!                                                               'msg'   => 
$message['id'],
!                                                               'pos'   => 
$message['pos']
!                                                       )
!                                               ),
!                                       'SUBJECT'      => $message['subject'],
!                                       'MESSAGE'               => 
$message['message'],
!                                       'NAME'         => $message['name'],
!                                       'EMAIL'        => $message['email']
                                );
  
--- 406,419 ----
                                        'POSTDATE'     => 
$GLOBALS['phpgw']->common->show_date($GLOBALS['phpgw']->db->from_timestamp($message['postdate'])),
                                        'SUBJECT_LINK' => 
$GLOBALS['phpgw']->link('/index.php',
!                                               Array(
!                                                       'menuaction' => 
'forum.uiforum.read',
!                                                       'msg'        => 
$message['id'],
!                                                       'pos'        => 
$message['pos']
!                                               )
!                                       ),
!                                       'SUBJECT' => $message['subject'],
!                                       'MESSAGE' => $message['message'],
!                                       'NAME'    => $message['name'],
!                                       'EMAIL'   => $message['email']
                                );
  
***************
*** 454,458 ****
                        $this->template->set_file(
                                Array(
!                                       'POST'  => 'post.body.tpl'
                                )
                        );
--- 453,457 ----
                        $this->template->set_file(
                                Array(
!                                       'POST' => 'post.body.tpl'
                                )
                        );

Index: functions.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/forum/inc/functions.inc.php,v
retrieving revision 1.14
retrieving revision 1.15
diff -C2 -r1.14 -r1.15
*** functions.inc.php   20 Jan 2002 03:37:07 -0000      1.14
--- functions.inc.php   20 Mar 2002 12:37:42 -0000      1.15
***************
*** 18,22 ****
        $GLOBALS['cat_id'] = 
(@$GLOBALS['HTTP_GET_VARS']['cat_id'address@hidden'HTTP_GET_VARS']['cat_id']:$GLOBALS['session_info']['cat_id']);
        $GLOBALS['forum_id'] = 
(@$GLOBALS['HTTP_GET_VARS']['forum_id'address@hidden'HTTP_GET_VARS']['forum_id']:$GLOBALS['session_info']['forum_id']);
-       
  
        if (!is_array($GLOBALS['session_info']))
--- 18,21 ----
***************
*** 24,30 ****
                $GLOBALS['session_info'] = array(
                        'view'     => 
$GLOBALS['phpgw_info']['user']['preferences']['forum']['default_view'],
!                       'location' => '',               // Not used ... yet
!                       'cat_id'   => ($GLOBALS['cat_id']       
?$GLOBALS['cat_id']     :''),
!                       'forum_id' => ($GLOBALS['forum_id']     
?$GLOBALS['forum_id']   :'')
                );
        }
--- 23,29 ----
                $GLOBALS['session_info'] = array(
                        'view'     => 
$GLOBALS['phpgw_info']['user']['preferences']['forum']['default_view'],
!                       'location' => '', // Not used ... yet
!                       'cat_id'   => ($GLOBALS['cat_id']   ? 
$GLOBALS['cat_id']   : ''),
!                       'forum_id' => ($GLOBALS['forum_id'] ? 
$GLOBALS['forum_id'] : '')
                );
        }
***************
*** 35,106 ****
        
$GLOBALS['phpgw']->session->appsession('session_data','forum',$GLOBALS['session_info']);
  
- 
  // Global functions for phpgw forums
  
! //
! // showthread shows thread in threaded mode :)
! //  params are: $thread = id from master message, father of all messages in 
this thread
! //          $current = maybe NULL or message number where we are at the 
moment,
! //         used only in reply (read.php) section to show our current
! //         message with little different color ($phpgw_info["theme"]["bg05"])
! //
! function showthread ($cat)
! {
!       while($GLOBALS['phpgw']->db->next_record())
        {
!               $GLOBALS['tr_color'] = 
$GLOBALS['phpgw']->nextmatchs->alternate_row_color($GLOBALS['tr_color']);
! 
!               if($GLOBALS['phpgw']->db->f('id') == $current) 
$GLOBALS['tr_color'] = $GLOBALS['phpgw_info']['theme']['bg05'];
!               echo '<tr bgcolor="'.$GLOBALS['tr_color'].'">';
! 
!               $move = '';
!               for($tmp = 1;$tmp <= $GLOBALS['phpgw']->db->f('depth'); $tmp++)
                {
!                       $move .= '&nbsp;&nbsp;';
!               }
  
!               $pos = $GLOBALS['phpgw']->db->f('pos');
!               $cat = $GLOBALS['phpgw']->db->f('cat_id');
!               $for = $GLOBALS['phpgw']->db->f('for_id');
!               $subject = $GLOBALS['phpgw']->db->f('subject');
!               if (! $subject)
!               {
!                       $subject = '[ No subject ]';
!               }
!               echo '<td>' . $move . '<a href="' . 
$GLOBALS['phpgw']->link('/forum/read.php',"cat=$cat&for=$for&pos=$pos&col=1&msg="
 . $GLOBALS['phpgw']->db->f('id')) .">"
                        . $subject . '</a></td>'."\n";
  
!               echo '<td align="left" valign="top">' . 
($GLOBALS['phpgw']->db->f('thread_owner')?$GLOBALS['phpgw']->accounts->id2name($GLOBALS['phpgw']->db->f('thread_owner')):lang('Unknown'))
 .'</td>'."\n";
!               echo '<td align="left" valign="top">' . 
$GLOBALS['phpgw']->common->show_date($GLOBALS['phpgw']->db->from_timestamp($GLOBALS['phpgw']->db->f('postdate')))
 .'</td>'."\n";
  
!               if($debug)
!               {
!                       echo '<td>' . $GLOBALS['phpgw']->db->f('id')." " . 
$GLOBALS['phpgw']->db->f('parent') .' '
                                . $GLOBALS['phpgw']->db->f('depth') .' ' . 
$GLOBALS['phpgw']->db->f('pos') .'</td>';
                }
        }
- }
  
! function show_topics($cat,$for)
! {
!       while($GLOBALS['phpgw']->db->next_record())
        {
!               $GLOBALS['tr_color'] = 
$GLOBALS['phpgw']->nextmatchs->alternate_row_color($GLOBALS['tr_color']);
!               echo '<tr bgcolor="'.$GLOBALS['tr_color'].'">';
!               $subject = $GLOBALS['phpgw']->db->f('subject');
!               if (! $subject)
                {
!                       $subject = '[ No subject ]';
                }
-               echo '<td><a 
href="'.$GLOBALS['phpgw']->link('read.php','cat='.$cat.'&for='.$for.'&msg='.$msg.$phpgw->db->f('id')).'>'.$subject.'</a></td>'."\n";
-               $lastreply = $GLOBALS['phpgw']->db->f('postdate');
-               echo '<td align="left" valign="top">' . 
($GLOBALS['phpgw']->db->f('thread_owner')?$GLOBALS['phpgw']->accounts->id2name($GLOBALS['phpgw']->db->f('thread_owner')):lang('Unknown'))
 . '</td>'."\n";
-               $msgid = $GLOBALS['phpgw']->db->f('id');
-               $mainid = $GLOBALS['phpgw']->db->f('main');
- 
-               echo '<td align="left" valign="top">' . 
$GLOBALS['phpgw']->db->f('n_replies') . '</td>'."\n";
-               echo '<td align="left" valign="top">'.$lastreply.'</td>'."\n";
-               echo '</tr>'."\n";
        }
- }
- 
--- 34,103 ----
        
$GLOBALS['phpgw']->session->appsession('session_data','forum',$GLOBALS['session_info']);
  
  // Global functions for phpgw forums
  
!       //
!       // showthread shows thread in threaded mode :)
!       //  params are: $thread = id from master message, father of all 
messages in this thread
!       //          $current = maybe NULL or message number where we are at the 
moment,
!       //         used only in reply (read.php) section to show our current
!       //         message with little different color 
($phpgw_info["theme"]["bg05"])
!       //
!       function showthread ($cat)
        {
!               while($GLOBALS['phpgw']->db->next_record())
                {
!                       $GLOBALS['tr_color'] = 
$GLOBALS['phpgw']->nextmatchs->alternate_row_color($GLOBALS['tr_color']);
  
!                       if($GLOBALS['phpgw']->db->f('id') == $current) 
$GLOBALS['tr_color'] = $GLOBALS['phpgw_info']['theme']['bg05'];
!                       echo '<tr bgcolor="'.$GLOBALS['tr_color'].'">';
! 
!                       $move = '';
!                       for($tmp = 1;$tmp <= $GLOBALS['phpgw']->db->f('depth'); 
$tmp++)
!                       {
!                               $move .= '&nbsp;&nbsp;';
!                       }
! 
!                       $pos = $GLOBALS['phpgw']->db->f('pos');
!                       $cat = $GLOBALS['phpgw']->db->f('cat_id');
!                       $for = $GLOBALS['phpgw']->db->f('for_id');
!                       $subject = $GLOBALS['phpgw']->db->f('subject');
!                       if (! $subject)
!                       {
!                               $subject = '[ No subject ]';
!                       }
!                       echo '<td>' . $move . '<a href="' . 
$GLOBALS['phpgw']->link('/forum/read.php',"cat=$cat&for=$for&pos=$pos&col=1&msg="
 . $GLOBALS['phpgw']->db->f('id')) .">"
                        . $subject . '</a></td>'."\n";
  
!                       echo '<td align="left" valign="top">' . 
($GLOBALS['phpgw']->db->f('thread_owner')?$GLOBALS['phpgw']->accounts->id2name($GLOBALS['phpgw']->db->f('thread_owner')):lang('Unknown'))
 .'</td>'."\n";
!                       echo '<td align="left" valign="top">' . 
$GLOBALS['phpgw']->common->show_date($GLOBALS['phpgw']->db->from_timestamp($GLOBALS['phpgw']->db->f('postdate')))
 .'</td>'."\n";
  
!                       if($debug)
!                       {
!                               echo '<td>' . $GLOBALS['phpgw']->db->f('id')." 
" . $GLOBALS['phpgw']->db->f('parent') .' '
                                . $GLOBALS['phpgw']->db->f('depth') .' ' . 
$GLOBALS['phpgw']->db->f('pos') .'</td>';
+                       }
                }
        }
  
!       function show_topics($cat,$for)
        {
!               while($GLOBALS['phpgw']->db->next_record())
                {
!                       $GLOBALS['tr_color'] = 
$GLOBALS['phpgw']->nextmatchs->alternate_row_color($GLOBALS['tr_color']);
!                       echo '<tr bgcolor="'.$GLOBALS['tr_color'].'">';
!                       $subject = $GLOBALS['phpgw']->db->f('subject');
!                       if (! $subject)
!                       {
!                               $subject = '[ No subject ]';
!                       }
!                       echo '<td><a 
href="'.$GLOBALS['phpgw']->link('read.php','cat='.$cat.'&for='.$for.'&msg='.$msg.$phpgw->db->f('id')).'>'.$subject.'</a></td>'."\n";
!                       $lastreply = $GLOBALS['phpgw']->db->f('postdate');
!                       echo '<td align="left" valign="top">' . 
($GLOBALS['phpgw']->db->f('thread_owner')?$GLOBALS['phpgw']->accounts->id2name($GLOBALS['phpgw']->db->f('thread_owner')):lang('Unknown'))
 . '</td>'."\n";
!                       $msgid = $GLOBALS['phpgw']->db->f('id');
!                       $mainid = $GLOBALS['phpgw']->db->f('main');
! 
!                       echo '<td align="left" valign="top">' . 
$GLOBALS['phpgw']->db->f('n_replies') . '</td>'."\n";
!                       echo '<td align="left" 
valign="top">'.$lastreply.'</td>'."\n";
!                       echo '</tr>'."\n";
                }
        }




reply via email to

[Prev in Thread] Current Thread [Next in Thread]