</tr> <?php $color = 0; $today = date(Ymd); $yesterday = date(Ymd) - 1; if (db_num_rows($r)) { while ($a = db_fetch_assoc($r)) { print "\n\t\t<tr>"; print "\n\t\t\t<td class='td{$color}' style='white-space: nowrap;'>"; print "\n\t\t\t\t<a href='viewlogs.php?{$sid}&site={$a['name']}' style='color: #000;'>"; //print "$yesterday"; if (strncmp($today, $a[editedtimestamp], 8) == 0 || strncmp($yesterday, $a[editedtimestamp], 8) == 0) { print "<b>"; } print timestamp2usdate($a[editedtimestamp], 1); if (strncmp($today, $a[editedtimestamp], 8) == 0 || strncmp($yesterday, $a[editedtimestamp], 8) == 0) { print "</b>"; } print "</a>"; print "\n\t\t\t</td>"; print "\n\t\t\t<td class='td{$color}'>{$a['name']}</td>"; print "\n\t\t\t<td class='td{$color}' style='color: #" . ($a[active] ? "090'>active" : "900'>inactive") . "</td>"; print "\n\t\t\t<td class='td{$color}'>" . (group::getClassesFromName($a[name]) ? "group - " : "") . "{$a['type']}</td>"; print "\n\t\t\t<td class='td{$color}'>{$a['theme']}</td>"; print "\n\t\t\t<td class='td{$color}'>"; print "\n\t\t\t\t<a href='#' onclick='opener.window.location=\"index.php?{$sid}&action=site&site={$a['name']}\"'>"; print stripslashes($a[title]); print "</a>"; print "\n\t\t\t</td>"; print "\n\t\t\t<td class='td{$color}'>";
if ($_REQUEST["detail"]) { //$ds = & new discussion($o); $story_id = $o->getField("id"); $query = "\n\t\t\t\t\t\t\tSELECT\n\t\t\t\t\t\t\t\tdiscussion_id,discussion_tstamp,discussion_content,\n\t\t\t\t\t\t\t\tdiscussion_subject,user_uname,user_fname,FK_story,\n\t\t\t\t\t\t\t\tFK_author,FK_parent,media_tag,FK_media\n\t\t\t\t\t\t\tFROM\n\t\t\t\t\t\t\t\tdiscussion\n\t\t\t\t\t\t\tINNER JOIN\n\t\t\t\t\t\t\t\tuser\n\t\t\t\t\t\t\tON\n\t\t\t\t\t\t\t\tFK_author = user_id\n\t\t\t\t\t\t\tLEFT JOIN\n\t\t\t\t\t\t\t\tmedia\n\t\t\t\t\t\t\tON\n\t\t\t\t\t\t\t\tFK_media = media_id\n\t\t\t\t\t\t\tWHERE\n\t\t\t\t\t\t\t\tFK_story='" . addslashes($story_id) . "'\n\t\t\t\t\t\t"; $r = db_query($query); while ($a = db_fetch_assoc($r)) { print "\t\t<item>\n"; $title = $a["discussion_subject"]; print "\t\t\t<title>" . htmlspecialchars(urldecode($title), ENT_QUOTES, 'utf-8') . "</title>\n"; $storylink = "&story=" . $story_id . "&detail=" . $story_id . "#" . $a["discussion_id"]; $storylink = $storylink = htmlspecialchars($storylink, ENT_QUOTES); $discusslink = $a["discussion_id"]; print "\t\t\t<link>" . $link . $sectionlink . $pagelink . $storylink . "</link>\n"; print "\t\t\t<guid isPermaLink=\"true\">" . $link . $sectionlink . $pagelink . $storylink . "</guid>\n"; print "\t\t\t<pubDate>"; print date("D, j M Y G:i:s O", strtotime(timestamp2usdate($a["discussion_tstamp"]))); print "</pubDate>\n"; print "\t\t\t<author>"; print $a["user_fname"]; $user_uname = $a["user_uname"]; $user_email = db_get_value("user", "user_email", "user_uname='" . addslashes($user_uname) . "'"); print " " . $user_email . ""; print "</author>\n"; print "\t\t\t<comments>"; print $link . $sectionlink . $pagelink . $storylink; print "</comments>\n"; $description = $a["discussion_content"]; $description = convertTagsToInteralLinks($_REQUEST[site], $description); $description = str_replace("\n", "", $description); $description = str_replace("\r", "", $description); $description = htmlspecialchars(urldecode($description), ENT_QUOTES, 'utf-8');
// $checkstatus = " checked='checked'"; // } else if (in_array($e,$_SESSION[editors])) { // $checkstatus = " checked='checked'"; // } else { // $checkstatus = ""; // } print "\n\t\t\t\t\t<tr>"; print "\n\t\t\t\t\t\t<td class='td{$color}' align='center'>\n\t\t\t\t\t\t\t<input type='checkbox' name='editors[]' value='{$e}' " . $checkstatus . " />\n\t\t\t\t\t\t</td>"; print "\n\t\t\t\t\t\t<td class='td{$color}'>\n\t\t\t\t\t\t\t<a href='{$PHP_SELF}?{$sid}&action=review&userid=" . $a['user_id'] . "&userfname=" . urlencode($a['user_fname']) . "&" . htmlspecialchars($getvariables) . "'>" . $a['user_fname'] . "</a>\n\t\t\t\t\t\t</td>"; print "\n\t\t\t\t\t\t<td class='td{$color}'>" . $a['user_email'] . "</td>"; print "\n\t\t\t\t\t\t<td class='td{$color}'>" . $postcount . "</td>"; print "\n\t\t\t\t\t\t<td class='td{$color}'>" . $avg_rating . "</td>"; print "\n\t\t\t\t\t</tr>"; } $discussion_date = $a['discussion_tstamp']; $discussion_date = timestamp2usdate($discussion_date); if ($action == "user") { $sitename = $a['slot_name']; } $page_link = $_full_uri . "/index.php?action=site&site=" . $a['slot_name'] . "&section=" . $a['section_id'] . "&page=" . $a['page_id']; $fullstory_link = $_full_uri . "/index.php?action=site&site=" . $a['slot_name'] . "&section=" . $a['section_id'] . "&page=" . $a['page_id'] . "&story=" . $a['story_id'] . "&detail=" . $a['story_id']; $dicuss_link = $_full_uri . "/index.php?action=site&site=" . $a['slot_name'] . "&section=" . $a['section_id'] . "&page=" . $a['page_id'] . "&story=" . $a['story_id'] . "&detail=" . $a['story_id'] . "#" . $a['discussion_id']; $shory_text_all = strip_tags(urldecode($a['story_text_short'])); $shory_text = substr($shory_text_all, 0, 15) . "..."; $discussion_subject_all = urldecode($a['discussion_subject']); $discussion_subject = substr($discussion_subject_all, 0, 15) . "..."; /****************************************************************************** * Print Participants (depends on curraction * Review: participant name, page > topic, discussion subject, rating, time * User: participant name, site, page > topic, discussion subject, rating, time * List: participant name, email, # of posts, average rating
function printSiteLine2($siteInfo, $ed = 0, $isclass = 0, $atype = 'stud') { // The $ed parameter is a bunch of crap and makes assumptions about // editor permissions that don't exist, such as profs of a class // always being the owner. It should have no effect in this function. global $color, $possible_themes; global $sitesprinted; global $_full_uri; global $cfg; $name = $siteInfo['slot_name']; // printpre($siteInfo); if (in_array($name, $sitesprinted)) { return; } $sitesprinted[] = $name; $exists = $siteInfo['site_exists']; // printpre("exists:".$exists); $namelink = $exists ? "{$PHP_SELF}?{$sid}&action=site&site={$name}" : "{$PHP_SELF}?{$sid}&action=add_site&sitename={$name}"; $namelink2 = $exists ? "{$PHP_SELF}?{$sid}&action=viewsite&site={$name}" : "{$PHP_SELF}?{$sid}&action=add_site&sitename={$name}"; printc("\n\t\t<tr>"); printc("\n\t\t\t<td class='td{$color}' colspan='2'>"); $status = $exists ? "Created" : "Not Created"; if ($exists) { if ($siteInfo['site_active']) { $active = "<span class='green'>active</span>"; } else { $active = "<span class='red'>(inactive)</span>"; } } printc("\n\t\t\t\t<table width='100%' cellpadding='0' cellspacing='0'>\n\t\t\t\t\t<tr>\n\t\t\t\t\t\t<td align='left'>"); if ($isclass && $_SESSION[atype] == 'prof' && (!$exists && (!$siteInfo['slot_owner'] || $_SESSION[auser] == $siteInfo['slot_owner']) || $exists && $_SESSION[auser] == $siteInfo['slot_owner'])) { // if: // isclass - is a class // if it doesn't exist, either there is no owner or we are the owner. // if it exists, the user the owner printc("\n\t\t\t\t\t\t\t<input type='checkbox' name='group[]' value='{$name}' />"); } printc("{$name} - "); if ($exists) { printc("\n\t\t\t\t\t\t\t<span style ='font-size:14px;'><a href='{$namelink}'>" . $siteInfo['site_title'] . "</a></span>"); } else { if (!$siteInfo['slot_owner'] || $_SESSION[auser] == $siteInfo['slot_owner']) { // if the slot doesn't have an owner or we are the owner. if ($_SESSION[atype] == 'prof' && $isclass) { //if ($isclass) { printc("\n\t\t\t\t\t\t\t<span style ='font-size:10px;'>"); if ($cfg['disable_new_sites'] == TRUE && $_SESSION['ltype'] != 'admin') { printc("Create: Site (disabled)"); } else { printc("Create: <a href='{$namelink}'>Site</a> "); } printc("</span>"); } else { if ($cfg['disable_new_sites'] == TRUE && $_SESSION['ltype'] != 'admin') { printc("Create Site (disabled)"); } else { printc("\n\t\t\t\t\t\t\t<span style ='font-size:10px;'><a href='{$namelink}'>Create Sites</a></span>"); } } } else { // if the slot does have an owner that isn't us printc("\n\t\t\t\t\t\t\t<span style ='font-size:10px;'>This site is owned by user \"" . $siteInfo['slot_owner'] . "\". Contact your system administrator if you feel you should own this site.</span>"); } } printc("\n\t\t\t\t\t\t</td>\n\t\t\t\t\t\t<td align='right'>"); printc($active ? "\n\t\t\t\t\t\t\t[{$active}]" : ""); printc("\n\t\t\t\t\t\t</td>\n\t\t\t\t\t</tr>\n\t\t\t\t</table>"); //printc("<div style='padding-left: 20px;'>"); // Class Group printing if ($siteInfo['is_classgroup']) { $classlist = group::getClassesFromName($name); $list = implode(", ", $classlist); printc("\n\t\t\t\t<div style='padding-left: 20px; font-size: 10px;'>this is a group and contains the following classes: <b>{$list}</b><br />\n\t\t\t\t</div>"); $sitesprinted = array_merge($sitesprinted, $classlist); } if ($exists) { $addedby = $siteInfo['site_addedby']; /* $viewpermissions=$a[viewpermissions]; */ $added = timestamp2usdate($siteInfo['site_added_timestamp']); $edited = $siteInfo['site_edited_timestamp']; $editedby = $siteInfo['site_editedby']; printc("\n\t\t\t\t<div style='padding-left: 20px; font-size: 10px;'>added by {$addedby} on {$added}" . ($editedby ? ", edited on " . timestamp2usdate($edited) : "") . "<br />\n\t\t\t\t</div>"); if (!ereg("^0000", $siteInfo['activatedate']) || !ereg("^0000", $siteInfo['deactivatedate'])) { printc("\n\t\t\t\t<div style='padding-left: 20px; font-size: 10px;'>available: "); printc(txtdaterange($siteInfo['activatedate'], $siteInfo['deactivatedate'])); printc("\n\t\t\t\t</div>"); } printc("\n\t\t\t\t<div align='left'>"); $addr = "{$_full_uri}/sites/{$name}"; printc("\n\t\t\t\t\t<div style='padding-left: 20px; font-size: 12px;'>\n\t\t\t\t\t\tURL: <a href='{$addr}' target='_blank'>{$addr}</a><br />\n\t\t\t\t\t</div>\n\t\t\t\t</div>"); printc("\n\t\t\t\t<div align='right'>"); if ($_SESSION[auser] == $siteInfo['slot_owner'] || $siteInfo['hasPermissionDownA'] || $siteInfo['hasPermissionDownE'] || $siteInfo['hasPermissionDownD']) { // if the user is an editor or the owner printc("\n\t\t\t\t\t <a href='{$PHP_SELF}?{$sid}&action=viewsite&site={$name}'>edit</a> | "); } if ($_SESSION[auser] == $siteInfo['slot_owner'] || $siteInfo['hasSitePermissionA'] && $siteInfo['hasSitePermissionE'] && $siteInfo['hasSitePermissionD']) { // if the user is the owner or a site-level editor... printc("\n\t\t\t\t\t <a href='{$PHP_SELF}?{$sid}&action=edit_site&sitename={$name}'>settings</a> | "); } if ($_SESSION[auser] == $siteInfo['slot_owner']) { // if the user is the owner, not an editor printc("\n\t\t\t\t\t <a href='{$PHP_SELF}?{$sid}&action=delete_site&name={$name}'>delete</a> | "); printc("\n\t\t\t\t\t <a href='edit_permissions.php?{$sid}&site={$name}' onclick='doWindow(\"permissions\",600,400)' target='permissions'>permissions</a>"); } else { if (($siteInfo['hasPermissionDownA'] || $siteInfo['hasPermissionDownE'] || $siteInfo['hasPermissionDownD']) && $_SESSION[auser] != $siteInfo['slot_owner']) { // if the user is an editor printc("\n\t\t\t\t\t <a href='edit_permissions.php?{$sid}&site={$name}' onclick='doWindow(\"permissions\",600,400)' target='permissions'>your permissions</a>"); } } if ($isclass && $_SESSION[atype] == 'prof') { printc(" |\n\t\t\t\t\t <a href=\"Javascript:sendWindow('addstudents',500,400,'add_students.php?{$sid}&name=" . $name . "')\">students</a> \n"); } printc("\n\t\t\t\t</div>"); } printc("\n\t\t\t</td>\n\t\t</tr>"); // check for an associated site slot and whether an associated site has been created for the current user $assoc_siteinfo = associatedSiteCreated($_SESSION[auser], $name); $assoc_site_title = $assoc_siteinfo['site_title']; if ($assoc_site_title != "") { printSiteLine2($assoc_siteinfo, 0, 0); $studentSitesColor = 1 - $studentSitesColor; } else { if (associatedSiteExists($_SESSION[auser], $className) == "true") { $studentSitesColor = 1 - $studentSitesColor; printc("\n\t\t\t\t</tr><tr>\n\t\t\t\t\t<td class='td{$studentSitesColor}' width='150'>" . $siteInfo['slot_name'] . "-" . $_SESSION[auser] . "</td>"); if ($cfg['disable_new_sites'] == TRUE && $_SESSION['ltype'] != 'admin') { printc("Create: Site (disabled)"); } else { printc("\n\t\t\t\t\t<td align='left' class='td{$studentSitesColor}'>Create: <a href='{$PHP_SELF}?{$sid}&action=add_site&sitename=" . $siteInfo['slot_name'] . "-" . $_SESSION[auser] . "'> Site</a></td>"); } } } $color = 1 - $color; }
function get_versions($story_id, $version_num = 0) { global $dbhost, $dbuser, $dbpass, $dbdb; $versions = array(); if ($version_num == 0) { $where = "FK_parent = '" . addslashes($story_id) . "'"; } else { $where = "\n\t\t\tFK_parent = '" . addslashes($story_id) . "'\n\t\t\tAND\n\t\t\tversion_order = '" . addslashes($version_num) . "'\n\t\t"; } $query = "\n\t\tSELECT\n\t\t\t*\n\t\tFROM\n\t\t\tversion\n\t\tWHERE\n\t\t\t{$where}\t\n\t\tORDER BY\n\t\t\tversion_created_tstamp DESC\n\t"; // printpre($query); //exit; $r = db_query($query); while ($a = db_fetch_assoc($r)) { $version_author = $a[FK_createdby]; $version_authorname = db_get_value("user", "user_fname", "user_id = '" . addslashes($version_author) . "'"); $version_created = timestamp2usdate($a[version_created_tstamp]); $version[FK_createdby] = $version_authorname; $version[version_order] = $a[version_order]; $version[version_created_tstamp] = $version_created; $version[version_text_short] = $a[version_text_short]; $version[version_text_long] = $a[version_text_long]; $version[version_comments] = $a[version_comments]; $version[version_id] = $a[version_id]; // New for export: $version['author_uname'] = trim(db_get_value("user", "user_uname", "user_id = '" . addslashes($version_author) . "'")); $version['create_time_stamp'] = $a['version_created_tstamp']; $versions[] = $version; } return $versions; }
function _output($cr, $o) { global $sid, $error, $showallauthors, $showposts, $uploadurl, $site_owner, $_full_uri; $siteOwnerId = db_get_value("user", "user_id", "user_uname='" . addslashes($site_owner) . "'"); $parentAuthorId = db_get_value("discussion", "FK_author", "discussion_id='" . addslashes($this->parentid) . "'"); //print $siteOwnerId; //printc("author=".$parentAuthorId); $siteObj =& $this->storyObj->owningSiteObj; $siteLevelEditors = $siteObj->getSiteLevelEditors(); $isSiteEditor = in_array($_SESSION[auser], $siteLevelEditors); if ($showposts == 1 || ($_SESSION[auser] == $this->authoruname || $o == 1 || $isSiteEditor || $site_owner == $this->authoruname && $_SESSION[aid] == $parentAuthorId && $_SESSION[auser] || in_array($this->authoruname, $siteLevelEditors) && $_SESSION[aid] == $parentAuthorId && $_SESSION[auser])) { // check to see if we have any info to commit $this->_commithttpdata(); if ($_REQUEST['discuss'] == 'edit' && $_REQUEST['id'] == $this->id) { $this->_outputform('edit'); return true; } if ($_REQUEST['discuss'] == 'del' && $_REQUEST['id'] == $this->id) { $this->_del(); return true; } if ($_REQUEST['discuss'] == 'rate' && $_REQUEST['id'] == $this->id) { $this->_outputform('rate'); return true; } //$script = $_SERVER['SCRIPT_NAME']; /****************************************************************************** * Outputs html for displaying posts * outputs discussion post info ******************************************************************************/ if (!$this->id) { return false; } printc("\n<tr>"); $s = "<a href='" . $_full_uri . "/index.php?{$sid}&action=site&" . $this->getinfo . "&expand=" . $this->id . "' name='" . $this->id . "'>" . $this->subject . "</a>\n"; // printc ("</form>"); // $s = $this->subject; //printpre($_SESSION); $a = ""; if ($showallauthors == 1 || $_SESSION[auser] && ($o || $_SESSION[auser] == $this->authoruname || $site_owner == $this->authoruname && $_SESSION[aid] == $parentAuthorId)) { if ($this->opt("showauthor")) { $a .= "by <span class='subject'>" . $this->authorfname . "</span>\n"; } if ($this->opt("showauthor") && $this->opt("showtstamp")) { $a .= " on "; } } else { $a .= "posted on "; } if ($this->opt("showtstamp")) { $a .= timestamp2usdate($this->tstamp); } // Wiki-markup example global $storyObj; $a .= WikiResolver::getMarkupExample($storyObj->getField("title"), $this->id); /****************************************************************************** * collect possible actions to current post (rely | del | edit | rate) ******************************************************************************/ $b = array(); if ($cfg['disable_discussion'] != TRUE && ($cfg['disable_discussion'] != TRUE && $_SESSION['ltype'] == 'admin')) { if ($cr) { $b[] = "<a href='" . $_full_uri . "/index.php?{$sid}" . $this->getinfo . "&replyto=" . $this->id . "&action=site&discuss=reply#reply'>reply</a>\n"; } if ($o || $_SESSION[auser] == $this->authoruname && !$this->dbcount()) { $b[] = "| <a href='" . $_full_uri . "/index.php?{$sid}" . $this->getinfo . "&action=site&discuss=del&id=" . $this->id . "'>delete</a>\n"; } if ($_SESSION[auser] == $this->authoruname && !$this->dbcount()) { $b[] = " | <a href='" . $_full_uri . "/index.php?{$sid}" . $this->getinfo . "&id=" . $this->id . "&action=site&discuss=edit#" . $this->id . "'>edit</a>\n"; } if ($o) { $ratelink = "<a href='" . $_full_uri . "/index.php?{$sid}" . $this->getinfo . "&id=" . $this->id . "&action=site&discuss=rate#" . $this->id . "'>rate</a>\n"; } } /****************************************************************************** * if there are dicussion actions (reply | del | edit | rate) then print ******************************************************************************/ if ($a != "" || count($b)) { $c = ''; if (count($b)) { $c .= implode(" ", $b); } /****************************************************************************** * discussion post header info (subject=$s, author and timestamp=$a, options=$c) ******************************************************************************/ //printc ("<table width='100%' cellspacing='0px'>\n"); printc("\n<td class='dheader3'>\n"); printc("<table width='100%' cellspacing='0px'>\n"); printc("<tr><td align='left'>\n"); printc("<span class='subject'>\n"); // subject printc($s); // rating if ($this->rating !== NULL) { printc(" (Rating: " . $this->rating . ")"); } printc("</span></td>\n"); // link for rating printc("<td align='right'>{$ratelink}</td>\n"); printc("</tr><tr>\n"); printc("<td>{$a}\n"); printc("</td>\n"); printc("<td align='right' valign='bottom'>{$c}</td>"); printc("</tr>\n</table>\n"); /****************************************************************************** * if there are no dicussion actions (rely | del | edit | rate) then * print subject only ******************************************************************************/ } else { printc($s); } printc("</td></tr>"); /****************************************************************************** * print discussion post content ******************************************************************************/ if ($this->opt("showcontent")) { printc("<tr><td class='dtext'>"); if ($this->media_tag) { $media_link = "<a href='" . $uploadurl . "/" . $_REQUEST[site] . "/" . $this->media_tag . "' target='media'>" . $this->media_tag . "</a>\n"; $mediaRow[media_tag] = $this->media_tag; $mediaRow[slot_name] = $_REQUEST[site]; $mediaRow[media_size] = $this->media_size; $audioplayer = printMediaPlayer($mediaRow); $downloadlink = printDownloadLink($mediaRow); // $citation = printCitation($mediaRow); // if attached file is an .mp3 print out audio player if ($audioplayer) { printc("<table width='100%' cellpadding='2' border='0'>"); printc("<tr><td>"); printc($downloadlink . "\n"); printc($audioplayer . "\n"); // printc ("<div style='clear: left; font-size: smaller; margin-bottom: 10px; '>"); // printc ($citation."\n"); // printc ("</div>"); printc("</td></tr>"); printc("</table>"); // if attached file not .mp3 print out download link only } else { printc("<table width='100%' cellpadding='2' border='0'>"); printc("<tr><td>"); printc("<div style='clear: left; float: left; '>{$media_link}</div>\n"); printc($downloadlink . "\n"); printc("</td></tr>"); printc("</table>"); } } $content = convertTagsToInteralLinks($_REQUEST[site], stripslashes($this->content)); $wikiResolver =& WikiResolver::instance(); $content = $wikiResolver->parseText($content, $_REQUEST[site], $_REQUEST[section], $_REQUEST[page]); printc("<div style='clear: both;'>\n"); printc($content); printc("</div>\n"); //printc ("- [ $c]</td></tr>\n"); //printc ("<tr><td align='right'>$c</td></tr>\n"); } // done // now check if we're replying to this post if ($_REQUEST['discuss'] == 'reply' && $_REQUEST['replyto'] == $this->id) { $this->_outputform('reply'); } //if ($_REQUEST['discuss'] == 'rate' && $_REQUEST['replyto'] == $this->id) $this->_outputform('rate'); printc("</td></tr>"); } }
function printContentItem($result, $type, &$siteObj, $search = "") { global $_full_uri, $site_owner; $foundSection =& new section($_REQUEST[site], $result['section_id'], $siteObj); $foundPage =& new page($_REQUEST[site], $result['section_id'], $result['page_id'], $foundSection); $foundContent =& new story($_REQUEST[site], $result['section_id'], $result['page_id'], $result['story_id'], $foundPage); if ($foundSection->canview() && $foundPage->canview() && $foundContent->canview() || $_SESSION[auser] == $site_owner) { ob_start(); print "\n\t<tr>"; $record_tag_tstamp = timestamp2usdate($result[story_updated_tstamp]); //if ($record_tag_tstamp != '0000-00-00 00:00:00') { //$record_tag_tstamp =& TimeStamp::fromString($record_tag_tstamp); //$record_tag_time =& $record_tag_tstamp->asTime(); //print "<td valign='top' class='listtext'>".$record_tag_tstamp->ymdString()."<br/>".$record_tag_time->string12(false)."</td>"; // print "<td valign='top' class='listtext'>".$record_tag_tstamp."</td>"; print "\n\t\t<td valign='top'><a href='" . $_full_uri . "/index.php?&action=site&site=" . $_REQUEST[site]; print "&section=" . $result['section_id']; print "&page=" . $result['page_id']; print "&story=" . $result['story_id']; print "&detail=" . $result['story_id']; if ($type == "discussion") { print "#" . $result['discussion_id']; } print "'>"; print stripslashes(urldecode($result['section_title'])); print " > " . stripslashes(urldecode($result['page_title'])); if ($result['story_title']) { print " > " . stripslashes(urldecode($result['story_title'])); } if ($result['discussion_subject']) { print " > " . stripslashes(urldecode($result['discussion_subject'])); print " (" . $result['user_fname'] . ")"; } print "</a>\n\t\t</td>"; // print "<tr><td valign='top' class='contentinfo'>added by".$result['user_fname']." on ".$record_tag_tstamp."</td>"; print "\n\t</tr>"; print "\n\t\t<tr>"; print "\n\t\t\t<td class='list' valign='top'>"; if ($type == "content") { $content = stripslashes(urldecode($result['story_text_short'])); $content .= stripslashes(urldecode($result['story_text_long'])); } else { if ($type == "discussion") { $content = stripslashes(urldecode($result['discussion_content'])); } } $wikiResolver =& WikiResolver::instance(); $content = $wikiResolver->parseText($content, $_REQUEST[site], $result['section_id'], $result['page_id']); $content = find_abstract($content, $search); if ($type != "page" && $type != "section") { print $content; } print "\n\t\t</td>"; print "\n\t</tr>"; //} $contentItem = ob_get_clean(); printc($contentItem); } }
} printc("</div>\n"); } $siteType = preg_replace('/[^a-z0-9_-]/i', '', $thisSite->getField("type")); $oType = preg_replace('/[^a-z0-9_-]/i', '', $o->getField("type")); $incfile = "output_modules/" . $siteType . "/" . $oType . ".inc.php"; /* print "<br />".$incfile; */ include $incfile; /****************************************************************************** * author, editor, timestamp info ******************************************************************************/ if ($thisPage->getField("showcreator") || $thisPage->getField("showeditor") || $thisPage->getField("showdate") || $thisPage->getField("showversions")) { $linksAddedSoFar = false; printc("<div class='contentinfo' align='right'>"); $added = timestamp2usdate($o->getField("addedtimestamp")); $edited = timestamp2usdate($o->getField("editedtimestamp")); // if show date but not creator if ($thisPage->getField("showdate") && !$thisPage->getField("showcreator") && !$o->getField("editedtimestamp")) { printc(" added on {$added}"); $linksAddedSoFar = true; } else { if ($thisPage->getField("showdate") && (!$thisPage->getField("showcreator") && !$thisPage->getField("showeditor")) && $o->getField("editedtimestamp")) { printc(" updated on {$edited}"); $linksAddedSoFar = true; // if show date and creator/editor } else { if ($thisPage->getField("showdate") && ($thisPage->getField("showcreator") || $thisPage->getField("showeditor"))) { if ($thisPage->getField("showcreator") && $thisPage->getField("showeditor") == $thisPage->getField("showcreator") && $o->getField("editedtimestamp")) { printc("updated by " . $o->getField("editedbyfull") . " on {$edited}"); } else { if ($thisPage->getField("showcreator") && !$o->getField("editedtimestamp")) {
printc("</tr>"); printc("</table>"); printc("</td>"); printc("</tr>"); printc("<tr>"); printc("<th>time last modified</th>"); // printc("<th>site</th>"); printc("<th>title</th>"); printc("<th>owner</th>"); printc("</tr>"); $color = 0; if (db_num_rows($r)) { while ($a = db_fetch_assoc($r)) { printc("<tr>"); printc("<td class='td{$color}'><span style='white-space: nowrap;'>"); $time = timestamp2usdate($a[editedtimestamp], 1); printc("{$time}"); printc("</span></td>"); // printc("<td class='td$color'>$a[name]</td>"); printc("<td class='td{$color}'>"); printc("<a href=\"index.php?{$sid}&action=site&site={$a['name']}\"'>"); printc("{$a['title']}"); printc("</a>"); printc("</td>"); printc("<td class='td{$color}'>"); printc("{$a['addedby']}"); printc("</td>"); printc("</tr>"); $color = 1 - $color; } } else {
print "\n\t\t<tr>"; print "\n\t\t\t<td class='td{$color}' style='white-space: nowrap; color: #"; if (strstr("add_site, delete_site, classgroups", $a[log_type])) { print "F90"; } else { if (strstr("login, change_auser", $a[log_type])) { print "000"; } else { print "00C"; } } print "'>"; if (strncmp($today, $a[log_tstamp], 8) == 0 || strncmp($yesterday, $a[log_tstamp], 8) == 0) { print "<b>"; } print timestamp2usdate($a[log_tstamp], 1); if (strncmp($today, $a[log_tstamp], 8) == 0 || strncmp($yesterday, $a[log_tstamp], 8) == 0) { print "</b>"; } print "</td>"; print "\n\t\t\t<td class='td{$color}' style='color: #"; if (strstr("add_site, delete_site, classgroups", $a[log_type])) { print "F90"; } else { if (strstr("login, change_auser", $a[log_type])) { print "000"; } else { print "00C"; } } print "'>{$a['log_type']}</td>";
print "<td align='center'>" . ($sa[active] ? "yes" : "no") . "</td>"; print "<td align='center'>" . ($pa[locked] ? "yes" : "no") . "</td>"; print "<td align='center'>"; if ($pa[type] == 'page') { print "<a href='#' onclick='opener.window.location=\"index.php?{$sid}&action=viewsite&site={$site}&section={$s}&page={$p}\"'>[view]</a>"; } print "</td>"; print "</tr>"; print "<tr>"; print "<td colspan='5' class='pad2'>"; $addedby = $pa[addedby]; $viewpermissions = $pa[viewpermissions]; $added = timestamp2usdate($pa[addedtimestamp]); $edited = $pa[editedtimestamp]; $editedby = $pa[editedby]; print "added by <i>{$addedby}</i> on {$added}" . ($editedby ? ", edited by <i>{$editedby}</i> on " . timestamp2usdate($edited) : ""); print "</td>"; print "</tr>"; print "<tr>"; print "<td class='pad2' colspan='5'>"; if ($pa[type] == 'page') { print "# stories: {$nums} ({$nlocked} locked)"; } if ($pa[type] == 'url') { print "url: <i>{$pa['url']}</i>"; } print "</td></tr>"; } } } else { print "<tr><td colspan='5'>No sections.</td></tr>";