function makedownloadbar($o) { global $site, $section, $page, $uploaddir, $uploadurl; if ($o->getField("type") != 'file') { return; } $b = db_get_line("media INNER JOIN slot ON media.FK_site=slot.FK_site", "media_id='" . addslashes($o->getField("longertext")) . "'"); ob_start(); print "\n"; print "\n<div class='downloadbar' style='margin-bottom: 10px'>"; // print "\n\t<table width='100%' cellpadding='0' cellspacing='0'>\n\t<tr>\n\t\t<td>"; if ($o->getField("title")) { print "\n<div style='float: left; '><strong><a href='index.php?{$sid}&action=site&site={$site}&section={$section}&page={$page}&story=" . $o->id . "&detail=" . $o->id . "'>"; print "" . spchars($o->getField("title")) . "</a></strong>\n\t\t\t</div>"; } print printDownloadLink($b); print printMediaPlayer($b); print "\n\t\t\t\t\t<div style='clear: left; font-size: smaller; margin-bottom: 10px; '>"; print printCitation($b); print "\n\t\t\t\t\t</div>"; if ($o->getField("shorttext")) { print "" . stripslashes($o->getField("shorttext")); } print "\n\t<div style='clear: both;'> </div>"; print "</div>\n"; return ob_get_clean(); }
function editor_activex($textarea, $cols, $rows, $text) { //style sheet for active-x editor printc("<style type=\"text/css\">\n"); printc("<!--\n"); printc(" .btn { BORDER-WIDTH: 1; width: 26px; height: 24px; }\n"); printc(" .btnDN { BORDER-WIDTH: 1; width: 26px; height: 24px; BORDER-STYLE: inset; BACKGROUND-COLOR: buttonhighlight; }\n"); printc(" .btnNA { BORDER-WIDTH: 1; width: 26px; height: 24px; filter: alpha(opacity=25); }\n"); printc("-->\n"); printc("</style>\n"); printc("<style type=\"text/css\">\n"); printc("<!--\n"); printc(" body, td { font-family: arial; font-size: 12px; }\n"); printc(" .headline { font-family: arial black, arial; font-size: 28px; letter-spacing: -2px; }\n"); printc(" .subhead { font-family: arial, verdana; font-size: 12px; let!ter-spacing: -1px; }\n"); printc("-->\n"); printc("</style>\n"); // Begin modification 4 - 11.11.02 - afranco // Add explanation of how to get <br />s printc("<div class='desc'><b>Note:</b> To get a single line break, hold down SHIFT while pressing enter."); // Begin modification 2 - 10.26.02 - rlange // Added an id tag to the textarea definition printc("<textarea name='{$textarea}' id='{$textarea}' cols='{$cols}' rows='{$rows}'>"); printc(spchars($text)); printc("</textarea>"); // End modification 2 - 10.26.02 - rlange // Begin modification 3 - 10.26.02 - rlange // Create the iView from JavaScript for the above textarea printc("<script language=\"javascript1.2\">\n"); printc("editor_generate('{$textarea}');\n"); printc("</script>\n"); }
} } // if we are in the institute IPs, use the institute // cache. if ($ipIsInInstitute) { CarpCacheShow($url, '', 1, 'institute'); } else { CarpCacheShow($url); } } printc("<div class='story'>"); printc(ob_get_contents()); printc("</div>"); ob_clean(); if ($o->getField("title")) { printc("\n\n<div class='contentinfo'>" . spchars($o->getField("title")) . "</div>\n"); // printc("<div><a href='".$o->getField("url")."' target='_blank'>".$o->getField("url")."</a></div>"); // if ($o->getField("shorttext")) printc("<div class='desc'>".stripslashes($o->getField("shorttext"))."</div>"); } if ($o->getField("longertext") && !ereg("^[\n\r]*<br />\$", $o->getField("longertext"))) { if ($action == 'viewsite') { $discussAction = 'viewsite'; } else { if (ereg("preview_edit_as|preview_as", $action)) { $discussAction = ereg_replace("preview_edit_as", "preview_as", $action); } else { $discussAction = 'site'; } } $link = "index.php?{$sid}&action=" . $discussAction . "&site={$site}&section={$section}&page={$page}&story=" . $o->id . "&detail=" . $o->id; printc("<div align='right'><a href='" . $link . "'>" . " More >></a></div>\n");
<!-- <textarea id="ta" name="ta" style="width:100%" rows="20" cols="80"> --> <textarea id="<?php echo $textarea; ?> " name="<?php echo $textarea; ?> " style="width:100%" rows="<?php echo $rows; ?> " cols="<?php echo $cols; ?> "><?php print spchars($text); ?> </textarea> <!-- <script> --> <!-- initEditor(); --> <!-- </script> --> <p /> <!-- <input type="submit" name="ok" value=" submit " /> --> <input type="button" name="ins" value=" insert html " onclick="return insertHTML();" /> <!-- <input type="button" name="hil" value=" highlight text " onclick="return highlight();" /> --> <!-- <a href="javascript:mySubmit()">submit</a> -->
printc("\n\t</td>\n</tr>"); } } // Revert to this version link (bottom location) if ($_REQUEST['version'] && $storyObj->hasPermission("edit")) { printc("\n\t<tr><td align='center'><br />"); printc("<a class='btnlink2' href='index.php?{$sid}&action=" . $action . "&site=" . $_REQUEST['site'] . "&section=" . $_REQUEST['section'] . "&page=" . $_REQUEST['page'] . "&story=" . $_REQUEST['story'] . "&revert=" . $version_num . "&versioning=" . $_REQUEST['story'] . "&comingFrom=viewsite'>Revert to this Version</a>\n"); printc("</td></tr>\n"); } /****************************************************************************** * print out title and options ******************************************************************************/ printc("<tr><td align='left'>"); printc("<a href='index.php?action=" . $action . "&" . $getinfo2 . "'>" . spchars($pageObj->getField('title')) . "</a>"); if ($storyObj->getField('title')) { printc(" > " . spchars($storyObj->getField('title'))); } if ($_REQUEST['oldversion'] && $_REQUEST['newversion']) { printc(" > <a href='index.php?{$sid}&action=" . $action . "&site=" . $_REQUEST['site'] . "&section=" . $_REQUEST['section'] . "&page=" . $_REQUEST['page'] . "&story=" . $_REQUEST['story'] . "&versioning=" . $_REQUEST['story'] . "'>All Versions</a>"); printc(" > Selected Versions"); } else { if ($_REQUEST['versioning']) { printc(" > All Versions"); /****************************************************************************** * if particular version then get version details ******************************************************************************/ } else { if ($_REQUEST['version']) { printc(" > <a href='index.php?{$sid}&action=" . $action . "&site=" . $_REQUEST['site'] . "&section=" . $_REQUEST['section'] . "&page=" . $_REQUEST['page'] . "&story=" . $_REQUEST['story'] . "&versioning=" . $_REQUEST['story'] . "'>All Versions</a>"); printc(" > Revision " . $version_num); } else {
include "output_modules/common.inc.php"; /* */ /* if ($a[category]) { */ /* printc("<div class='contentinfo' align='right'>"); */ /* printc("Category: <b>".spchars($a[category])."</b>"); */ /* printc("</div>"); */ /* } */ /* print "<pre>"; */ /* print_r($o->data); */ /* print "</pre>"; */ /* print db_get_value("story","story_text_long","story_id=".$o->id); */ $abbrurl = substr($o->getField("url"), 0, 75); $url = $o->getField("url"); /****************************************************************************** * replace general media library urls (i.e. $mediapath/$sitename/filename) * replace general with specific ******************************************************************************/ $url = convertTagsToInteralLinks($site, $url); $abbrurl = substr($url, 0, 75); if ($o->getField("title")) { printc("<div class='leftmargin'><b><a href='" . $url . "' target='_blank'>"); printc(spchars($o->getField("title")) . "</a></b></div>"); } printc("<div class='desc'><a href='" . $url . "' target='_blank'>" . $abbrurl . "...</a></div>"); //printc("<div><a href='".$o->getField("url")."' target='_blank'>".$o->getField("url")."</a></div>"); if ($o->getField("shorttext")) { printc("<div class='desc'>" . stripslashes($o->getField("shorttext")) . "</div>"); } if ($o->getField("discuss")) { include dirname(__FILE__) . "/discussionLink.inc.php"; }
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"); }
/* $Id$ */ include "output_modules/common.inc.php"; $st = $o->getField("shorttext"); /****************************************************************************** * replace general media library urls (i.e. $mediapath/$sitename/filename) * replace general with specific ******************************************************************************/ $st = convertTagsToInteralLinks($site, $st); if ($o->getField("texttype") == 'text') { $st = nl2br($st); } $wikiResolver =& WikiResolver::instance(); $st = $wikiResolver->parseText($st, $site, $section, $page); $filename = urldecode(db_get_value("media", "media_tag", "media_id='" . addslashes($o->getField("longertext")) . "'")); $dir = db_get_value("media INNER JOIN slot ON media.FK_site = slot.FK_site", "slot_name", "media_id='" . addslashes($o->getField("longertext")) . "'"); $imagepath = "{$uploadurl}/{$dir}/{$filename}"; printc("\n\n<table align='center'>\n\t<tr>\n\t\t<td align='center'>\n\t\t\t<img src='{$imagepath}' border='0' alt='Full-size image' />\n\t\t</td>\n\t</tr>"); if ($o->getField("title")) { printc("\n\t<tr>\n\t\t<td align='center'>"); printc("\n\t\t\t<strong>\n\t\t\t\t<a href='index.php?{$sid}&action=site&site={$site}&section={$section}&page={$page}&story=" . $o->id . "&detail=" . $o->id . "'>"); printc(spchars($o->getField("title"))); printc("</a>\n\t\t\t</strong>\n\t\t</td>\n\t</tr>"); } if ($o->getField("shorttext")) { printc("\n\t<tr>\n\t\t<td align='left'>" . stripslashes($st) . "</td>\n\t</tr>"); } printc("\n</table>\n"); if ($o->getField("discuss")) { include dirname(__FILE__) . "/discussionLink.inc.php"; }
} printc("<div class='leftmargin'>\n"); // Reorder Links if ($_REQUEST['showorder'] == "story" && ($thisPage->getField("storyorder") == 'custom' || $thisPage->getField("storyorder") == '') && $thisPage->hasPermission("edit")) { //print "<select name='reorder2' style = 'font-size: 9px; display: none;' class='pageOrder' onchange='window.location = \"".$reorderUrl."\" + this.value;'>\n'"; printc("<select name='reorder2' style = 'font-size: 9px; class='pageOrder' onchange='window.location = \"" . $reorderUrl . "\" + this.value;'>\n'"); for ($i = 0; $i < count($stories); $i++) { printc("<option value='" . $i . "'" . ($i == $nextorder || $i == $story_set ? " selected" : "") . ">" . ($i + 1) . "</option>\n"); } printc("</select>\n"); } if ($o->getField("title") && $o->getField("type") != "link" && $o->getField("type") != "file" && $o->getField("type") != "image") { printc("<strong>"); printc("<a name='" . $o->id . "'"); printc(" href='index.php?{$sid}&action=viewsite&site={$site}&section={$section}&page={$page}&story=" . $o->id . "&detail=" . $o->id . "'>"); printc(spchars($o->getField("title")) . "</a></strong>\n"); } printc("</div>\n"); /****************************************************************************** * check is story is active and if not, display active dates. ******************************************************************************/ if (!indaterange($o->getField("activatedate"), $o->getField("deactivatedate"))) { printc("<div class='contentinfo' align='left'>\n"); if (!nulldate($o->getField("activatedate"))) { printc("Active dates: <strong><a href='index.php?{$sid}&action=edit_story&edit_story=" . $o->id . "&comingFrom=viewsite&step=3&site={$site}&section={$section}&page={$page}&'>" . $o->getField("activatedate") . "</a></strong>"); } if (!nulldate($o->getField("deactivatedate"))) { printc(" to <strong><a href='index.php?{$sid}&action=edit_story&edit_story=" . $o->id . "&comingFrom=viewsite&step=3&site={$site}&section={$section}&page={$page}&'>" . $o->getField("deactivatedate") . "</strong>"); } printc("</div>"); }
* using array of posts generated by _fetchchildren ******************************************************************************/ // Start with default perms $canReply = $storyObj->hasPermission("discuss"); // Unless everyone is specifically given permission; i.e "anonymous posting" is allowed, // make sure that the user is logged in. if ((!$_SESSION[auser] || $_SESSION[atype] == "visitor") && !$storyObj->hasPermission("discuss", "everyone", 1)) { $canReply = FALSE; } printc("\n<table width='100%' cellspacing='1'>"); $ds->outputAll($canReply, $_SESSION[auser] == $site_owner, true, $showposts, $showallauthors, $mailposts); if (!$ds->count()) { printc("\n\t<tr>\n\t\t<td>There have been no posts to this discussion.</td>\n\t</tr>"); } printc("\n</table>"); } printc("<table>"); printc("\n\t<tr>\n\t\t<td align='left'>\n\t\t\t<br /><a href='index.php?action=" . $action . "&" . $getinfo2 . "'>" . spchars($pageObj->getField('title')) . "</a> > in depth</td>\n\t</tr>"); printc("</table>\n"); function participants() { global $storyObj; $storyid = $storyObj->getField("id"); $where = "story_id ='" . addslashes($storyid) . "'"; $query = "\n\tSELECT \n\t\tdistinct user_fname, user_email\n\tFROM \n\t\tdiscussion\n\tINNER JOIN story ON FK_story = story_id\n\tINNER JOIN page ON FK_page = page_id\n\tINNER JOIN section ON FK_section = section_id\n\tINNER JOIN site ON FK_site = site_id\n\tINNER JOIN user ON FK_author = user_id\n\tWHERE \n\t\t{$where}\n\t"; $r = db_query($query); $a = db_fetch_assoc($r); $num = db_num_rows($r); //$num.= " participants"; return $num; }