To Make a Hall A Logbook entry go to http://hallaweb.jlab.org/halog/php/make_new_elog.php. \n"; exit(); } $g0logrootdir="/home/adaq/halog"; $hclogrootdir="/home/adaq/halog"; $senderemail = "adaq-noreturn@jlab.org"; $sendername = "Hall A Electronic Logbook"; $webroot = "http://www.jlab.org/~adaq/halog"; $logentrynumber=exec("".$g0logrootdir."/src/halognumber"); function callback($buffer) { global $webroot; return(ereg_replace("(\nOnce the logbook index has been updated, the entry will be available at the URL $finalurl\n

$sendername\n"; ob_start("callback"); echo "


\n" ?>

User name

"."Log entry time " . date("H:i:s ") . "on " .date("F d, Y") ."\n"; $uname = posix_uname(); echo "\n"; echo "

" ."Entry number ".$logentrynumber."

\n"; if ($log_refer != NULL){ // echo "This log has reference to log number(s): " .$log_refer ."
\n"; echo "\n"; } preg_match("/^(.*),(.*)$/",$topic,$matches); $copyinhclog = $matches[1]; if($matches[2]) { $full_title = $matches[2].": ".$log_title; } else { $full_title = $log_title; } echo "keyword=".$full_title ."
\n"; //echo .g0logrootdir."/tmp_html/".$today .".html"."
\n"; // Use a+ just in case a file of same name already exists $filenamenopostfix = "".$g0logrootdir."/log/tmp_html/".$today; $hcfilenamenopostfix = "".$hclogrootdir."/log/tmp_html/".$today; $handle=fopen($filenamenopostfix.".html", "a+"); //echo "Log Title is: " .$full_title ."
\n"; echo "
\n"; if($htmlstyle == "pre") { echo str_replace("\n","
\n",htmlentities($log_text))."
\n"; } elseif ($htmlstyle == "pure") { echo $log_text."
\n"; } else { echo preg_replace("/(^|\n)\s*(\n|$)/s","\\1

\\2",$log_text)."
\n"; } echo "
\n"; if ($notify != NULL){ echo "A copy of this log entry has been emailed to: " .$notify ."
\n"; } echo "
\n"; echo "
\n"; echo "
\n"; $i=0; while ($HTTP_POST_FILES['att_file'.$i]['size'] !=0) { echo "

" .$att_title[$i] ."

\n"; //echo "image size is: " .$HTTP_POST_FILES['att_file'.$i]['size'] ."
\n"; //echo "temporary filename is: " .$HTTP_POST_FILES['att_file'.$i]['tmp_name'] ."
\n"; $filetype=$HTTP_POST_FILES['att_file'.$i]['type']; $pieces=explode("/",$filetype); # echo "type of image is: " .$pieces[0]." ".$pieces[1] ."
\n"; $attatchmentfilename = $filenamenopostfix.".".($i+1)."." .$pieces[1]; move_uploaded_file($HTTP_POST_FILES['att_file'.$i]['tmp_name'], $attatchmentfilename); chmod($attatchmentfilename,0666); if($copyinhclog) { $hcattatchmentfilename = $hcfilenamenopostfix.".".($i+1)."." .$pieces[1]; copy($attatchmentfilename, $hcattatchmentfilename); chmod($hcattatchmentfilename, 0666); } if ($pieces[1] == "gif" || $pieces[1] == "jpeg" || $pieces[1] == "pjpeg" || $pieces[1] == "x-portable-anymap" || $pieces[0] == "image") { echo "
\n"; } else { echo "".$HTTP_POST_FILES['att_file'.$i]['name']."
\n"; } echo "
\n"; $i++; } ?> \r\n"); fputs($fd, "Subject: $full_title\r\n"); fputs($fd, "Content-Type: text/html; charset=utf-8\r\n"); fputs($fd, "X-Mailer: Elog/(PHP)\r\n\r\n"); fputs($fd, "$full_title\r\n $newcontents\r\n"); pclose($fd); } ?>