當前位置: 首頁>>代碼示例>>PHP>>正文


PHP content::getByPermalink方法代碼示例

本文整理匯總了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');
開發者ID:smbale,項目名稱:open-social-media-toolkit,代碼行數:31,代碼來源:readStory.php

示例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');
開發者ID:smbale,項目名稱:open-social-media-toolkit,代碼行數:31,代碼來源:rf.php


注:本文中的content::getByPermalink方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。