* The rest Copyright 2002-2004 (c) GForge Team
* http://gforge.org/
*
- * @version $Id$
- *
* This file is part of GForge.
*
* GForge is free software; you can redistribute it and/or modify
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
-require_once('pre.php');
-require_once('www/news/news_utils.php');
-require_once('common/forum/Forum.class');
+require_once('../env.inc.php');
+require_once $gfwww.'include/pre.php';
+require_once $gfwww.'news/news_utils.php';
+require_once $gfcommon.'forum/Forum.class.php';
$group_id = getIntFromRequest('group_id');
$limit = getIntFromRequest('limit');
$offset = getIntFromRequest('offset');
+$feedback = htmlspecialchars(getStringFromRequest('feedback'));
-news_header(array('title'=>$Language->getText('news', 'title')));
+news_header(array('title'=>_('News')));
+echo '<h1>' . _('News') . '</h1>';
-echo $Language->getText('news', 'choose');
+echo _('<p>Choose a News item and you can browse, search, and post messages.</p>');
/*
Put the result set (list of forums for this group) into a column with folders
*/
+if ( !$group_id || $group_id < 0 || !is_numeric($group_id) ) {
+ $group_id = 0;
+}
+if ( !$offset || $offset < 0 || !is_numeric($offset) ) {
+ $offset = 0;
+}
+if ( !$limit || $limit < 0 || $limit > 50 || !is_numeric($limit) ) {
+ $limit = 50;
+}
+
if ($group_id && ($group_id != $sys_news_group)) {
- $sql="SELECT * FROM news_bytes WHERE group_id='$group_id' AND is_approved <> '4' ORDER BY post_date DESC";
+ $result = db_query_params ('SELECT * FROM news_bytes WHERE group_id=$1 AND is_approved <> 4 ORDER BY post_date DESC',
+ array ($group_id),
+ $limit+1,
+ $offset);
} else {
- $sql="SELECT * FROM news_bytes WHERE is_approved='1' ORDER BY post_date DESC";
+ $result = db_query_params ('SELECT * FROM news_bytes WHERE is_approved=1 ORDER BY post_date DESC',
+ array ());
}
-if (!$limit || $limit>50) $limit=50;
-$result=db_query($sql,$limit+1,$offset);
$rows=db_numrows($result);
$more=0;
if ($rows>$limit) {
if ($rows < 1) {
if ($group_id) {
- echo '<h2>'.$Language->getText('news', 'nonewsfor', group_getname($group_id)).'</h2>';
+ echo '<h2>'.sprintf(_('No News Found For %s'),group_getname($group_id)).'</h2>';
} else {
- echo '<h2>'.$Language->getText('news', 'nonews').'</h2>';
+ echo '<h2>'._('No News Found').'</h2>';
}
echo '
- <p>' . $Language->getText('news', 'noitems') . '</p>';
+ <p>' . _('No items were found') . '</p>';
echo db_error();
} else {
- echo '<table width="100%" border="0">
- <tr><td valign="top">';
-
- for ($j = 0; $j < $rows; $j++) {
- echo '
- <a href="/forum/forum.php?forum_id='.db_result($result, $j, 'forum_id').'">'.
- html_image("ic/cfolder15.png","15","13",array("border"=>"0")) . ' '.
- stripslashes(db_result($result, $j, 'summary')).'</a> ';
- echo '
- <br />';
- }
-
- if (getStringFromRequest('more')) {
- echo '<br /><a href="'
- .'?group_id='.$group_id.'&limit='.$limit
- .'&offset='. (string)($offset+$limit) .'">['.$Language->getText('news', 'olderheadlines').']</a>';
- }
-
- echo '
- </td></tr></table>';
+ echo news_show_latest($group_id,10,true,false,false,-1, true);
}
news_footer(array());
+// Local Variables:
+// mode: php
+// c-file-style: "bsd"
+// End:
+
?>