[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.10.2.3,1.1
From: |
Patrick Walsh <address@hidden> |
Subject: |
[Phpgroupware-cvs] CVS: news_admin/inc class.uinews.inc.php,1.10.2.3,1.10.2.4 |
Date: |
Sat, 31 Aug 2002 23:36:24 -0400 |
Update of /cvsroot/phpgroupware/news_admin/inc
In directory subversions:/tmp/cvs-serv16345
Modified Files:
Tag: Version-0_9_14-branch
class.uinews.inc.php
Log Message:
more tag headaches
Index: class.uinews.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/news_admin/inc/class.uinews.inc.php,v
retrieving revision 1.10.2.3
retrieving revision 1.10.2.4
diff -C2 -r1.10.2.3 -r1.10.2.4
*** class.uinews.inc.php 31 Aug 2002 21:55:44 -0000 1.10.2.3
--- class.uinews.inc.php 1 Sep 2002 03:36:21 -0000 1.10.2.4
***************
*** 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');
}
--- 27,32 ----
{
$this->template = $GLOBALS['phpgw']->template;
+ $this->bonews = CreateObject('news_admin.bonews');
$this->template->set_root($GLOBALS['phpgw']->common->get_tpl_dir('news_admin'));
}
***************
*** 35,49 ****
global $cat_id, $start, $category_list, $oldnews;
- $news_id = $GLOBALS['HTTP_GET_VARS']['news_id'];
-
-
if (! function_exists('parse_navbar'))
{
$GLOBALS['phpgw']->common->phpgw_header();
! //echo parse_navbar();
! }
! else
! {
! //echo parse_navbar();
}
--- 35,42 ----
global $cat_id, $start, $category_list, $oldnews;
if (! function_exists('parse_navbar'))
{
$GLOBALS['phpgw']->common->phpgw_header();
! echo parse_navbar();
}
***************
*** 60,64 ****
$this->template->set_block('_news','category');
! $total = $this->bonews->get_NumNewsInCat($cat_id);
if($news_id)
--- 53,64 ----
$this->template->set_block('_news','category');
! if (function_exists('get_var'))
! {
! $news_id = get_var('news_id',Array('GET'));
! }
! else
! {
! $news_id = $GLOBALS['HTTP_GET_VARS']['news_id'];
! }
if($news_id)
***************
*** 71,74 ****
--- 71,76 ----
}
+ $total = $this->bonews->get_NumNewsInCat($cat_id);
+
$var = Array();
***************
*** 104,108 ****
$this->template->parse('rows','row',True);
}
-
$this->template->pfp('_out','news_form');
--- 106,109 ----
***************
*** 158,170 ****
{
$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'])
);
}
! echo "\r\n"
. '<!-- start News Admin -->' . "\r\n"
. $portalbox->draw()
. '<!-- end News Admin -->' . "\r\n";
}
}
--- 159,241 ----
{
$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'])
);
}
! $tmp = "\r\n"
. '<!-- start News Admin -->' . "\r\n"
. $portalbox->draw()
. '<!-- end News Admin -->' . "\r\n";
+
$GLOBALS['phpgw']->template->set_var('phpgw_body',$tmp,True);
+ }
+
+ function show_news_website($section='mid')
+ {
+ global $cat_id, $start, $oldnews;
+
+ if (! $cat_id)
+ {
+ $cat_id = 0;
+ }
+
+ $this->template->set_file(array(
+ '_news' => 'news_' . $section . '.tpl'
+ ));
+ $this->template->set_block('_news','news_form');
+ $this->template->set_block('_news','row');
+ $this->template->set_block('_news','category');
+
+ if (function_exists('get_var'))
+ {
+ $news_id = get_var('news_id',Array('GET'));
+ }
+ else
+ {
+ $news_id = $GLOBALS['HTTP_GET_VARS']['news_id'];
+ }
+
+ 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'])
+ );
+
+ $this->template->set_var($var);
+ $this->template->parse('rows','row',True);
+ }
+
+ $out = $this->template->fp('out','news_form');
+
+ if ($total > 5 && ! $oldnews)
+ {
+ $link_values = array(
+ 'menuaction' =>
'news_admin.uinews.show_news',
+ 'oldnews' => 'True',
+ 'cat_id' => $cat_id,
+ 'category_list' => 'True'
+ );
+
+ $out .= '<center><a href="' .
$GLOBALS['phpgw']->link('/index.php',$link_values) . '">View news
archives</a></center>';
+ }
+ return $out;
}
}
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Phpgroupware-cvs] CVS: news_admin/inc class.uinews.inc.php,1.10.2.3,1.10.2.4,
Patrick Walsh <address@hidden> <=