cvs: php-hosts-web /msgboard post.php preview.php shared-msgboard.inc /msgboard/etc edit.php
| From: | jim winstead | Date: | Mon, 22 Apr 2002 00:14:00 +0000 |
| Subject: | cvs: php-hosts-web /msgboard post.php preview.php shared-msgboard.inc /msgboard/etc edit.php | ||
| Groups: | php.mirrors | ||
| Request: | Send a blank email to php-mirrors+get-9738@lists.php.net to get a copy of this message | ||
jimw Sun Apr 21 20:14:00 2002 EDT
Modified files:
/php-hosts-web/msgboard post.php preview.php shared-msgboard.inc
/php-hosts-web/msgboard/etc edit.php
Log:
get rid of unused file attachment handling
Index: php-hosts-web/msgboard/post.php
diff -u php-hosts-web/msgboard/post.php:1.1 php-hosts-web/msgboard/post.php:1.2
--- php-hosts-web/msgboard/post.php:1.1 Sun Apr 21 16:58:04 2002
+++ php-hosts-web/msgboard/post.php Sun Apr 21 20:13:59 2002
@@ -5,18 +5,7 @@
commonHeader("Post a New Message: $groupname");
if($mode=="preview"):
- if ($USE_DOC_UPLOAD && $filename!="none"):
- $q=mysql($DBASE,"insert into $TABLE_DOCS values
(0,'$filename_name',$filename_size,'$filename_type')");
- $fileid=mysql_insert_id();
- $newfile=sprintf("%-07.7d",$fileid);
- $newfile="$DOCS/d"+$newfile;
- $command=QuoteMeta("cp $filename $newfile");
- exec($command);
- chmod($newfile,"0664");
- unlink($filename);
- else:
- $fileid=0;
- endif;
+ $fileid=0;
include("preview.php");
commonFooter();
exit;
@@ -125,24 +114,9 @@
We reserve the right to edit or delete messages that we deem offensive or
inappropriate.<BR></TD>
</TR>
-<? if ($USE_DOC_UPLOAD):?>
-<TR VALIGN=top BGCOLOR="<? echo $MSG_FRAME_COLOR2;?>">
-<TD COLSPAN=2><FONT FACE="<? echo $FONTFACE;?>" SIZE=-1>
-If you wish to attach a document to this message, enter the filename here.</TD>
-</TR>
-<TR VALIGN=top>
-<TD ALIGN=right>
-<FONT FACE="<? echo $FONTFACE;?>" SIZE=-1>Attachment:</TD>
-<TD><INPUT NAME="filename" TYPE="file"></TD>
-</TR>
-<? endif;?>
-
<TR VALIGN=top BGCOLOR="<? echo $MSG_FRAME_COLOR2;?>">
<TD ALIGN=left><INPUT TYPE="Reset" VALUE=" Clear All "></TD>
<TD ALIGN=right><INPUT TYPE="submit" VALUE=" Preview » ">
-<? if ($USE_DOC_UPLOAD):
- echo "<FONT FACE=\"$FONTFACE\" SIZE=-2><BR>This may take a while if you
have attached a file.\n";
-endif;?>
</TD>
</TR>
</TABLE>
Index: php-hosts-web/msgboard/preview.php
diff -u php-hosts-web/msgboard/preview.php:1.1 php-hosts-web/msgboard/preview.php:1.2
--- php-hosts-web/msgboard/preview.php:1.1 Sun Apr 21 16:58:04 2002
+++ php-hosts-web/msgboard/preview.php Sun Apr 21 20:13:59 2002
@@ -5,19 +5,11 @@
if($name==""):
echo "<B>You need to give your name!</B><BR>\n";
echo "<FORM><input type=submit value=\" « Go Back \"
onClick=\"history.go(-1);\"></FORM>\n";
- if ($USE_DOC_UPLOAD && isset($fileid)):
- $q=@mysql($DBASE,"delete from $TABLE_DOCS where document=$fileid");
- unlink($newfile);
- endif;
exit;
endif;
if($txt==""):
echo "<B>You need to say <I>something</I>!</B><BR>\n";
echo "<FORM><input type=submit value=\" « Go Back \"
onClick=\"history.go(-1);\"></FORM>\n";
- if ($USE_DOC_UPLOAD && isset($fileid)):
- $q=@mysql($DBASE,"delete from $TABLE_DOCS where document=$fileid");
- unlink($newfile);
- endif;
exit;
endif;
Index: php-hosts-web/msgboard/shared-msgboard.inc
diff -u php-hosts-web/msgboard/shared-msgboard.inc:1.3
php-hosts-web/msgboard/shared-msgboard.inc:1.4
--- php-hosts-web/msgboard/shared-msgboard.inc:1.3 Sun Apr 21 20:07:16 2002
+++ php-hosts-web/msgboard/shared-msgboard.inc Sun Apr 21 20:13:59 2002
@@ -63,19 +63,6 @@
$TXT=1;
$HTML=2;
-/* Pick one of the following: */
-/* 1. Document Upload disabled (DEFAULT): */
-
-$USE_DOC_UPLOAD = false;
-
-/* 2. Document Upload enabled: */
-/*
-$USE_DOC_UPLOAD = true;
-$TABLE_DOCS="msgboard_docs";
-$DOCS="$ROOT_DIR/docs";
-$MAX_DOC_SIZE=1000000;
-*/
-
/* If $USE_SUBGROUP = true, you will have subgroups, or categories, defined for each message.
Write your own code to convert between the subgroup number and the subgroup name!
*/
@@ -257,7 +244,7 @@
/*
* Displays a message (!)
*/
- global $FONTFACE, $LIL_DOC_IMG, $DBASE, $USE_DOC_UPLOAD;
+ global $FONTFACE, $LIL_DOC_IMG, $DBASE;
global $TABLE_WIDTH, $TABLE_MSGS, $MSG_FRAME_COLOR, $MSG_FRAME_COLOR2, $MSG_TEXT_COLOR;
global $TEXT_COLOR1, $TEXT_COLOR2;
$FT1="<FONT FACE=\"$FONTFACE\" COLOR=\"$TEXT_COLOR1\"
SIZE=-1>";
@@ -273,15 +260,6 @@
endif;
echo "</TD></TR>\n";
echo "<TR VALIGN=top><TD align=right>$FT1 Date:</TD><TD
align=left>$FT2<B>$date</B></TD></TR>\n";
- if ($USE_DOC_UPLOAD && $document!=0):
- $docinfo=getDocInfo($document);
- echo "<TR VALIGN=top><TD align=right>$FT1 Attachment:</TD>";
- if ($mode=="preview"):
- echo "<TD align=left>$FT2<B>$docinfo[0]</B>
$LIL_DOC_IMG</TD></TR>\n";
- else:
- echo "<TD align=left>$FT2<A
HREF=\"getdoc.php?document=$document\"><B>$docinfo[0]</B>$LIL_DOC_IMG</A></TD></TR>\n";
- endif;
- endif;
if($parent>0):
echo "<TR VALIGN=top><TD align=right>$FT1 Follow-Up To:</TD><TD
align=left>$FT2";
$q3=mysql($DBASE, "select subj from $TABLE_MSGS where id=$parent");
@@ -317,7 +295,7 @@
/*
* Deletes a posted message, and any attachments
*/
- global $MSGS, $DOCS, $DBASE, $TABLE_MSGS, $TABLE_DOCS, $USE_DOC_UPLOAD;
+ global $MSGS, $DOCS, $DBASE, $TABLE_MSGS, $TABLE_DOCS;
$q1=@mysql_db_query($DBASE, "select * from $TABLE_MSGS where id=$id");
if(mysql_numrows($q1)!=1 || $q1==-1):
echo "<FONT COLOR=\"#800000\">Error:
".mysql_error()."<BR>Message $id not deleted.</FONT><BR>\n";
@@ -328,13 +306,6 @@
$document=mysql_result($q1,0,"document");
mysql_db_query($DBASE, "delete from $TABLE_MSGS where id=$id");
mysql_db_query($DBASE, "update $TABLE_MSGS set parent=$parent where
parent=$id");
- if ($USE_DOC_UPLOAD && $document!=0):
- $q=mysql_db_query($DBASE,"delete from $TABLE_DOCS where
document=$document");
- $file=sprintf("%-07.7d",$document);
- $file="$DOCS/d"+$file;
- unlink($file);
- $subj="$subj (plus attachment)";
- endif;
return($subj);
endif;
};
Index: php-hosts-web/msgboard/etc/edit.php
diff -u php-hosts-web/msgboard/etc/edit.php:1.1 php-hosts-web/msgboard/etc/edit.php:1.2
--- php-hosts-web/msgboard/etc/edit.php:1.1 Sun Apr 21 16:58:05 2002
+++ php-hosts-web/msgboard/etc/edit.php Sun Apr 21 20:14:00 2002
@@ -102,24 +102,9 @@
We reserve the right to edit or delete messages that we deem offensive or
inappropriate.<BR></TD>
</TR>
-<? if ($USE_DOC_UPLOAD):?>
-<TR VALIGN=top BGCOLOR="<? echo $MSG_FRAME_COLOR2;?>">
-<TD COLSPAN=2><FONT FACE="<? echo $FONTFACE;?>" SIZE=-1>
-If you wish to attach a document to this message, enter the filename here.</TD>
-</TR>
-<TR VALIGN=top>
-<TD ALIGN=right>
-<FONT FACE="<? echo $FONTFACE;?>" SIZE=-1>Attachment:</TD>
-<TD><INPUT NAME="filename" TYPE="file"></TD>
-</TR>
-<? endif;?>
-
<TR VALIGN=top BGCOLOR="<? echo $MSG_FRAME_COLOR2;?>">
<TD ALIGN=left><INPUT TYPE="Reset" VALUE=" Clear All "></TD>
<TD ALIGN=right><INPUT TYPE="submit" VALUE=" Edit » ">
-<? if ($USE_DOC_UPLOAD):
- echo "<FONT FACE=\"$FONTFACE\" SIZE=-2><BR>This may take a while if you
have attached a file.\n";
-endif;?>
</TD>
</TR>
</TABLE>