当前位置: 首页>>代码示例>>PHP>>正文


PHP Publication::getDefaultAliasId方法代码示例

本文整理汇总了PHP中Publication::getDefaultAliasId方法的典型用法代码示例。如果您正苦于以下问题:PHP Publication::getDefaultAliasId方法的具体用法?PHP Publication::getDefaultAliasId怎么用?PHP Publication::getDefaultAliasId使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Publication的用法示例。


在下文中一共展示了Publication::getDefaultAliasId方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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: getGS

	if (!$issueObj->exists())
		$errorStr = getGS('There was an error reading the issue parameter.');
}
if ($errorStr == "" && ($templateId = $issueObj->getIssueTemplateId()) == 0)
	$errorStr = 'This issue cannot be previewed. Please make sure it has the front page template selected.';

if ($errorStr != "") {
	camp_html_display_error($errorStr, null, true);
}

if (!isset($_SERVER['SERVER_PORT']))
{
	$_SERVER['SERVER_PORT'] = 80;
}
$scheme = $_SERVER['SERVER_PORT'] == 443 ? 'https://' : 'http://';
$siteAlias = new Alias($publicationObj->getDefaultAliasId());
$websiteURL = $scheme.$siteAlias->getName();

$accessParams = "LoginUserId=" . $g_user->getUserId() . "&LoginUserKey=" . $g_user->getKeyId()
				. "&AdminAccess=all";
$urlType = $publicationObj->getProperty('IdURLType');
if ($urlType == 1) {
	$templateObj = new Template($templateId);
	$url = "$websiteURL"  . $Campsite['SUBDIR'] . "/tpl/" . $templateObj->getName()
		. "?IdLanguage=$Language&IdPublication=$Pub&NrIssue=$Issue&$accessParams";
} else {
	$url = "$websiteURL" . $Campsite['SUBDIR'] . '/' . $languageObj->getCode()
		. "/" . $issueObj->getUrlName() . "?$accessParams";
}

$selectedLanguage = (int)CampRequest::GetVar('Language');
开发者ID:nistormihai,项目名称:Newscoop,代码行数:31,代码来源:preview.php

示例3: putGS

?>
<TABLE BORDER="0" CELLSPACING="1" CELLPADDING="3" class="table_list">
<TR class="table_list_header">
	<TD ALIGN="LEFT" VALIGN="TOP"  ><B><?php  putGS("Alias (click to edit)"); ?></B></TD>
	<?php if ($g_user->hasPermission("ManagePub")) { ?>
	<TD ALIGN="LEFT" VALIGN="TOP"><B><?php  putGS("Delete"); ?></B></TD>
	<?php } ?>
</TR>
<?php
foreach ($aliases as $alias) {  ?>
	<TR <?php  if ($color) { $color=0; ?>class="list_row_even"<?php  } else { $color=1; ?>class="list_row_odd"<?php  } ?>>
		<TD>
			<?php if ($g_user->hasPermission("ManagePub")) { ?><A HREF="/<?php p($ADMIN); ?>/pub/edit_alias.php?Pub=<?php p($Pub); ?>&Alias=<?php p($alias->getId()); ?>"><?php } ?><?php  p(htmlspecialchars($alias->getName())); ?><?php if ($g_user->hasPermission("ManagePub")) { ?></A><?php } ?>
		</TD>
		<?php if ($g_user->hasPermission("ManagePub")) { ?>
		<TD ALIGN="CENTER">
			<?php
			if ($publicationObj->getDefaultAliasId() != $alias->getId()) { ?>
			<A HREF="/<?php p($ADMIN); ?>/pub/do_del_alias.php?Pub=<?php p($Pub); ?>&Alias=<?php p($alias->getId()); ?>&<?php echo SecurityToken::URLParameter(); ?>" onclick="return confirm('<?php putGS('Are you sure you want to delete the alias $1?', $alias->getName()); ?>');"><IMG SRC="<?php echo $Campsite["ADMIN_IMAGE_BASE_URL"]; ?>/delete.png" BORDER="0" ALT="<?php  putGS('Delete alias $1', htmlspecialchars($alias->getName())); ?>" TITLE="<?php  putGS('Delete alias $1', htmlspecialchars($alias->getName())); ?>" ></A>
			<?php } ?>
		</TD>
		<?php } ?>
	</TR>
<?php
}
?>

</TABLE>

