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


PHP Article::getIssueNumber方法代码示例

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


在下文中一共展示了Article::getIssueNumber方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: GetURI

 public static function GetURI($p_publicationId, $p_languageId, $p_issueNo = null, $p_sectionNo = null, $p_articleNo = null)
 {
     $languageObj = new Language($p_languageId);
     if (!$languageObj->exists()) {
         return new PEAR_Error(getGS('Language does not exist.'));
     }
     $uri = $GLOBALS['Campsite']['SUBDIR'] . '/' . $languageObj->getCode() . '/';
     if (!is_null($p_issueNo) && is_null($p_articleNo)) {
         $issueObj = new Issue($p_publicationId, $p_languageId, $p_issueNo);
         if (!$issueObj->exists()) {
             return new PEAR_Error(getGS('Issue does not exist.'));
         }
         $uri .= $issueObj->getUrlName() . '/';
     }
     if (!is_null($p_sectionNo) && is_null($p_articleNo)) {
         $sectionObj = new Section($p_publicationId, $p_issueNo, $p_languageId, $p_sectionNo);
         if (!$sectionObj->exists()) {
             return new PEAR_Error(getGS('Section does not exist.'));
         }
         $uri .= $sectionObj->getUrlName() . '/';
     }
     if (!is_null($p_articleNo)) {
         $articleObj = new Article($p_languageId, $p_articleNo);
         if (!$articleObj->exists()) {
             return new PEAR_Error(getGS('Article does not exist.'));
         }
         $issueObj = new Issue($p_publicationId, $p_languageId, $articleObj->getIssueNumber());
         $sectionObj = new Section($p_publicationId, $articleObj->getIssueNumber(), $p_languageId, $articleObj->getSectionNumber());
         $uri .= $issueObj->getUrlName() . '/';
         $uri .= $sectionObj->getUrlName() . '/';
         $uri .= $articleObj->getUrlName() . '/';
     }
     return $uri;
 }
开发者ID:nidzix,项目名称:Newscoop,代码行数:34,代码来源:ShortURL.php

示例2: ArticleMessage

 /**
  * Log article related event.
  *
  * @param Article $p_article
  * @param string $p_text
  * @param int $p_userId
  * @param int $p_eventId
  * @param bool $p_short
  *
  * @return void
  */
 public static function ArticleMessage(Article $p_article, $p_text, $p_userId = NULL, $p_eventId = 0, $p_short = FALSE)
 {
     ob_start();
     $translator = \Zend_Registry::get('container')->getService('translator');
     echo $translator->trans('Article'), ': ', $p_article->getTitle();
     if (!$p_short) {
         // add publication, issue, section
         echo ' (';
         echo $translator->trans('Publication'), ': ', $p_article->getPublicationId();
         echo ', ';
         echo $translator->trans('Issue'), ': ', $p_article->getIssueNumber();
         echo ', ';
         echo $translator->trans('Section'), ': ', $p_article->getSectionNumber();
         echo ")\n";
     }
     // generate url
     $url = ShortURL::GetURL($p_article->getPublicationId(), $p_article->getLanguageId(), $p_article->getIssueNumber(), $p_article->getSectionNumber(), $p_article->getArticleNumber());
     if (strpos($url, 'http') !== FALSE) {
         // no url for deleted
         echo $translator->trans('Article URL', array(), 'api'), ': ', $url, "\n";
     }
     echo $translator->trans('Article Number', array(), 'api'), ': ', $p_article->getArticleNumber(), "\n";
     echo $translator->trans('Language'), ': ', $p_article->getLanguageName(), "\n";
     echo "\n";
     echo $translator->trans('Action') . ': ', $p_text;
     $message = ob_get_clean();
     self::Message(substr($message, 0, 254), $p_userId, $p_eventId);
 }
开发者ID:sourcefabric,项目名称:newscoop,代码行数:39,代码来源:Log.php

