* 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
$group_id = getIntFromRequest('group_id');
$limit = getIntFromRequest('limit');
$offset = getIntFromRequest('offset');
+$feedback = htmlspecialchars(getStringFromRequest('feedback'));
news_header(array('title'=>_('News')));
+echo '<h1>' . _('News') . '</h1>';
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) {
<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="'.util_make_url ('/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) .'">['._('Older headlines').']</a>';
- }
-
- echo '
- </td></tr></table>';
+ echo news_show_latest($group_id,10,true,false,false,-1, true);
}
news_footer(array());