<tr> <td align='right'>Subject</td> <td> <input type='text' name='subject' value='' size='50' /> <input type='submit' name='email' value='Send' /> </td> <td align='left'></td> </tr> <tr> <td></td> <td align='left'> <?php require_once "htmleditor/editor.inc.php"; include "sniffer.inc.php"; addeditor("body", 80, 20, $text, "discuss"); print $content; ?> </td> <td align='right'></td> </tr> </table> <input type='hidden' name='action' value='send' /> <input type='hidden' name='scope' value='<?php echo $scope; ?> ' /> <input type='hidden' name='storyid' value='<?php echo $storyid; ?>
function _outputform($t) { // outputs a post form of type $t (newpost,edit,reply) global $sid, $error, $site_owner, $_full_uri, $cfg; //$script = $_SERVER['SCRIPT_NAME']; //printpre ("fulluri: ".$_full_uri); //printpre ("thisinfo: ".$this->getinfo); if ($t == 'edit') { $b = 'update'; $d = "You are editing your post "<a name='" . $this->id . "'>" . $this->subject . "</a>"\n"; $c = $_REQUEST['content'] ? $_REQUEST['content'] : $this->content; $s = $_REQUEST['subject'] ? $_REQUEST['subject'] : $this->subject; } if ($t == 'reply' || $t == 'newpost') { $b = 'post'; $d = "<a name='new'>You are posting a new entry.</a>\n"; $c = $_REQUEST['content']; if ($t == 'reply') { $d = "You are replying to "<a name='reply' href='#'" . $this->id . ">" . $this->subject . "</a>""; if (!$_REQUEST['subject'] && !ereg("^Re:", $this->subject)) { $s = "Re: " . $this->subject; } else { $s = $this->subject; } } else { $s = $_REQUEST['subject']; } } if ($t == 'rate') { $b = 'rate'; //$d = "<a name='".$this->id."'>You are editing your post "".$this->subject.""</a>"; $s = $_REQUEST['subject'] ? $_REQUEST['subject'] : $this->subject; $a = "by <span class='subject'>" . $this->authorfname . "</span>\n"; $a .= " posted on "; $a .= timestamp2usdate($this->tstamp); $c = $_REQUEST['content'] ? $_REQUEST['content'] : $this->content; } $p = $t == 'reply' ? " style='padding-left: 15px'" : ''; printc("\n<form action='" . $_full_uri . "/index.php?{$sid}&action=site&" . $this->getinfo . "#" . $this->id . "' method='post' name='addform'>\n"); printc("<tr><td{$p}><b>{$d}</b></td></tr>\n"); printc("<tr><td{$p}>\n"); printc("<table width='100%' cellspacing='0px'>\n"); if ($t == 'rate') { //printc ("Subject: <input type='text' size='50' name='subject' value='".spchars($s)."' readonly />"); if ($this->rating && isnumeric($this->rating)) { $rating_value = $this->rating; } else { $rating_value = ""; } printc("<td class='dheader3'>\n"); printc("<table width='100%' cellspacing='0px'>\n"); printc("<tr><td align='left'>\n"); printc("<span class='subject'><a name='" . $this->id . "'>\n"); printc($s); printc("</a><input type='hidden' name='subject' value='" . spchars($s) . "' />\n"); printc(" (<input type='text' size='3' class='textfield small' name='rating' value='" . $rating_value . "' />\n"); printc("<input type='submit' class='button small' value='rate' />"); printc(" <a href='" . $_full_uri . "/index.php?{$sid}&action=site&" . $this->getinfo . "#" . $this->id . "'><input type='button' class='button small' value='cancel' /></a>\n"); printc(" numeric only"); printc(")\n"); printc("</span></td>\n"); printc("<td align='right'></td>\n"); printc("</tr><tr>\n"); printc("<td align='left'>\n"); printc($a); if ($this->media_tag) { $media_link = "<a href='" . $uploadurl . "/" . $_REQUEST[site] . "/" . $this->media_tag . "' target='media'>" . $this->media_tag . "</a>\n"; printc("<br />attached: {$media_link}\n"); } printc("</td>\n"); printc("<td align='right' valign='bottom'></td></tr>\n"); printc("</table>\n"); printc("</td>\n"); } else { printc("<tr><td align='left'>\n"); printc("<table>"); /****************************************************************************** * If public discussion and not logged in * add fields for visitor name and email ******************************************************************************/ if (!$_SESSION[auser]) { printc("<tr><td colspan = 2><div style='font-size: 9px'>If you part of the " . $cfg[inst_name]); printc(" community or have posted to a public forum here and received a visitor user account, please log in <b>before</b> posting."); printc(" If you do not yet have a user account, please register below.</div></td></tr>\n"); //printc ("<tr><td>Full Name:</td><td><input type='text' size='50' name='visitor_name' value='".$_REQUEST['visitor_name']."' /></td></tr>\n"); //printc ("<tr><td>Email:</td><td><div style='font-size: 9px'><input type='text' size='25' name='visitor_email' value='".$_REQUEST['visitor_email']."' />\n"); printc("<tr><td colspan = 2 align = center><div style='font-size: 10px'>"); printc("<a href='passwd.php?action=login' target='password' onclick='doWindow(\"password\",400,300)'>Login</a> | "); printc("<a href='passwd.php?action=register' target='password' onclick='doWindow(\"password\",400,300)'>Register</a> | "); printc("<a href='passwd.php?action=reset' target='password' onclick='doWindow(\"password\",400,300)'>Forget your password?</a></div>"); printc("</td></tr>"); } if ($_SESSION[auser]) { printc("<tr><td>Subject:</td><td><input type='text' class='textfield small' size='50' name='subject' value='" . spchars($s) . "' /></td></tr>\n"); // printc ("<tr><td></td><td></td></tr>\n"); } printc("</table>\n"); } printc("</td><td align='right'>\n"); // if not rate, print edit, update or post if ($t != 'rate' && $_SESSION[auser]) { printc("<input type='submit' class='button small' value='{$b}' />\n"); printc("<a href='" . $_full_uri . "/index.php?{$sid}&action=site&" . $this->getinfo . "#" . $this->id . "'><input type='button' class='button small' value='cancel' /></a>\n"); } printc("</td></tr></table>\n"); printc("</td></tr>\n"); // print out post content //printc ("<tr><td class='content$p'>"); /****************************************************************************** * print out editor here... (if editing post or adding new or not rating) ******************************************************************************/ if ($t != 'rate' && $_SESSION[auser]) { printc("<td class='content{$p}'>\n"); $c = convertTagsToInteralLinks($_REQUEST[site], $c); addeditor("content", 60, 20, $c, "discuss"); } else { printc("<td>" . $c . "<br /><br />\n"); printc("<input type='hidden' name='content' value='" . $c . "' />\n"); } /****************************************************************************** * print hidden fields ******************************************************************************/ printc("<input type='hidden' name='discuss' value='" . $_REQUEST['discuss'] . "' />\n"); //added fullstory action for posting form printc("<input type='hidden' name='action' value='" . $_REQUEST['action'] . "' />\n"); //added site variable for discussion logging printc("<input type='hidden' name='site' value='" . $_REQUEST['site'] . "' />\n"); printc("<input type='hidden' name='libraryfileid' value='" . $_REQUEST['libraryfileid'] . "' />\n"); printc("<input type='hidden' name='dis_order' value='" . $this->dis_order . "' />\n"); printc("<input type='hidden' name='commit' value='1' />\n"); if ($t == 'edit' || $t == 'rate') { printc("<input type='hidden' name='id' value=" . $_REQUEST['id'] . " />\n"); } if ($t == 'reply') { printc("<input type='hidden' name='replyto' value=" . $_REQUEST['replyto'] . " />\n"); } $site = $_REQUEST[site]; /****************************************************************************** * print file upload UI ******************************************************************************/ if ($t != 'rate' && $_SESSION[auser]) { printc("<br />Upload a File:<input type='text' class='textfield small' name='libraryfilename' value='" . $_REQUEST['libraryfilename'] . "' size='25' readonly />\n<input type='button' class='button small' name='browsefiles' value='Browse...' onclick='sendWindow(\"filebrowser\",700,600,\"filebrowser.php?site={$site}&source=discuss&owner={$site_owner}&editor=none\")' target='filebrowser' style='text-decoration: none' />\n\n"); if ($_SESSION['aid']) { printc("<br />You will be able to edit your post as long as no-one replies to it.\n"); } else { printc("<br />Once submitted, you will not be able to modify your post.\n"); } } printc("</form>\n"); printc("</td></tr>\n"); }