Ejemplo n.º 1
0
    $logItem = $logObj->serialize(0, $db->ui->userid, 'readStory', $story->siteContentId);
    // note this is the local contentid
    $logObj->update($logItem);
}
/* begin building the page */
$page->setTitle($story->title);
$page->pkgStyles(CACHE_PREFIX . 'nrStory', array(PATH_PHP_STYLES . '/newsroom.css', PATH_PHP_STYLES . '/tabs.css'));
$page->pkgScripts(CACHE_PREFIX . 'nrStory', array(PATH_PHP_SCRIPTS . '/comments.js', PATH_PHP_SCRIPTS . '/voting.js', PATH_PHP_SCRIPTS . '/journal.js'));
$page->addToHeader($common->buildHeader() . $common->buildNavigation('Read Story'));
$page->addToFooter($common->buildFooter());
$page->addRSSFeed(URL_HOME . '?p=rss');
$code = '';
$code .= '<div id="pageBody">';
$code .= '<div id="pageContent">';
$templateObj->registerTemplates('PHP');
/* fetch story */
$templateObj->db->result = $cObj->getByPermalink($permalink, true);
$templateObj->db->setTemplateCallback('time_since', array($utilObj, 'time_since'), 'date');
$templateObj->db->setTemplateCallback('caption', array($templateObj, 'cleanEllipsis'), 'caption');
$templateObj->db->setTemplateCallback('cmdVote', array($templateObj, 'commandVote'), 'siteContentId');
$templateObj->db->setTemplateCallback('cmdAdd', array($templateObj, 'commandAdd'), 'siteContentId');
$templateObj->db->setTemplateCallback('cmdRead', array($templateObj, 'commandRead'), 'permalink');
$templateObj->db->setTemplateCallback('storyImage', array($templateObj, 'getLargeStoryImage'), 'imageid');
$code .= $templateObj->mergeTemplate($templateObj->templates['readStoryContainer'], $templateObj->templates['readStoryContent']);
// display comments
$commentsObj->setupLibraries();
$code .= $commentsObj->buildComments(true, $story);
$code .= '</div><!-- end pageContent -->';
$code .= '</div><!-- end pageBody -->';
$page->addToContent($code);
$page->display();
Ejemplo n.º 2
0
                     $error = true;
                     $errorMsg = 'Please enter a valid comment.';
                 }
             } else {
                 $error = true;
                 $errorMsg = 'There was a problem posting your comment.';
             }
             break;
         case 'refreshComments':
             if (isset($_GET['siteContentId'])) {
                 $siteContentId = $_GET['siteContentId'];
                 require_once PATH_PHP . 'classes/comments.class.php';
                 $comObj = new comments($db);
                 $comObj->setupLibraries();
                 $story = $comObj->contentObj->getById($siteContentId);
                 $code = $comObj->buildComments(false, $story);
             } else {
                 $code = 'Error finding comment thread';
             }
             break;
     }
     break;
 case 'common':
     define("INIT_SESSION", true);
     include_once 'initialize.php';
     switch ($cmd) {
         case 'recordVote':
             if (isset($_GET['siteContentId'])) {
                 $siteContentId = $_GET['siteContentId'];
                 // record story read by this user
                 if ($db->ui->isLoggedIn) {