[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Phpgroupware-cvs] CVS: news_admin/inc class.uinews.inc.php,1.15,1.16
From: |
Patrick Walsh <address@hidden> |
Subject: |
[Phpgroupware-cvs] CVS: news_admin/inc class.uinews.inc.php,1.15,1.16 |
Date: |
Sat, 31 Aug 2002 19:40:02 -0400 |
Update of /cvsroot/phpgroupware/news_admin/inc
In directory subversions:/tmp/cvs-serv1165
Modified Files:
class.uinews.inc.php
Log Message:
non-branch update.
Index: class.uinews.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/news_admin/inc/class.uinews.inc.php,v
retrieving revision 1.15
retrieving revision 1.16
diff -C2 -r1.15 -r1.16
*** class.uinews.inc.php 19 Aug 2002 12:42:06 -0000 1.15
--- class.uinews.inc.php 31 Aug 2002 23:40:00 -0000 1.16
***************
*** 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,31 ****
{
$this->template = $GLOBALS['phpgw']->template;
! $this->db = $GLOBALS['phpgw']->db;
$this->template->set_root($GLOBALS['phpgw']->common->get_tpl_dir('news_admin'));
}
--- 27,31 ----
{
$this->template = $GLOBALS['phpgw']->template;
! $this->bonews = CreateObject('news_admin.bonews');
$this->template->set_root($GLOBALS['phpgw']->common->get_tpl_dir('news_admin'));
}
***************
*** 35,45 ****
global $cat_id, $start, $category_list, $oldnews;
- $news_id = get_var('news_id',Array('GET'));
-
- if($news_id)
- {
- $specific = " AND news_id='" . $news_id . "'";
- }
-
if (! function_exists('parse_navbar'))
{
--- 35,38 ----
***************
*** 60,76 ****
$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);
}
$var = Array();
--- 53,69 ----
$this->template->set_block('_news','category');
! $news_id = get_var('news_id',Array('GET'));
! if($news_id)
{
! $news = $this->bonews->get_news($news_id);
}
else
{
! $news = $this->bonews->get_NewsList($cat_id,
$oldnews, $start, $total);
}
+ $total = $bonews->get_NumNewsInCat($cat_id);
+
$var = Array();
***************
*** 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')))
);
--- 88,97 ----
}
! 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['news_content'])
);
***************
*** 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'))
);
}
--- 143,157 ----
}
! $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['submissiondate']),
! 'link' =>
$GLOBALS['phpgw']->link('/index.php','menuaction=news_admin.uinews.show_news&news_id='
. $newsitem['id'])
);
}
***************
*** 177,187 ****
global $cat_id, $start, $oldnews;
- $news_id = get_var('news_id',Array('GET'));
-
- if($news_id)
- {
- $specific = " AND news_id='" . $news_id . "'";
- }
-
if (! $cat_id)
{
--- 168,171 ----
***************
*** 196,222 ****
$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);
}
$var = Array();
$this->template->set_var('icon',$GLOBALS['phpgw']->common->image('news_admin','news-corner.gif'));
! 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')))
);
--- 180,207 ----
$this->template->set_block('_news','category');
! $news_id = get_var('news_id',Array('GET'));
! if($news_id)
{
! $news = $this->bonews->get_news($news_id);
}
else
{
! $news =
$this->bonews->get_NewsList($cat_id,$oldnews,$start,$total);
}
+
+ $total = $this->bonews->get_NumNewsInCat($cat_id);
+
$var = Array();
$this->template->set_var('icon',$GLOBALS['phpgw']->common->image('news_admin','news-corner.gif'));
! 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'])
);
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Phpgroupware-cvs] CVS: news_admin/inc class.uinews.inc.php,1.15,1.16,
Patrick Walsh <address@hidden> <=