fclose($file);
}
+
+
+
/** This checks if there is a pref file, if there isn't, it will create it. **/
function checkForPrefs($data_dir, $username) {
$filename = "$data_dir$username.pref";
}
return;
}
+
+
+
+ /** Writes the Signature **/
+ function setSig($data_dir, $username, $string) {
+ $filename = "$data_dir$username.sig";
+ $file = fopen($filename, "w");
+ fwrite($file, $string);
+ fclose($file);
+ }
+
+
+
+ /** Gets the signature **/
+ function getSig($data_dir, $username) {
+ $filename = "$data_dir$username.sig";
+ if (file_exists($filename)) {
+ $file = fopen($filename, "r");
+ while (!feof($file)) {
+ $sig .= fgets($file, 1024);
+ }
+ fclose($file);
+ } else {
+ echo "Signature file not found.";
+ exit;
+ }
+ return $sig;
+ }
?>
\ No newline at end of file
echo " </TR>\n";
echo " <TR>\n";
echo " <TD BGCOLOR=\"$color[4]\" COLSPAN=2>\n";
- echo " <TEXTAREA NAME=passed_body ROWS=20 COLS=\"$editor_size\" WRAP=HARD>$body</TEXTAREA><BR>";
+ if ($use_signature == true)
+ echo " <TEXTAREA NAME=passed_body ROWS=20 COLS=\"$editor_size\" WRAP=HARD>$body\n\n$signature</TEXTAREA><BR>";
+ else
+ echo " <TEXTAREA NAME=passed_body ROWS=20 COLS=\"$editor_size\" WRAP=HARD>$body</TEXTAREA><BR>";
echo " </TD>";
echo " </TR>\n";
echo "</TABLE>\n";
$editor_size = getPref($data_dir, $username, "editor_size");
if ($editor_size == "")
$editor_size = 76;
+
+ $use_signature = getPref($data_dir, $username, "use_signature");
+ if ($use_signature == "")
+ $use_signature = false;
+
+ /** Load up the Signature file **/
+ if ($use_signature == true) {
+ $signature = getSig($data_dir, $username);
+ } else {
+ $signature = "";
+ }
?>
echo " </TD>";
echo " <TD WIDTH=40% ALIGN=LEFT>";
echo " <FONT FACE=\"Arial,Helvetica\">";
- if (isset($editor_size))
+ if ($editor_size >= 5)
echo " <TT><INPUT TYPE=TEXT SIZE=5 NAME=editorsize VALUE=\"$editor_size\"></TT><BR>";
else
echo " <TT><INPUT TYPE=TEXT SIZE=5 NAME=editorsize VALUE=\"76\"></TT><BR>";
echo " </TR>";
echo "</TABLE>";
+ // SIGNATURE
+ echo "<CENTER>";
+ if ($use_signature == true)
+ echo "<INPUT TYPE=CHECKBOX VALUE=\"1\" NAME=usesignature CHECKED> Use a signature?<BR>";
+ else
+ echo "<INPUT TYPE=CHECKBOX VALUE=\"1\" NAME=usesignature> Use a signature?<BR>";
+
+ if ($editor_size < 5)
+ $sig_size = 76;
+ else
+ $sig_size = $editor_size;
+
+ echo "<BR>Signature:<BR><TEXTAREA NAME=signature_edit ROWS=5 COLS=\"$sig_size\" WRAP=HARD>$signature</TEXTAREA><BR>";
+ echo "</CENTER>";
+
// SUBMIT BUTTON
echo "<BR><CENTER><INPUT TYPE=SUBMIT VALUE=\"Submit\"></CENTER>\n";
setPref($data_dir, $username, "move_to_trash", $movetotrash);
setPref($data_dir, $username, "wrap_at", $wrapat);
setPref($data_dir, $username, "editor_size", $editorsize);
+ setPref($data_dir, $username, "use_signature", $usesignature);
+
+ setSig($data_dir, $username, $signature_edit);
echo "<FONT FACE=\"Arial,Helvetica\">";
echo "<BR><BR><BR><CENTER><B>Options Saved!</B><BR><BR>";