本文整理汇总了PHP中Publication::getDefaultLanguageId方法的典型用法代码示例。如果您正苦于以下问题:PHP Publication::getDefaultLanguageId方法的具体用法?PHP Publication::getDefaultLanguageId怎么用?PHP Publication::getDefaultLanguageId使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Publication
的用法示例。
在下文中一共展示了Publication::getDefaultLanguageId方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: GetURL
public static function GetURL($p_publicationId, $p_languageId = null, $p_issueNo = null, $p_sectionNo = null, $p_articleNo = NULL, $p_port = null)
{
global $g_ado_db;
global $_SERVER;
if (is_null($p_port)) {
if (!isset($_SERVER['SERVER_PORT'])) {
$_SERVER['SERVER_PORT'] = 80;
}
$p_port = $_SERVER['SERVER_PORT'];
}
$publicationObj = new Publication($p_publicationId);
if (!$publicationObj->exists()) {
return new PEAR_Error(getGS('Publication does not exist.'));
}
if (!isset($p_languageId)) {
$p_languageId = $publicationObj->getDefaultLanguageId();
}
$scheme = $_SERVER['SERVER_PORT'] == 443 ? 'https://' : 'http://';
$defaultAlias = new Alias($publicationObj->getDefaultAliasId());
$uri = ShortURL::GetURI($p_publicationId, $p_languageId, $p_issueNo, $p_sectionNo, $p_articleNo);
if (!is_string($uri) && PEAR::isError($uri)) {
return $uri;
}
return $scheme . $defaultAlias->getName() . $uri;
}
示例2: Publication
require_once($GLOBALS['g_campsiteDir']. '/classes/Subscription.php');
require_once($GLOBALS['g_campsiteDir']. '/classes/SubscriptionSection.php');
require_once($GLOBALS['g_campsiteDir']. '/classes/Language.php');
require_once($GLOBALS['g_campsiteDir']. '/classes/Publication.php');
require_once($GLOBALS['g_campsiteDir']."/db_connect.php");
if (!SecurityToken::isValid()) {
camp_html_display_error(getGS('Invalid security token!'));
exit;
}
if (!$g_user->hasPermission('ManageSubscriptions')) {
camp_html_display_error(getGS("You do not have the right to delete subscriptions."));
exit;
}
$f_user_id = Input::Get('f_user_id', 'int', 0);
$f_publication_id = Input::Get('f_publication_id', 'int', 0);
$f_language_id = Input::Get('f_language_id', 'int', 0);
$f_subscription_id = Input::Get('f_subscription_id', 'int', 0);
$f_section_number = Input::Get('f_section_number', 'int', 0);
$publicationObj = new Publication($f_publication_id);
$languageObj = new Language($publicationObj->getDefaultLanguageId());
$manageUser = new User($f_user_id);
$subscriptionSection = new SubscriptionSection($f_subscription_id, $f_section_number, $f_language_id);
$subscriptionSection->delete();
camp_html_goto_page("/$ADMIN/users/subscriptions/sections/?f_user_id=$f_user_id&f_subscription_id=$f_subscription_id&f_publication_id=$f_publication_id");
?>
示例3: GetLastIssue
public static function GetLastIssue(Publication $publication, $p_langId = null, $p_isPublished = true)
{
global $g_ado_db;
if (!$publication->exists()) {
return null;
}
if (empty($p_langId)) {
$p_langId = $publication->getDefaultLanguageId();
}
$sql = 'SELECT MAX(Number) AS Number FROM Issues ' . 'WHERE IdPublication = ' . (int) $publication->getPublicationId() . ' AND IdLanguage = ' . (int) $p_langId;
if ($p_isPublished == true) {
$sql .= " AND Published = 'Y'";
}
$issueNo = $g_ado_db->GetOne($sql);
if (empty($issueNo)) {
return null;
}
return array($issueNo, $p_langId);
}