示例3: ArticleMessage

 /**
  * Log article related event.
  *
  * @param Article $p_article
  * @param string $p_text
  * @param int $p_userId
  * @param int $p_eventId
  * @param bool $p_short
  *
  * @return void
  */
 public static function ArticleMessage(Article $p_article, $p_text, $p_userId = NULL, $p_eventId = 0, $p_short = FALSE)
 {
     ob_start();
     echo getGS('Article'), ': ', $p_article->getTitle();
     if (!$p_short) {
         // add publication, issue, section
         echo ' (';
         echo getGS('Publication'), ': ', $p_article->getPublicationId();
         echo ', ';
         echo getGS('Issue'), ': ', $p_article->getIssueNumber();
         echo ', ';
         echo getGS('Section'), ': ', $p_article->getSectionNumber();
         echo ")\n";
     }
     // generate url
     $url = ShortURL::GetURL($p_article->getPublicationId(), $p_article->getLanguageId(), $p_article->getIssueNumber(), $p_article->getSectionNumber(), $p_article->getArticleNumber());
     if (strpos($url, 'http') !== FALSE) {
         // no url for deleted
         echo getGS('Article URL'), ': ', $url, "\n";
     }
     echo getGS('Article Number'), ': ', $p_article->getArticleNumber(), "\n";
     echo getGS('Language'), ': ', $p_article->getLanguageName(), "\n";
     echo "\n";
     echo getGS('Action') . ': ', $p_text;
     $message = ob_get_clean();
     self::Message($message, $p_userId, $p_eventId);
 }
开发者ID:nidzix,项目名称:Newscoop,代码行数:38,代码来源:Log.php

示例4: GetURI

 public static function GetURI($p_publicationId, $p_languageId, $p_issueNo = null, $p_sectionNo = null, $p_articleNo = null)
 {
     $translator = \Zend_Registry::get('container')->getService('translator');
     $languageObj = new Language($p_languageId);
     if (!$languageObj->exists()) {
         return new PEAR_Error($translator->trans('Language does not exist.'));
     }
     $uri = '/' . $languageObj->getCode() . '/';
     if (!is_null($p_issueNo) && is_null($p_articleNo)) {
         $issueObj = new Issue($p_publicationId, $p_languageId, $p_issueNo);
         if (!$issueObj->exists()) {
             return new PEAR_Error($translator->trans('Issue does not exist.'));
         }
         $uri .= $issueObj->getUrlName() . '/';
     }
     if (!is_null($p_sectionNo) && is_null($p_articleNo)) {
         $sectionObj = new Section($p_publicationId, $p_issueNo, $p_languageId, $p_sectionNo);
         if (!$sectionObj->exists()) {
             return new PEAR_Error($translator->trans('Section does not exist.'));
         }
         $uri .= $sectionObj->getUrlName() . '/';
     }
     if (!is_null($p_articleNo)) {
         $articleObj = new Article($p_languageId, $p_articleNo);
         if (!$articleObj->exists()) {
             return new PEAR_Error($translator->trans('Article does not exist.'));
         }
         $issueObj = new Issue($p_publicationId, $p_languageId, $articleObj->getIssueNumber());
         $sectionObj = new Section($p_publicationId, $articleObj->getIssueNumber(), $p_languageId, $articleObj->getSectionNumber());
         $uri .= $issueObj->getUrlName() . '/';
         $uri .= $sectionObj->getUrlName() . '/';
         $uri .= $articleObj->getUrlName() . '/';
     }
     return $uri;
 }
开发者ID:sourcefabric,项目名称:newscoop,代码行数:35,代码来源:ShortURL.php

示例5: getArticleLink

 private function getArticleLink(Article $article)
 {
     $params = array('f_publication_id' => $article->getPublicationId(), 'f_issue_number' => $article->getIssueNumber(), 'f_section_number' => $article->getSectionNumber(), 'f_article_number' => $article->getArticleNumber(), 'f_language_id' => $article->getLanguageId(), 'f_language_selected' => $article->getLanguageId());
     $queryString = implode('&', array_map(function ($property) use($params) {
         return $property . '=' . $params[$property];
     }, array_keys($params)));
     return $this->view->baseUrl("/admin/articles/edit.php?{$queryString}");
 }
开发者ID:sourcefabric,项目名称:newscoop,代码行数:8,代码来源:EmailController.php

示例6: getEditLink

 /**
  * Get article edit link
  *
  * @param Article $article
  * @return string
  */
 public function getEditLink($article)
 {
     $params = array('f_publication_id' => $article->getPublicationId(), 'f_issue_number' => $article->getIssueNumber(), 'f_section_number' => $article->getSectionNumber(), 'f_article_number' => $article->getArticleNumber(), 'f_language_id' => $article->getLanguageId(), 'f_language_selected' => $article->getLanguageId());
     $paramsStrings = array();
     foreach ($params as $key => $val) {
         $paramsStrings[] = "{$key}={$val}";
     }
     return '/admin/articles/edit.php?' . implode('&', $paramsStrings);
 }
