[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Phpgroupware-cvs] CVS: news_admin/inc hook_website.inc.php,NONE,1.1 cla
From: |
Miles Lott <address@hidden> |
Subject: |
[Phpgroupware-cvs] CVS: news_admin/inc hook_website.inc.php,NONE,1.1 class.uinews.inc.php,1.11,1.12 |
Date: |
Sun, 10 Feb 2002 14:34:50 -0500 |
Update of /cvsroot/phpgroupware/news_admin/inc
In directory subversions:/tmp/cvs-serv13816
Modified Files:
class.uinews.inc.php
Added Files:
hook_website.inc.php
Log Message:
Add hook and function called by it
***** Error reading new file: [Errno 2] No such file or directory:
'hook_website.inc.php'
Index: class.uinews.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/news_admin/inc/class.uinews.inc.php,v
retrieving revision 1.11
retrieving revision 1.12
diff -C2 -r1.11 -r1.12
*** class.uinews.inc.php 27 Jan 2002 00:37:25 -0000 1.11
--- class.uinews.inc.php 10 Feb 2002 19:34:48 -0000 1.12
***************
*** 171,173 ****
--- 171,241 ----
. '<!-- end News Admin -->' . "\r\n";
}
+
+ function show_news_website()
+ {
+ global $cat_id, $start, $oldnews;
+
+ $news_id = $GLOBALS['HTTP_GET_VARS']['news_id'];
+
+ if($news_id)
+ {
+ $specific = " AND news_id='" . $news_id . "'";
+ }
+
+ if (! $cat_id)
+ {
+ $cat_id = 0;
+ }
+
+ $this->template->set_file(array(
+ '_news' => 'news.tpl'
+ ));
+ $this->template->set_block('_news','news_form');
+ $this->template->set_block('_news','row');
+ $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')))
+ );
+
+ $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 hook_website.inc.php,NONE,1.1 class.uinews.inc.php,1.11,1.12,
Miles Lott <address@hidden> <=