4 * SourceForge News Facility
6 * SourceForge: Breaking Down the Barriers to Open Source Development
7 * Copyright 1999-2001 (c) VA Linux Systems
8 * http://sourceforge.net
15 require_once('pre.php');
16 require_once('www/news/news_utils.php');
17 require_once('common/forum/Forum.class');
20 if (session_loggedin()) {
22 if (!user_ismember($group_id,'A')) {
23 exit_permission_denied($Language->getText('news_submit','cannot'));
27 //check to make sure both fields are there
28 if ($summary && $details) {
30 Insert the row into the db if it's a generic message
31 OR this person is an admin for the group involved
35 create a new discussion forum without a default msg
36 if one isn't already there
40 $f=new Forum(group_get_object($sys_news_group));
41 if (!$f->create($summary,$summary,1,'',0,0)) {
43 exit_error('Error',$f->getErrorMessage());
46 $sql="INSERT INTO news_bytes (group_id,submitted_by,is_approved,date,forum_id,summary,details) ".
47 " VALUES ('$group_id','".user_getid()."','0','".time()."','$new_id','".htmlspecialchars($summary)."','".htmlspecialchars($details)."')";
48 $result=db_query($sql);
51 $feedback .= ' '.$Language->getText('news_submit', 'errorinsert').' ';
54 $feedback .= ' '.$Language->getText('news_submit', 'newsadded').' ';
57 $feedback .= ' '.$Language->getText('news_submit', 'errorboth').' ';
61 //news must now be submitted from a project page -
69 news_header(array('title'=>'News','pagename'=>'news_submit','titlevals'=>array(group_getname($group_id))));
73 '. $Language->getText('news_submit', 'post_blurb', $GLOBALS['sys_name']) .'
75 <FORM ACTION="'.$PHP_SELF.'" METHOD="POST">
76 <INPUT TYPE="HIDDEN" NAME="group_id" VALUE="'.$group_id.'">
77 <B>'.$Language->getText('news_submit', 'forproject').': '. group_getname($group_id) .'</B>
78 <INPUT TYPE="HIDDEN" NAME="post_changes" VALUE="y">
80 <B>'.$Language->getText('news_submit', 'subject').':</B><BR>
81 <INPUT TYPE="TEXT" NAME="summary" VALUE="" SIZE="30" MAXLENGTH="60">
83 <B>'.$Language->getText('news_submit', 'details').':</B><BR>
84 <TEXTAREA NAME="details" ROWS="5" COLS="50" WRAP="SOFT"></TEXTAREA><BR>
85 <INPUT TYPE="SUBMIT" NAME="SUBMIT" VALUE="'.$Language->getText('news_submit', 'submit').'">