开发者ID:sourcefabric,项目名称:newscoop,代码行数:15,代码来源:Article.php

示例7: clearpageCache

 /**
  * Send request to refresh article cache on Facebook
  *
  * @param int $number
  * @param int $languageId
  *
  * @return mixed response from Facebook about url, or array with error message
  */
 private function clearpageCache($number, $languageId)
 {
     $article = new \Article($languageId, $number);
     if (!$article->isPublished()) {
         return array('message' => $this->get('translator')->trans('fb.label.errornot'));
     }
     $url = \ShortURL::GetURL($article->getPublicationId(), $article->getLanguageId(), $article->getIssueNumber(), $article->getSectionNumber(), $article->getArticleNumber());
     try {
         $curlClient = new \Buzz\Client\Curl();
         $curlClient->setTimeout(10000);
         $browser = new \Buzz\Browser($curlClient);
         $result = $browser->post('https://graph.facebook.com/?id=' . $url . '&scrape=true');
         $urlInfo = json_decode($result->getContent(), true);
     } catch (\Buzz\Exception\ClientException $e) {
         return array('message' => $this->get('translator')->trans('fb.label.error'));
     }
     return $urlInfo;
 }
开发者ID:riverans,项目名称:plugin-NewscoopFacebook,代码行数:26,代码来源:DefaultController.php

示例8: Article

	function test_article() {
		$article = new Article(9000001,9000002,9000003,9000004);

		// Test create
		$article->create("Unit Test Long Name",
						 "Unit Test Short Name",
						 "fastnews");
		$this->assertTrue($article->exists());

		// Test SET functions
		$article->setTitle("Unit Test New Title");
		$article->setCreatorId(9000005);
		$article->setOnFrontPage(true);
		$article->setOnSection(true);
		$article->setWorkflowStatus('Y');
		$article->setKeywords("Unit, Test");
		$article->setIsIndexed(true);

		// Test GET functions
		$articleCopy = new Article(9000001, 9000002, 9000003, 9000004, $article->getArticleId());
		$this->assertEquals(9000001, $articleCopy->getPublicationId());
		$this->assertEquals(9000002, $articleCopy->getIssueNumber());
		$this->assertEquals(9000003, $articleCopy->getSectionNumber());
		$this->assertEquals(9000004, $articleCopy->getLanguageId());
		$this->assertEquals(9000005, $articleCopy->getCreatorId());
		$this->assertEquals("Unit Test New Title", $articleCopy->getTitle());
		$this->assertEquals(true, $articleCopy->onFrontPage());
		$this->assertEquals(true, $articleCopy->onSection());
		$this->assertEquals('Y', $articleCopy->getWorkflowStatus());
		$this->assertEquals("Unit, Test", $articleCopy->getKeywords());
		$this->assertEquals(true, $articleCopy->isIndexed());

		// Test DELETE functions
		$article->delete();
		$this->assertFalse($article->exists());
	}
开发者ID:nistormihai,项目名称:Newscoop,代码行数:36,代码来源:CampsiteTests.php

示例9: isUsersArticle

 /**
  * Test if given article is from users blog
  *
  * @param Article $article
  * @param Newscoop\Entity\User $user
  * @return bool
  */
 public function isUsersArticle(\Article $article, User $user)
 {
     $section = $this->getSection($user);
     return $section->getSectionNumber() == $article->getSectionNumber() && $section->getPublicationId() == $article->getPublicationId() && $section->getIssueNumber() == $article->getIssueNumber() && $section->getLanguageId() == $article->getLanguageId();
 }
开发者ID:nidzix,项目名称:Newscoop,代码行数:12,代码来源:BlogService.php

