本文整理汇总了PHP中comments::setupLibraries方法的典型用法代码示例。如果您正苦于以下问题:PHP comments::setupLibraries方法的具体用法?PHP comments::setupLibraries怎么用?PHP comments::setupLibraries使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类comments
的用法示例。
在下文中一共展示了comments::setupLibraries方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: array
$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();
示例2: comments
$code = 'Your comment has been posted!';
} else {
$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'];