4 // SourceForge: Breaking Down the Barriers to Open Source Development
5 // Copyright 1999-2000 (c) The SourceForge Crew
6 // http://sourceforge.net
12 by Quentin Cregan, SourceForge 06/2000
16 require('doc_utils.php');
23 if (!$doc_group || $doc_group ==100) {
24 //cannot add a doc unless an appropriate group is provided
25 exit_error('Error','No Valid Document Group Was Selected');
28 if (!$title || !$description) {
32 if (!$upload_instead && !$data) {
36 if (!user_isloggedin()) {
39 $user_id=user_getid();
42 if ($upload_instead) {
43 $data = addslashes(fread( fopen($uploaded_data, 'r'), filesize($uploaded_data)));
44 if ((strlen($data) > 20) && (strlen($data) < 512000)) {
46 $feedback .= ' Document Uploaded ';
49 $feedback .= ' ERROR - patch must be > 20 chars and < 512000 chars in length ';
50 exit_error('Missing Info',$feedback.' - Please click back and fix the error.');
55 docman_header('Documentation - Add Information - Processing','Documentation - New submission');
57 $query = "insert into doc_data(stateid,title,data,createdate,updatedate,created_by,doc_group,description,language_id) "
59 // state = 3 == pending
60 ."'".htmlspecialchars($title)."',"
61 ."'".htmlspecialchars($data)."',"
66 ."'".htmlspecialchars($description)."',"
67 ."'".$language_id."')";
70 //PROBLEM check the query
72 print "<p><b>Thank You! Your submission has been placed in the database for review before posting.</b> \n\n<p>\n <a href=\"/docman/index.php?group_id=".$group_id."\">Back</a>";
74 docman_footer($params);
76 docman_header('Add documentation','Add documentation');
78 print "<p>You are not logged in, and will not be given credit for this.<p>";
84 <b> Document Title: </b> Refers to the relatively brief title of the document (e.g. How to use the download server)
86 <b> Description: </b> A brief description to be placed just under the title.<br>
88 <form name="adddata" action="new.php?mode=add&group_id='.$group_id.'" method="POST" enctype="multipart/form-data">
90 <table border="0" width="75%">
93 <th>Document Title:</th>
94 <td><input type="text" name="title" size="40" maxlength="255"></td>
99 <td><input type="text" name="description" size="50" maxlength="255"></td>
103 <th> <input type="checkbox" name="upload_instead" value="1"> <B>Upload Text File:</B></th>
104 <td> <input type="file" name="uploaded_data" size="30"></td>
111 echo html_get_language_popup($Language,'language_id',1);
117 <th>OR Paste Document (in html format):</th>
118 <td><textarea cols="60" rows="10" name="data"></textarea></td>
122 <th>Group that document belongs in:</th>
125 display_groups_option($group_id);
127 echo ' </td> </tr> </table>
129 <input type="submit" value="Submit Information">
133 docman_footer($params);