本文整理汇总了PHP中content::getByPermalink方法的典型用法代码示例。如果您正苦于以下问题:PHP content::getByPermalink方法的具体用法?PHP content::getByPermalink怎么用?PHP content::getByPermalink使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类content
的用法示例。
在下文中一共展示了content::getByPermalink方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: content
$cObj = new content($db);
require_once PATH_CORE . '/classes/template.class.php';
$templateObj = new template($db);
require_once PATH_CORE . '/classes/utilities.class.php';
$utilObj = new utilities($db);
require_once PATH_PHP . '/classes/comments.class.php';
$commentsObj = new comments($db);
/* process request variables */
if (isset($_GET['permalink'])) {
$permalink = $_GET['permalink'];
} else {
// go to 404 error page
header("Location: " . URL_ROOT);
exit;
}
$story = $cObj->getByPermalink($permalink);
// record story read by this user
if ($db->ui->isLoggedIn) {
require_once PATH_CORE . '/classes/log.class.php';
$logObj = new log(&$db);
$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');
示例2: content
$cObj = new content($db);
require_once PATH_CORE . '/classes/template.class.php';
$templateObj = new template($db);
require_once PATH_CORE . '/classes/utilities.class.php';
$utilObj = new utilities($db);
require_once PATH_PHP . '/classes/comments.class.php';
$commentsObj = new comments($db);
/* process request variables */
if (isset($_GET['permalink'])) {
$permalink = $_GET['permalink'];
} else {
// go to 404 error page
header("Location: " . URL_ROOT);
exit;
}
$story = $cObj->getByPermalink($permalink);
// record story read by this user
/* if ($db->ui->isLoggedIn) {
require_once(PATH_CORE.'/classes/log.class.php');
$logObj=new log(&$db);
$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('');
$code = buildTop($story->url);
$page->addToFooter('');
//$page->addRSSFeed(URL_HOME.'?p=rss');