phpgroupware-cvs
[Top][All Lists]
Advanced

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

[Phpgroupware-cvs] CVS: news_admin/inc class.bonews.inc.php,NONE,1.1.2.1


From: Patrick Walsh <address@hidden>
Subject: [Phpgroupware-cvs] CVS: news_admin/inc class.bonews.inc.php,NONE,1.1.2.1 class.sonews.inc.php,NONE,1.1.2.1 class.uinews.inc.php,1.10.2.1,1.10.2.2
Date: Fri, 30 Aug 2002 04:00:22 -0400

Update of /cvsroot/phpgroupware/news_admin/inc
In directory subversions:/tmp/cvs-serv7846

Modified Files:
      Tag: Version-0_9_14-branch
        class.uinews.inc.php 
Added Files:
      Tag: Version-0_9_14-branch
        class.bonews.inc.php class.sonews.inc.php 
Log Message:
Separated out the database calls from the ui.  Hopefully didn't introduce bugs. 
 Let me know.


***** Error reading new file: [Errno 2] No such file or directory: 
'class.bonews.inc.php'
***** Error reading new file: [Errno 2] No such file or directory: 
'class.sonews.inc.php'
Index: class.uinews.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/news_admin/inc/class.uinews.inc.php,v
retrieving revision 1.10.2.1
retrieving revision 1.10.2.2
diff -C2 -r1.10.2.1 -r1.10.2.2
*** class.uinews.inc.php        27 Jan 2002 00:37:57 -0000      1.10.2.1
--- class.uinews.inc.php        30 Aug 2002 08:00:19 -0000      1.10.2.2
***************
*** 18,22 ****
        {
                var $template;
!               var $db;
                var $public_functions = array(
                        'show_news'      => True,
--- 18,22 ----
        {
                var $template;
!               var $bonews;
                var $public_functions = array(
                        'show_news'      => True,
***************
*** 27,32 ****
                {
                        $this->template = $GLOBALS['phpgw']->template;
-                       $this->db       = $GLOBALS['phpgw']->db;
                        
$this->template->set_root($GLOBALS['phpgw']->common->get_tpl_dir('news_admin'));
                }
  
--- 27,32 ----
                {
                        $this->template = $GLOBALS['phpgw']->template;
                        
$this->template->set_root($GLOBALS['phpgw']->common->get_tpl_dir('news_admin'));
+                       $this->bonews = CreateObject('news_admin.bonews');
                }
  
***************
*** 37,44 ****
                        $news_id = $GLOBALS['HTTP_GET_VARS']['news_id'];
  
-                       if($news_id)
-                       {
-                               $specific = " AND news_id='" . $news_id . "'";
-                       }
  
                        if (! function_exists('parse_navbar'))
--- 37,40 ----
***************
*** 47,50 ****
--- 43,50 ----
                                echo parse_navbar();
                        }
+                       else
+                       {
+                               echo parse_navbar();
+                       }
  
                        if (! $cat_id)
***************
*** 60,74 ****
                        $this->template->set_block('_news','category');
  
!                       $this->db->query("SELECT COUNT(*) FROM phpgw_news WHERE 
news_status='Active' AND news_cat='$cat_id'",__LINE__,__FILE__);
!                       $this->db->next_record();
!                       $total = $this->db->f(0);
  
!                       if (! $oldnews)
                        {
!                               $this->db->limit_query("SELECT * FROM 
phpgw_news WHERE news_status='Active' AND news_cat='$cat_id' $specific ORDER BY 
news_date DESC",0,__LINE__,__FILE__,5);
                        }
                        else
                        {
!                               $this->db->limit_query("SELECT * FROM 
phpgw_news WHERE news_status='Active' AND news_cat='$cat_id' ORDER BY news_date 
DESC ",$start,__LINE__,__FILE__,$total);
                        }
  
--- 60,72 ----
                        $this->template->set_block('_news','category');
  
!                       $total = $this->bonews->get_NumNewsInCat($cat_id);
  
!                       if($news_id)
                        {
!                               $news = $this->bonews->get_news($news_id);
                        }
                        else
                        {
!                               $news = $this->bonews->get_NewsList($cat_id, 
$oldnews, $start, $total);
                        }
  
***************
*** 95,104 ****
                        }
  
!                       while ($this->db->next_record())
                        {
                                $var = Array(
!                                       'subject'       => 
$this->db->f('news_subject'),
!                                       'submitedby'    => 'Submitted by ' . 
$GLOBALS['phpgw']->accounts->id2name($this->db->f('news_submittedby')) . ' on ' 
. $GLOBALS['phpgw']->common->show_date($this->db->f('news_date')),
!                                       'content'       => 
nl2br(stripslashes($this->db->f('news_content')))
                                );
  
--- 93,102 ----
                        }
  
!                       foreach($news as $newsitem)
                        {
                                $var = Array(
!                                       'subject'       => $newsitem['subject'],
!                                       'submitedby'    => 'Submitted by ' . 
$GLOBALS['phpgw']->accounts->id2name($newsitem['submittedby']) . ' on ' . 
$GLOBALS['phpgw']->common->show_date($newsitem['submissiondate']),
!                                       'content'       => 
nl2br($newsitem['content'])
                                );
  
***************
*** 106,109 ****
--- 104,108 ----
                                $this->template->parse('rows','row',True);
                        }
+                       
  
                        $this->template->pfp('_out','news_form');
***************
*** 150,166 ****
                        }
  
!                       $this->db->query("SELECT COUNT(*) FROM phpgw_news WHERE 
news_status='Active' AND news_cat='0'",__LINE__,__FILE__);
!                       $this->db->next_record();
!                       $total = $this->db->f(0);
  
!                       $this->db->limit_query("SELECT * FROM phpgw_news WHERE 
news_status='Active' AND news_cat='$cat_id' ORDER BY news_date 
DESC",0,__LINE__,__FILE__,5);
  
                        $image_path = 
$GLOBALS['phpgw']->common->get_image_path('news_admin');
  
!                       while ($this->db->next_record())
                        {
                                $portalbox->data[] = array(
!                                       'text' => $this->db->f('news_subject') 
. ' - ' . lang('Submitted by') . ' ' . 
$GLOBALS['phpgw']->accounts->id2name($this->db->f('news_submittedby')) . ' ' . 
lang('on') . ' ' . 
$GLOBALS['phpgw']->common->show_date($this->db->f('news_date')),
!                                       'link' => 
$GLOBALS['phpgw']->link('/index.php','menuaction=news_admin.uinews.show_news&news_id='
 . $this->db->f('news_id'))
                                );
                        }
--- 149,163 ----
                        }
  
!                       $total = $this->bonews->get_NumNewsInCat(0);
  
!                       $newslist = $this->bonews->get_newslist($cat_id);
  
                        $image_path = 
$GLOBALS['phpgw']->common->get_image_path('news_admin');
  
!                       foreach($newslist as $newsitem)
                        {
                                $portalbox->data[] = array(
!                                       'text' => $newsitem['subject'] . ' - ' 
. lang('Submitted by') . ' ' . 
$GLOBALS['phpgw']->accounts->id2name($newsitem['submittedby']) . ' ' . 
lang('on') . ' ' . 
$GLOBALS['phpgw']->common->show_date($newsitem['submission_date']),
!                                       'link' => 
$GLOBALS['phpgw']->link('/index.php','menuaction=news_admin.uinews.show_news&news_id='
 . $newsitem['id'])
                                );
                        }





reply via email to

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