本文整理汇总了PHP中Publication::exists方法的典型用法代码示例。如果您正苦于以下问题:PHP Publication::exists方法的具体用法?PHP Publication::exists怎么用?PHP Publication::exists使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Publication
的用法示例。
在下文中一共展示了Publication::exists方法的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;
}
示例2: array
camp_html_display_error($translator->trans("You do not have the right to add articles."));
exit;
}
$f_src_publication_id = Input::Get('f_src_publication_id', 'int', 0);
$f_src_issue_number = Input::Get('f_src_issue_number', 'int', 0);
$f_src_section_number = Input::Get('f_src_section_number', 'int', 0);
$f_language_id = Input::Get('f_language_id', 'int', 0);
$f_dest_publication_id = Input::Get('f_dest_publication_id', 'int', 0);
$f_dest_issue_number = Input::Get('f_dest_issue_number', 'int', 0);
$f_dest_section_number = Input::Get('f_dest_section_number', 'int', 0);
if (!Input::IsValid()) {
camp_html_display_error($translator->trans('Invalid input: $1', array('$1' => Input::GetErrorString())));
exit;
}
$srcPublicationObj = new Publication($f_src_publication_id);
if (!$srcPublicationObj->exists()) {
camp_html_display_error($translator->trans('Publication does not exist.'));
exit;
}
$srcIssueObj = new Issue($f_src_publication_id, $f_language_id, $f_src_issue_number);
if (!$srcIssueObj->exists()) {
camp_html_display_error($translator->trans('Issue does not exist.'));
exit;
}
$srcSectionObj = new Section($f_src_publication_id, $f_src_issue_number, $f_language_id, $f_src_section_number);
if (!$srcSectionObj->exists()) {
camp_html_display_error($translator->trans('Section does not exist.'));
exit;
}
$dstPublicationObj = new Publication($f_dest_publication_id);
$dstIssueObj = new Issue($f_dest_publication_id, $f_language_id, $f_dest_issue_number);
示例3: Issue
}
if ($cArticleTplId < 0) {
$cArticleTplId = 0;
}
if (!Input::IsValid()) {
camp_html_display_error(getGS('Invalid input: $1', Input::GetErrorString()), $_SERVER['REQUEST_URI']);
exit;
}
$issueObj = new Issue($Pub, $Language, $Issue);
$publicationObj = new Publication($Pub);
$sectionObj = new Section($Pub, $Issue, $Language, $Section);
if (!$publicationObj->exists()) {
camp_html_display_error(getGS('Publication does not exist.'));
exit;
}
if (!$issueObj->exists()) {
camp_html_display_error(getGS('No such issue.'));
exit;
}
$correct = true;
$modified = false;
$errors = array();
if ($cName == "") {
camp_html_add_msg(getGS('You must fill in the $1 field.','"'.getGS('Name').'"'));
}
示例4: 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);
}
示例5: GetTemplate
/**
*
*/
public static function GetTemplate($p_lngId, $p_pubId, $p_issNr, $p_sctNr,
$p_artNr, $p_isPublished = true)
{
global $g_ado_db;
if ($p_lngId <= 0) {
$publication = new Publication($p_pubId);
if (!$publication->exists()) {
return null;
}
$p_lngId = $publication->getLanguageId();
}
if ($p_artNr > 0) {
if ($p_issNr <= 0 || $p_sctNr <= 0) {
$article = new Article($p_lngId, $p_artNr);
if (!$article->exists()
|| ($p_isPublished && !$article->isPublished())) {
return self::GetInvalidURLTemplate($p_pubId);
}
$p_issNr = $article->getIssueNumber();
$p_sctNr = $article->getSectionNumber();
}
return self::GetArticleTemplate($p_lngId, $p_pubId, $p_issNr, $p_sctNr);
}
if ($p_sctNr > 0) {
if ($p_issNr <= 0) {
$sql = 'SELECT MAX(i.Number) AS Number '
. 'FROM Sections as s, Issues as i '
. 'WHERE s.IdPublication = i.IdPublication'
. ' AND s.IdLanguage = i.IdLanguage'
. ' AND s.IdPublication = ' . $p_pubId
. ' AND s.IdLanguage = ' . $p_lngId;
if ($p_isPublished == true) {
$sql .= " AND i.Published = 'Y'";
}
$data = $g_ado_db->GetOne($sql);
if (empty($data)) {
return null;
}
$p_issNr = $data;
}
return self::GetSectionTemplate($p_lngId, $p_pubId, $p_issNr, $p_sctNr);
}
if ($p_issNr <= 0) {
$sql = 'SELECT MAX(Number) AS Number FROM Issues '
. 'WHERE IdPublication = ' . $p_pubId
. ' AND IdLanguage = ' . $p_lngId;
if ($p_isPublished == true) {
$sql .= " AND Published = 'Y'";
}
$data = $g_ado_db->GetOne($sql);
if (empty($data)) {
return null;
}
$p_issNr = $data;
}
return self::GetIssueTemplate($p_lngId, $p_pubId, $p_issNr);
} // fn GetTemplate