示例10: Article

}
$translationArticle = new Article($f_translation_language, $articleNumber);
if ($translationArticle->exists()) {
    camp_html_add_msg(getGS("The article has already been translated into \$1.", $translationLanguageObj->getNativeName()));
    camp_html_goto_page($backLink);
}
$f_publication_id = $articleObj->getPublicationId();
// Only create the translated issue and section if the article has been
// categorized.
if ($f_publication_id > 0) {
    $publicationObj = new Publication($f_publication_id);
    if (!$publicationObj->exists()) {
        camp_html_display_error(getGS('Publication does not exist.'), $backLink);
        exit;
    }
    $f_issue_number = $articleObj->getIssueNumber();
    $issueObj = new Issue($f_publication_id, $f_language_id, $f_issue_number);
    if (!$issueObj->exists()) {
        camp_html_display_error(getGS('No such issue.'), $backLink);
        exit;
    }
    //$translationIssueObj = new Issue($f_publication_id, $f_translation_language, $f_issue_number);
    $translationIssueObj = $issueObj->copy(null, $issueObj->getIssueNumber(), $f_translation_language);
    if (!$translationIssueObj) {
        $translationIssueObj = new Issue($f_publication_id, $f_translation_language, $f_issue_number);
    }
    if (!$translationIssueObj->exists()) {
        if (!$g_user->hasPermission("ManageIssue")) {
            camp_html_add_msg(getGS('An issue must be created for the selected language but you do not have the right to create an issue.'));
            camp_html_goto_page($backLink);
        }
开发者ID:nidzix,项目名称:Newscoop,代码行数:31,代码来源:do_translate.php

示例11: explode

$f_section_number = Input::Get('f_section_number', 'int', 0, true);
$f_language_id = Input::Get('f_language_id', 'int', 0, true);
$f_article_code = Input::Get('f_article_code', 'string', 0);
$BackLink = Input::Get('Back', 'string', "/{$ADMIN}/articles/?f_publication_id={$f_publication_id}&f_issue_number={$f_issue_number}&f_section_number={$f_section_number}&f_language_id={$f_language_id}", true);
list($articleNumber, $languageId) = explode("_", $f_article_code);
if (!Input::IsValid()) {
    camp_html_display_error(getGS('Invalid input: $1', Input::GetErrorString()), $BackLink);
    exit;
}
$articleObj = new Article($languageId, $articleNumber);
if (!$articleObj->exists()) {
    camp_html_display_error(getGS('Article does not exist.'), $BackLink);
    exit;
}
$f_publication_id = $f_publication_id > 0 ? $f_publication_id : $articleObj->getPublicationId();
$f_issue_number = $f_issue_number > 0 ? $f_issue_number : $articleObj->getIssueNumber();
$f_section_number = $f_section_number > 0 ? $f_section_number : $articleObj->getSectionNumber();
if ($f_publication_id > 0) {
    $publicationObj = new Publication($f_publication_id);
    if (!$publicationObj->exists()) {
        camp_html_display_error(getGS('Publication does not exist.'), $BackLink);
        exit;
    }
    $issueObj = new Issue($f_publication_id, $f_language_id, $f_issue_number);
    if (!$issueObj->exists()) {
        camp_html_display_error(getGS('No such issue.'), $BackLink);
        exit;
    }
    $sectionObj = new Section($f_publication_id, $f_issue_number, $f_language_id, $f_section_number);
    if (!$sectionObj->exists()) {
        camp_html_display_error(getGS('No such section.'), $BackLink);
开发者ID:nidzix,项目名称:Newscoop,代码行数:31,代码来源:translate.php

示例12: getGS

     camp_html_add_msg(getGS("\$1 toggled.", """ . getGS("On Section Page") . """), "ok");
     break;
 case "toggle_comments":
     foreach ($articleCodes as $articleCode) {
         $articleObj = new Article($articleCode['language_id'], $articleCode['article_id']);
         if ($articleObj->userCanModify($g_user)) {
             $articleObj->setCommentsEnabled(!$articleObj->commentsEnabled());
         }
     }
     camp_html_add_msg(getGS("\$1 toggled.", """ . getGS("Comments") . """), "ok");
     break;
 case "copy":
     foreach ($groupedArticleCodes as $articleNumber => $languageArray) {
         $languageId = camp_array_peek($languageArray);
         $articleObj = new Article($languageId, $articleNumber);
         $articleObj->copy($articleObj->getPublicationId(), $articleObj->getIssueNumber(), $articleObj->getSectionNumber(), $g_user->getUserId(), $languageArray);
         camp_html_add_msg(getGS("Article(s) duplicated."), "ok");
     }
     camp_session_set($offsetVarName, 0);
     break;
 case "copy_interactive":
     $args = $_REQUEST;
     unset($args[SecurityToken::SECURITY_TOKEN]);
     unset($args["f_article_code"]);
     $argsStr = camp_implode_keys_and_values($args, "=", "&");
     $argsStr .= "&f_mode=multi&f_action=duplicate";
     foreach ($_REQUEST["f_article_code"] as $code) {
         $argsStr .= "&f_article_code[]={$code}";
     }
     camp_session_set($offsetVarName, 0);
     camp_html_goto_page("/{$ADMIN}/articles/duplicate.php?" . $argsStr);
开发者ID:nidzix,项目名称:Newscoop,代码行数:31,代码来源:do_article_list_action.php

示例13: camp_html_article_url

/**
 * Create a link to an article.
 *
 * @param Article $p_articleObj
 *		The article we want to display.
 *
 * @param int $p_sectionLanguageId
 *		The language ID for the publication/issue/section.
 *
 * @param string $p_targetFileName
 *		Which file in the "articles" directory to call.
 *
 * @param string $p_backLink
 *		A URL to get back to the previous page the user was on.
 *
 * @param string $p_extraParams
 */
function camp_html_article_url($p_articleObj, $p_sectionLanguageId, $p_targetFileName = "", $p_backLink = "", $p_extraParams = null, $p_securityParameter = false)
{
    global $ADMIN;
    $str = "/{$ADMIN}/articles/" . $p_targetFileName . "?f_publication_id=" . $p_articleObj->getPublicationId() . "&f_issue_number=" . $p_articleObj->getIssueNumber() . "&f_section_number=" . $p_articleObj->getSectionNumber() . "&f_article_number=" . $p_articleObj->getArticleNumber() . "&f_language_id=" . $p_sectionLanguageId . "&f_language_selected=" . $p_articleObj->getLanguageId();
    if ($p_securityParameter) {
        $str .= '&' . SecurityToken::URLParameter();
    }
    if ($p_backLink != "") {
        $str .= "&Back=" . urlencode($p_backLink);
    }
    if (!is_null($p_extraParams)) {
        $str .= $p_extraParams;
    }
    return $str;
}
开发者ID:nidzix,项目名称:Newscoop,代码行数:32,代码来源:camp_html.php

示例14: returnJson

                break;
            case 'Published':
                $f_value = 'Y';
                break;
            case 'Submitted':
                $f_value = 'S';
                break;
        }
        $access = false;
        // A publisher can change the status in any way he sees fit.
        // Someone who can change an article can submit/unsubmit articles.
        // A user who owns the article may submit it.
        if ($g_user->hasPermission('Publish') || $g_user->hasPermission('ChangeArticle') && $f_value != 'Y' || $articleObj->userCanModify($g_user) && $f_value == 'S') {
            $access = true;
        }
        // If the article is not yet categorized, force it to be before publication.
        if ($f_action_workflow == "Y" && ($articleObj->getPublicationId() == 0 || $articleObj->getIssueNumber() == 0 || $articleObj->getSectionNumber() == 0)) {
            //$args = $_REQUEST;
            //$argsStr = camp_implode_keys_and_values($_REQUEST, "=", "&");
            //$argsStr .= "&f_article_code[]=".$f_article_number."_".$f_language_selected;
            //$argsStr .= "&f_mode=single&f_action=publish";
            //camp_html_goto_page("/$ADMIN/articles/duplicate.php?".$argsStr);
        }
        $success = $articleObj->setWorkflowStatus($f_value);
        $message = $translator->trans("Article status set to \$1", array('$1' => $articleObj->getWorkflowDisplayString($f_value)), 'library');
    }
}
if ($affectedArticles == 0 && $success) {
    $affectedArticles = 1;
}
return returnJson($affectedArticles, $message, $notAffectedArticles, $errorMessage, $hiperlink);
开发者ID:sourcefabric,项目名称:newscoop,代码行数:31,代码来源:do_action.php

示例15: 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, $p_lngId, $p_isPublished);
             }
             $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 = ' . (int) $p_pubId . ' AND s.IdLanguage = ' . (int) $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);
 }
开发者ID:nidzix,项目名称:Newscoop,代码行数:51,代码来源:CampSystem.php


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