<?php camp_html_copyright_notice(); ?>
开发者ID:nistormihai,项目名称:Newscoop,代码行数:30,代码来源:aliases.php

示例4: array

}
// Check permissions
if (!$g_user->hasPermission('ManagePub')) {
    camp_html_display_error($translator->trans("You do not have the right to manage publications.", array(), 'pub'));
    exit;
}
$Pub = Input::Get('Pub', 'int', 0);
$Alias = Input::Get('Alias', 'int', 0);
if (!Input::IsValid()) {
    camp_html_display_error($translator->trans('Invalid input: $1', array('$1' => Input::GetErrorString())), $_SERVER['REQUEST_URI']);
    exit;
}
$publicationObj = new Publication($Pub);
$aliasObj = new Alias($Alias);
$errorMsgs = array();
if ($publicationObj->getDefaultAliasId() != $Alias) {
    $aliasName = $aliasObj->getName();
    $deleted = $aliasObj->delete();
    $cacheService = \Zend_Registry::get('container')->getService('newscoop.cache');
    $cacheService->clearNamespace('publication');
    if ($deleted) {
        camp_html_goto_page("/{$ADMIN}/pub/aliases.php?Pub={$Pub}");
    } else {
        $errorMsgs[] = $translator->trans('The alias $1 could not be deleted.', array('$1' => '<B>' . $aliasObj->getName() . '</B>'), 'pub');
    }
} else {
    $errorMsgs[] = $translator->trans('$1 is the default publication alias, it can not be deleted.', array('$1' => '<B>' . $aliasObj->getName() . '</B>'), 'pub');
}
$crumbs = array($translator->trans("Publication Aliases", array(), 'pub') => "aliases.php?Pub={$Pub}");
camp_html_content_top($translator->trans("Deleting alias", array(), 'pub'), array("Pub" => $publicationObj), true, false, $crumbs);
?>
开发者ID:sourcefabric,项目名称:newscoop,代码行数:31,代码来源:do_del_alias.php

示例5: array

    exit;
}
$backLink = "/{$ADMIN}/pub/edit.php?Pub={$f_publication_id}";
$errorMsgs = array();
$updated = false;
if (empty($f_name)) {
    camp_html_add_msg(getGS('You must fill in the $1 field.', '<B>' . getGS('Name') . '</B>'));
}
if (empty($f_default_alias)) {
    camp_html_add_msg(getGS('You must fill in the $1 field.', '<B>' . getGS('Site') . '</B>'));
}
$publicationObj = new Publication($f_publication_id);
if (!$publicationObj->exists()) {
    camp_html_add_msg(getGS('Publication does not exist.'));
}
if ($f_default_alias != $publicationObj->getDefaultAliasId()) {
    camp_is_alias_conflicting($f_default_alias);
}
if ($f_name != $publicationObj->getName()) {
    camp_is_publication_conflicting($f_name);
}
if (camp_html_has_msgs()) {
    camp_html_goto_page($backLink);
}
//$publicationObj->setPublicComments($f_comments_public_enabled);
$columns = array('Name' => $f_name, 'IdDefaultAlias' => $f_default_alias, 'IdDefaultLanguage' => $f_language, 'IdURLType' => $f_url_type, 'TimeUnit' => $f_time_unit, 'PaidTime' => $f_paid, 'TrialTime' => $f_trial, 'UnitCost' => $f_unit_cost, 'UnitCostAllLang' => $f_unit_cost_all_lang, 'Currency' => $f_currency, 'comments_enabled' => $f_comments_enabled, 'comments_article_default_enabled' => $f_comments_article_default, 'comments_subscribers_moderated' => $f_comments_subscribers_moderated, 'comments_public_moderated' => $f_comments_public_moderated, 'comments_public_enabled' => $f_comments_public_enabled, 'comments_captcha_enabled' => $f_comments_captcha_enabled, 'comments_spam_blocking_enabled' => $f_comments_spam_blocking_enabled, 'comments_moderator_to' => $f_comments_moderator_to, 'comments_moderator_from' => $f_comments_moderator_from, 'seo' => serialize($f_seo));
$updated = $publicationObj->update($columns);
if ($updated) {
    camp_html_add_msg(getGS("Publication updated"), "ok");
} else {
    $errorMsg = getGS('The publication information could not be updated.');
开发者ID:nidzix,项目名称:Newscoop,代码行数:31,代码来源:do_edit.php


注:本文中的Publication::getDefaultAliasId方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。