Example #1
0
<?php

/* $Id$ */
include "output_modules/common.inc.php";
$t = makedownloadbar($o);
$st = convertTagsToInteralLinks($site, $t);
if ($o->getField("texttype") == 'text') {
    $st = nl2br($st);
}
$wikiResolver =& WikiResolver::instance();
$st = $wikiResolver->parseText($st, $site, $section, $page);
printc($st);
if ($o->getField("discuss")) {
    include dirname(__FILE__) . "/discussionLink.inc.php";
}
Example #2
0
 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');
 print "<description>";
 print $description;
 print "</description>\n";
 //if ($a["FK_media"]) {
 $b = db_get_line("media INNER JOIN slot ON media.FK_site=slot.FK_site", "media_id='" . addslashes($a["FK_media"]) . "'");
 $filename = $b[media_tag];
 $filename = rawurlencode($filename);
 if (ereg("\\.mp3\$", $filename)) {
     $type = "audio/mpeg";
 } else {
     $type = "unknown";
 }
Example #3
0
     //					printpre($site);
     //exit;
     /******************************************************************************
      * RSS type pages
      ******************************************************************************/
 } else {
     if ($o->getField("type") == 'rss') {
         ob_start();
         include_once dirname(__FILE__) . "/carprss/carp.php";
         $rss_url = $o->getField("url");
         $url = "#";
         /******************************************************************************
          * replace general media library urls (i.e. $mediapath/$sitename/filename)
          * replace general with specific
          ******************************************************************************/
         $rss_url = convertTagsToInteralLinks($site, $rss_url);
         //printpre($rss_url);
         $rss_style = "rss_titles";
         $site_match = "site={$site}";
         $page_match = "page={$page}";
         MyCarpConfReset($rss_style);
         /******************************************************************************
          * RSS channel display options
          * if feed from same page, don't display channel link and open items in same window
          * if feed from another page on same site, display channel and open in same window
          * all other feeds display channel link and open in new window
          ******************************************************************************/
         if (ereg($site_match, $rss_url)) {
             $carpconf['ilinktarget'] = "_self";
             CarpConf('cborder', '');
             if (ereg($page_match, $rss_url)) {
Example #4
0
// printpre($_REQUEST);
/******************************************************************************
 * if selected versions request, then print out selected versions to compare
 ******************************************************************************/
if ($_REQUEST['oldversion'] && $_REQUEST['newversion']) {
    define('USE_ASSERTS', false);
    require_once 'DiffEngine.php';
    $formatter =& new SegueTableDiffFormatter();
    $version01 = get_versions($_REQUEST['story'], $_REQUEST['oldversion']);
    $version01_num = $version01[0]['version_order'];
    $version02 = get_versions($_REQUEST['story'], $_REQUEST['newversion']);
    $version02_num = $version02[0]['version_order'];
    $smalltext01 = convertTagsToInteralLinks($siteObj->name, stripslashes(urldecode($version01[0]['version_text_short'])));
    $smalltext02 = convertTagsToInteralLinks($siteObj->name, stripslashes(urldecode($version02[0]['version_text_short'])));
    $fulltext01 = convertTagsToInteralLinks($siteObj->name, stripslashes(urldecode($version01[0]['version_text_long'])));
    $fulltext02 = convertTagsToInteralLinks($siteObj->name, stripslashes(urldecode($version02[0]['version_text_long'])));
    //	printpre($version01);
    //printpre($version02);
    printc("<tr><td style='padding-bottom: 15px; font-size: 12px'>");
    ob_start();
    print "\n<tr>";
    print "\n\t<th>";
    print "<a href='index.php?{$sid}&amp;action=" . $action . "&amp;site=" . $_REQUEST['site'] . "&amp;section=" . $_REQUEST['section'] . "&amp;page=" . $_REQUEST['page'] . "&amp;story=" . $_REQUEST['story'] . "&amp;version=" . $version01_num . "'>Revision " . $version01_num . "</a> ";
    print "<span class='timestamp'>";
    print "(" . $version01[0]['version_created_tstamp'] . " - " . $version01[0]['FK_createdby'] . ")\n";
    print "</span>";
    print "</th>";
    print "\n\t<th>";
    print "<a href='index.php?{$sid}&amp;action=" . $action . "&amp;site=" . $_REQUEST['site'] . "&amp;section=" . $_REQUEST['section'] . "&amp;page=" . $_REQUEST['page'] . "&amp;story=" . $_REQUEST['story'] . "&amp;version=" . $version02_num . "'>Revision " . $version02_num . "</a> ";
    print "<span class='timestamp'>";
    print "(" . $version02[0]['version_created_tstamp'] . " - " . $version02[0]['FK_createdby'] . ")\n";
Example #5
0
    }
    if ($_REQUEST[themepreview]) {
        $sid .= "&amp;themepreview=1";
    }
    if (!isset($theme)) {
        $theme = $thisSite->getField("theme");
    }
    if (!isset($themesettings)) {
        $themesettings = $thisSite->getField("themesettings");
    }
    $siteheader = "<div align='center' style='margin-bottom: 3px'>";
    /******************************************************************************
     * replace general media library urls (i.e. $mediapath/$sitename/filename)
     ******************************************************************************/
    $mod_header = convertTagsToInteralLinks($_REQUEST[site], $thisSite->getField("header"));
    $mod_footer = convertTagsToInteralLinks($_REQUEST[site], $thisSite->getField("footer"));
    $siteheader .= $mod_header;
    //$siteheader .= $thisSite->getField("header");
    $siteheader .= "</div>";
    $sitefooter = "<center>";
    $sitefooter .= $mod_footer;
    //$sitefooter .= $thisSite->getField("footer");
    $sitefooter .= "</center>";
}
if ($_REQUEST[section]) {
    //	$thisSection =& new section($thisSite->name,$_REQUEST[section],&$thisSite);
    $thisSection =& $thisSite->sections[$_REQUEST[section]];
    //	$thisSection->fetchFromDB();
    //	$thisSection->buildPermissionsArray();
}
if ($_REQUEST[page]) {
Example #6
0
 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}&amp;action=site&amp;" . $this->getinfo . "&amp;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 . "&amp;replyto=" . $this->id . "&amp;action=site&amp;discuss=reply#reply'>reply</a>\n";
             }
             if ($o || $_SESSION[auser] == $this->authoruname && !$this->dbcount()) {
                 $b[] = "| <a href='" . $_full_uri . "/index.php?{$sid}" . $this->getinfo . "&amp;action=site&amp;discuss=del&amp;id=" . $this->id . "'>delete</a>\n";
             }
             if ($_SESSION[auser] == $this->authoruname && !$this->dbcount()) {
                 $b[] = " | <a href='" . $_full_uri . "/index.php?{$sid}" . $this->getinfo . "&amp;id=" . $this->id . "&amp;action=site&amp;discuss=edit#" . $this->id . "'>edit</a>\n";
             }
             if ($o) {
                 $ratelink = "<a href='" . $_full_uri . "/index.php?{$sid}" . $this->getinfo . "&amp;id=" . $this->id . "&amp;action=site&amp;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>");
     }
 }
