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


PHP Publication::getDefaultLanguageId方法代碼示例

本文整理匯總了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;
 }
開發者ID:nidzix,項目名稱:Newscoop,代碼行數:25,代碼來源:ShortURL.php

示例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");

?>
開發者ID:nistormihai,項目名稱:Newscoop,代碼行數:31,代碼來源:do_del.php

示例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);
 }
開發者ID:alvsgithub,項目名稱:Newscoop,代碼行數:19,代碼來源:CampSystem.php


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