Example #7
0
    $fulltext = $wikiResolver->parseText($fulltext, $site, $section, $page);
    if ($storyObj->getField("texttype") == 'text') {
        $fulltext = htmlbr($fulltext);
    }
    if ($storyObj->getField("texttype") == 'text') {
        $smalltext = htmlbr($smalltext);
    }
} else {
    if ($storyObj->getField("type") == 'image') {
        $filename = urldecode(db_get_value("media", "media_tag", "media_id='" . addslashes($storyObj->getField("longertext")) . "'"));
        $dir = db_get_value("media INNER JOIN slot ON media.FK_site = slot.FK_site", "slot_name", "media_id='" . addslashes($storyObj->getField("longertext")) . "'");
        $imagepath = "{$uploadurl}/{$dir}/{$filename}";
        $fulltext = "\n<div style='text-align: center'><br /><img src='{$imagepath}' border='0' /></div>";
        /* 	if ($story->getField("title")) $fulltext .= "<tr><td align='center'><b>".spchars($story->getField("title"))."</b></td></tr>"; */
        if ($storyObj->getField("shorttext")) {
            $captiontext = $st = convertTagsToInteralLinks($site, $storyObj->getField("shorttext"));
            $captiontext = "<br />" . stripslashes($captiontext);
        }
        $fulltext .= "";
    } else {
        if ($storyObj->getField("type") == 'file') {
            $fulltext = "<br />";
            $fulltext .= makedownloadbar($storyObj);
        } else {
            $fulltext = "<br />";
            $siteType = preg_replace('/[^a-z0-9_-]/i', '', $siteObj->getField("type"));
            $storyType = preg_replace('/[^a-z0-9_-]/i', '', $storyObj->getField("type"));
            $incfile = "output_modules/" . $siteType . "/" . $storyType . ".inc.php";
            //	print $incfile; // debug
            include $incfile;
            $fulltext .= $content;