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


PHP OOArticle::getArticleById方法代码示例

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


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

示例1: getArticlesOfCategory

 /**
  * CLASS Function:
  * Return a list of articles for a certain category
  */
 function getArticlesOfCategory($a_category_id, $ignore_offlines = false, $clang = false)
 {
     global $REX;
     if ($clang === false) {
         $clang = $REX['CUR_CLANG'];
     }
     if (!isset($REX['RE_ID'][$a_category_id])) {
         $articlelist = $REX['INCLUDE_PATH'] . "/generated/articles/" . $a_category_id . "." . $clang . ".alist";
         if (file_exists($articlelist)) {
             include $articlelist;
         }
     }
     $artlist = array();
     if (isset($REX['RE_ID'][$a_category_id])) {
         foreach ($REX['RE_ID'][$a_category_id] as $var) {
             $article = OOArticle::getArticleById($var, $clang);
             if ($ignore_offlines) {
                 if ($article->isOnline()) {
                     $artlist[] = $article;
                 }
             } else {
                 $artlist[] = $article;
             }
         }
     }
     return $artlist;
 }
开发者ID:BackupTheBerlios,项目名称:redaxo,代码行数:31,代码来源:class.ooarticle.inc.php

示例2: get_db_articles

 /**
  * GET SITEMAP ARTICLES FROM DB
  *
  * @return (array) sitemap articles
  */
 private function get_db_articles()
 {
     global $REX, $SEO42_URLS;
     if ($REX['ADDON']['seo42']['settings']['rewriter']) {
         // use seo42 pathlist
         array_multisort($SEO42_URLS);
         foreach ($SEO42_URLS as $url) {
             $article = OOArticle::getArticleById($url['id'], $url['clang']);
             if (OOArticle::isValid($article)) {
                 $hasPermission = true;
                 // community addon
                 if (class_exists('rex_com_auth') && !rex_com_auth::checkPerm($article)) {
                     $hasPermission = false;
                 }
                 // add sitemap block
                 if (($article->isOnline() || $article->getId() == $REX['START_ARTICLE_ID'] && $article->getClang() == $REX['START_CLANG_ID']) && !isset($url['status']) && $hasPermission) {
                     $db_articles[$url['id']][$url['clang']] = array('loc' => rex_getUrl($url['id'], $url['clang']), 'lastmod' => date('c', $article->getValue('updatedate')), 'changefreq' => self::calc_article_changefreq($article->getValue('updatedate'), ''), 'priority' => self::calc_article_priority($url['id'], $url['clang'], $article->getValue('path'), ''), 'noindex' => $article->getValue('seo_noindex'));
                 }
             }
         }
     } else {
         // at the moment: no sitemap urls if rewriter is turned off
     }
     // EXTENSIONPOINT SEO42_SITEMAP_ARRAY_CREATED
     $db_articles = rex_register_extension_point('SEO42_SITEMAP_ARRAY_CREATED', $db_articles);
     // EXTENSIONPOINT SEO42_SITEMAP_ARRAY_FINAL (READ ONLY)
     rex_register_extension_point('SEO42_SITEMAP_ARRAY_FINAL', $db_articles);
     $this->db_articles = $db_articles;
 }
开发者ID:omphteliba,项目名称:seo42,代码行数:34,代码来源:class.seo42_sitemap.inc.php

示例3: getBreadcrumb

 function getBreadcrumb($startPageLabel, $includeCurrent = FALSE, $category_id = 0)
 {
     if (!$this->_setActivePath()) {
         return FALSE;
     }
     global $REX;
     $path = $this->path;
     $i = 1;
     $lis = '';
     if ($startPageLabel) {
         $lis .= '<li class="rex-lvl' . $i . '"><a href="' . rex_getUrl($REX['START_ARTICLE_ID']) . '">' . htmlspecialchars($startPageLabel) . '</a></li>';
         $i++;
         // StartArticle nicht doppelt anzeigen
         if (isset($path[0]) && $path[0] == $REX['START_ARTICLE_ID']) {
             unset($path[0]);
         }
     }
     foreach ($path as $pathItem) {
         if ($cat = OOCategory::getCategoryById($pathItem) && $this->_check($cat, $i)) {
             $lis .= '<li class="rex-lvl' . $i . '"><a href="' . $cat->getUrl() . '">' . htmlspecialchars($cat->getName()) . '</a></li>';
             $i++;
         }
     }
     if ($includeCurrent) {
         if ($art = OOArticle::getArticleById($this->current_article_id) && $this->_check($art, $i)) {
             if (!$art->isStartpage()) {
                 $lis .= '<li class="rex-lvl' . $i . '">' . htmlspecialchars($art->getName()) . '</li>';
             } else {
                 $cat = OOCategory::getCategoryById($this->current_article_id);
                 $lis .= '<li class="rex-lvl' . $i . '">' . htmlspecialchars($cat->getName()) . '</li>';
             }
         }
     }
     return '<ul class="rex-breadcrumb">' . $lis . '</ul>';
 }
开发者ID:BackupTheBerlios,项目名称:redaxo-svn,代码行数:35,代码来源:class.rex_com_navigation.inc.php

示例4: rex_getUrl

function rex_getUrl($id, $clang = "", $params = "")
{
    /*
     * Object Helper Function:
     * Returns a url for linking to this article
     * This url respects the setting for mod_rewrite
     * support!
     *
     * If you pass an associative array for $params,
     * then these parameters will be attached to the URL.
     * e.g.:
     *   $param = array("order" => "123", "name" => "horst");
     *   $article->getUrl($param);
     * will return:
     *   index.php?article_id=1&order=123&name=horst
     * or if mod_rewrite support is activated:
     *   /1-The_Article_Name?order=123&name=horst
     */
    global $REX;
    // ----- definiere sprache
    if ($clang == "") {
        $clang = $REX[CUR_CLANG];
    }
    // ----- get article Name
    $id = $id + 0;
    if ($id == 0) {
        $name = "NoName";
    } else {
        $ooa = OOArticle::getArticleById($id);
        if ($ooa) {
            $name = strtolower($ooa->getName());
        }
        $name = preg_replace("/[^a-zA-Z]/", "", $name);
    }
    // ----- get params
    $param_string = "";
    if (is_array($params)) {
        $first = true;
        foreach ($params as $key => $value) {
            // Nur Wenn MOD_REWRITE aktiv ist, das erste "&amp;" entfernen.
            if ($first && $REX['MOD_REWRITE']) {
                $first = false;
            } else {
                $param_string .= '&amp;';
            }
            $param_string .= $key . '=' . $value;
        }
    } else {
        if ($params != "") {
            $param_string = str_replace('&', '&amp;', $params);
        }
    }
    if ($REX['MOD_REWRITE'] && $param_string != "") {
        $param_string = "?" . $param_string;
    }
    // ----- create url
    $url = $REX['MOD_REWRITE'] ? "{$id}-{$clang}-{$name}.html" : "index.php?article_id={$id}&amp;clang={$clang}";
    return $REX['WWW_PATH'] . "{$url}" . "{$param_string}";
}
开发者ID:BackupTheBerlios,项目名称:redaxo-svn,代码行数:59,代码来源:function_rex_modrewrite.inc.php

示例5: getCategoryById

 function getCategoryById($category_id = false, $clang = false)
 {
     global $REX;
     if ($clang === false) {
         $clang = $REX['CUR_CLANG'];
     }
     return OOArticle::getArticleById($category_id, $clang, true);
 }
开发者ID:BackupTheBerlios,项目名称:redaxo,代码行数:8,代码来源:class.oocategory.inc.php

示例6: rex_a62_metainfo_form

/**
 * Erweitert das Meta-Formular um die neuen Meta-Felder
 */
function rex_a62_metainfo_form($params)
{
    $OOArt = OOArticle::getArticleById($params['id'], $params['clang']);
    $params['activeItem'] = $params['article'];
    // Hier die category_id setzen, damit beim klick auf den REX_LINK_BUTTON der Medienpool in der aktuellen Kategorie startet
    $params['activeItem']->setValue('category_id', $OOArt->getCategoryId());
    return $params['subject'] . _rex_a62_metainfo_form('art_', $params, '_rex_a62_metainfo_art_handleSave');
}
开发者ID:BackupTheBerlios,项目名称:redaxo-svn,代码行数:11,代码来源:extension_art_metainfo.inc.php

示例7: rex_a128_historyHandler

function rex_a128_historyHandler($params)
{
    global $page, $subpage, $REX_USER, $REX;
    $mypage = $params['mypage'];
    require $REX['INCLUDE_PATH'] . '/addons/' . $mypage . '/classes/class.rex_historyManager.inc.php';
    require $REX['INCLUDE_PATH'] . '/addons/' . $mypage . '/classes/class.rex_history.inc.php';
    require $REX['INCLUDE_PATH'] . '/addons/' . $mypage . '/classes/class.rex_historyItem.inc.php';
    $function = rex_request('function', 'string');
    $mode = rex_request('mode', 'string');
    // Alle Histories registrierens
    $articleHistory =& rexHistoryManager::getHistory('articles');
    $templateHistory =& rexHistoryManager::getHistory('templates');
    $moduleHistory =& rexHistoryManager::getHistory('modules');
    $actionHistory =& rexHistoryManager::getHistory('actions');
    $sql = new rex_sql();
    $sql->debugsql = true;
    if ($page == 'module' && $function == 'edit' && ($module_id = rex_get('modul_id', 'int')) != 0) {
        $result = $sql->getArray('SELECT name FROM ' . $REX['TABLE_PREFIX'] . 'modultyp WHERE id=' . $module_id);
        if (isset($result[0])) {
            $link = 'index.php?page=' . $page . '&function=' . $function . '&modul_id=' . $module_id;
            $title = $result[0]['name'];
            if ($REX_USER->hasPerm('advancedMode[]')) {
                $title .= ' [' . $module_id . ']';
            }
            $moduleHistory->addItem(new rexHistoryItem($title, $link));
        }
    } elseif ($page == 'module' && $subpage == 'actions' && $function == 'edit' && ($action_id = rex_get('action_id', 'int')) != 0) {
        $result = $sql->getArray('SELECT name FROM ' . $REX['TABLE_PREFIX'] . 'action WHERE id=' . $action_id);
        if (isset($result[0])) {
            $link = 'index.php?page=' . $page . '&subpage=' . $subpage . '&function=' . $function . '&modul_id=' . $action_id;
            $title = $result[0]['name'];
            if ($REX_USER->hasPerm('advancedMode[]')) {
                $title .= ' [' . $action_id . ']';
            }
            $actionHistory->addItem(new rexHistoryItem($title, $link));
        }
    } elseif ($page == 'template' && $function == 'edit' && ($template_id = rex_get('template_id', 'int')) != 0) {
        $result = $sql->getArray('SELECT name FROM ' . $REX['TABLE_PREFIX'] . 'template WHERE id=' . $template_id);
        if (isset($result[0])) {
            $link = 'index.php?page=' . $page . '&function=' . $function . '&template_id=' . $template_id;
            $title = $result[0]['name'];
            if ($REX_USER->hasPerm('advancedMode[]')) {
                $title .= ' [' . $template_id . ']';
            }
            $templateHistory->addItem(new rexHistoryItem($title, $link));
        }
    } elseif ($page == 'content' && $mode == 'edit' && ($article_id = rex_get('article_id', 'int')) != 0) {
        $art = OOArticle::getArticleById($article_id);
        if (OOArticle::isValid($art)) {
            $link = 'index.php?page=' . $page . '&mode=' . $mode . '&article_id=' . $article_id;
            $title = $art->getName();
            if ($REX_USER->hasPerm('advancedMode[]')) {
                $title .= ' [' . $article_id . ']';
            }
            $articleHistory->addItem(new rexHistoryItem($title, $link));
        }
    }
}
开发者ID:BackupTheBerlios,项目名称:redaxo-addons,代码行数:58,代码来源:extension_historyHandler.inc.php

示例8: getArticleName

 function getArticleName()
 {
     $article_id = $this->getValue();
     $article_name = '';
     if ($article_id != '' && $article_id != 0) {
         $ooa = OOArticle::getArticleById($article_id);
         if ($ooa !== null) {
             $article_name = $ooa->getName();
         }
     }
     return $article_name;
 }
开发者ID:BackupTheBerlios,项目名称:redaxo-addons,代码行数:12,代码来源:field.rexLinkButtonField.inc.php

示例9: matchArticleVar

 /**
  * Wert für die Ausgabe
  */
 function matchArticleVar($content)
 {
     global $article_id, $clang;
     $var = 'REX_ARTICLE_VAR';
     $matches = $this->getArticleVarInputParams($content, $var);
     $article = OOArticle::getArticleById($article_id, $clang);
     foreach ($matches as $match) {
         list($param_str) = $match;
         $content = str_replace($var . '[' . $param_str . ']', $article->getValue($param_str), $content);
     }
     return $content;
 }
开发者ID:BackupTheBerlios,项目名称:redaxo,代码行数:15,代码来源:class.rex_var_article.inc.php

示例10: control

 public static function control()
 {
     global $REX;
     $myself = 'url_control';
     $addon = $REX['ADDON'][$myself]['addon'];
     $rewriter = $REX['ADDON'][$myself]['rewriter'];
     // http://www.domain.de/kategorie/artikel.html
     $url_full = parent::getFullRequestedUrl();
     $parse = parse_url($url_full);
     $url_path = $parse['path'];
     $sql = rex_sql::factory();
     //$sql->debugsql = true;
     $sql->setQuery('SELECT  *
                     FROM    ' . $REX['TABLE_PREFIX'] . 'url_control_manager
                     WHERE   status = "1"
                         AND (
                             url = "' . mysql_real_escape_string($url_full) . '"
                             OR
                             url = "' . mysql_real_escape_string($url_path) . '"
                         )
                 ');
     if ($sql->getRows() == 1) {
         $method = $sql->getValue('method');
         $params = unserialize($sql->getValue('method_parameters'));
         switch ($method) {
             case 'article':
                 $article_id = (int) $params['article']['article_id'];
                 $clang = (int) $params['article']['clang'];
                 if ($params['article']['action'] == 'view') {
                     return array('article_id' => $article_id, 'clang' => $clang);
                 } elseif ($params['article']['action'] == 'redirect') {
                     $a = OOArticle::getArticleById((int) $params['article']['article_id'], (int) $params['article']['clang']);
                     if ($a instanceof OOArticle) {
                         if (isset($rewriter[$addon]['get_url'])) {
                             $func = $rewriter[$addon]['get_url'];
                             $url = call_user_func($func, $article_id, $clang);
                         } else {
                             $url = $a->getUrl();
                         }
                     }
                     //$url = rex_getUrl((int) $params['article']['article_id'], (int) $params['article']['clang']);
                     self::redirect($a->getUrl(), $params['http_type']['code']);
                 }
                 break;
             case 'target_url':
                 $url = $params['target_url']['url'];
                 self::redirect($url, $params['http_type']['code']);
                 break;
         }
     }
     return false;
 }
开发者ID:NGWNGW,项目名称:redaxo_plugin_url_control,代码行数:52,代码来源:url_manager.php

示例11: rex_getUrl

/**
 * Object Helper Function:
 * Returns a url for linking to this article
 * This url respects the setting for mod_rewrite
 * support!
 *
 * If you pass an associative array for $params,
 * then these parameters will be attached to the URL.
 * 
 * 
 * USAGE:
 *   $param = array("order" => "123", "name" => "horst");
 *   $url = $article->getUrl($param);
 * 
 *   - OR -
 *  
 *   $url = $article->getUrl("order=123&name=horst");
 * 
 * RETURNS:
 *   index.php?article_id=1&order=123&name=horst
 * or if mod_rewrite support is activated:
 *   /1-The_Article_Name?order=123&name=horst
 */
function rex_getUrl($id = '', $clang = '', $params = '')
{
    global $REX, $article_id;
    $id = (int) $id;
    $clang = (int) $clang;
    // ----- get id
    if (strlen($id) == 0 || $id == 0) {
        $id = $article_id;
    }
    // ----- get clang
    // Wenn eine rexExtension vorhanden ist, immer die clang mitgeben!
    // Die rexExtension muss selbst entscheiden was sie damit macht
    if (strlen($clang) == 0 && (count($REX['CLANG']) > 1 || rex_extension_is_registered('URL_REWRITE'))) {
        $clang = $REX['CUR_CLANG'];
    }
    // ----- get params
    $param_string = '';
    if (is_array($params)) {
        foreach ($params as $key => $value) {
            $param_string .= '&amp;' . $key . '=' . $value;
        }
    } elseif ($params != '') {
        $param_string = str_replace('&', '&amp;', $params);
    }
    // ----- get article name
    $id = (int) $id;
    if ($id != 0) {
        $ooa = OOArticle::getArticleById($id, $clang);
        if ($ooa) {
            $name = rex_parseArticleName($ooa->getName());
        }
    }
    if (!isset($name) or $name == '') {
        $name = 'NoName';
    }
    // ----- EXTENSION POINT
    $url = rex_register_extension_point('URL_REWRITE', '', array('id' => $id, 'name' => $name, 'clang' => $clang, 'params' => $param_string));
    if ($url == '') {
        // ----- get rewrite function
        if ($REX['MOD_REWRITE'] === true || $REX['MOD_REWRITE'] == 'true') {
            $rewrite_fn = 'rexrewrite_apache_rewrite';
        } else {
            $rewrite_fn = 'rexrewrite_no_rewrite';
        }
        $url = call_user_func($rewrite_fn, $id, $name, $clang, $param_string);
    }
    return $url;
}
开发者ID:BackupTheBerlios,项目名称:redaxo-svn,代码行数:71,代码来源:function_rex_modrewrite.inc.php

示例12: enterObject

    function enterObject(&$email_elements, &$sql_elements, &$warning, &$form_output, $send = 0)
    {
        global $REX;
        if (!isset($REX["xform_classes_be_link"])) {
            $REX["xform_classes_be_link"] = 0;
        }
        $REX["xform_classes_be_link"]++;
        $i = $REX["xform_classes_be_link"];
        if ($this->value == "" && !$send) {
            if (isset($this->elements[3])) {
                $this->value = $this->elements[3];
            }
        }
        $wc = "";
        if (isset($warning[$this->getId()])) {
            $wc = $warning[$this->getId()];
        }
        $linkname = "";
        if ($this->getValue() != "" && ($a = OOArticle::getArticleById($this->getValue()))) {
            $linkname = $a->getName();
        }
        $form_output[] = '
      
    <div class="xform-element formbe_mediapool formlabel-' . $this->getName() . '">
        <label class="text ' . $wc . '" for="el_' . $this->getId() . '" >' . $this->elements[2] . '</label>
    <div class="rex-widget">
    <div class="rex-widget-link">
      <p class="rex-widget-field">
        <input type="hidden" name="FORM[' . $this->params["form_name"] . '][el_' . $this->id . ']" id="LINK_' . $i . '" value="' . $this->getValue() . '" />
        <input type="text" size="30" name="LINK_' . $i . '_NAME" value="' . htmlspecialchars($linkname) . '" id="LINK_' . $i . '_NAME" readonly="readonly" />
      </p>

       <p class="rex-widget-icons rex-widget-1col">
        <span class="rex-widget-column rex-widget-column-first">
          <a href="#" class="rex-icon-file-open" onclick="openLinkMap(\'LINK_' . $i . '\', \'&clang=0&category_id=1\');return false;" title="Link auswŠhlen" tabindex="21"></a>
          <a href="#" class="rex-icon-file-delete" onclick="deleteREXLink(' . $i . ');return false;" title="AusgewŠhlten Link lšschen" tabindex="22"></a>
        </span>
      </p>
    </div>
    </div>
    <div class="rex-clearer"></div>
    </div>
  ';
        $email_elements[$this->elements[1]] = stripslashes($this->value);
        if (!isset($this->elements[4]) || $this->elements[4] != "no_db") {
            $sql_elements[$this->elements[1]] = $this->value;
        }
    }
开发者ID:rotzek,项目名称:redaxo_xform,代码行数:48,代码来源:class.xform.be_link.inc.php

示例13: enterObject

 function enterObject()
 {
     static $counter = 0;
     $counter++;
     if ($this->getValue() == '' && !$this->params['send']) {
         $this->setValue($this->getElement(3));
     }
     $linkName = '';
     if ($this->getValue() != '' && ($a = OOArticle::getArticleById($this->getValue()))) {
         $linkName = $a->getName();
     }
     $this->params['form_output'][$this->getId()] = $this->parse('value.be_link.tpl.php', compact('counter', 'linkName'));
     $this->params['value_pool']['email'][$this->getName()] = stripslashes($this->getValue());
     if ($this->getElement(4) != 'no_db') {
         $this->params['value_pool']['sql'][$this->getName()] = $this->getValue();
     }
 }
开发者ID:Barnhiac,项目名称:MTW_REDAXO,代码行数:17,代码来源:class.xform.be_link.inc.php

示例14: setArticleId

 function setArticleId($article_id)
 {
     // bc
     if ($this->viasql) {
         return parent::setArticleId($article_id);
     }
     global $REX;
     $article_id = (int) $article_id;
     $this->article_id = $article_id;
     $OOArticle = OOArticle::getArticleById($article_id, $this->clang);
     if (OOArticle::isValid($OOArticle)) {
         $this->category_id = $OOArticle->getCategoryId();
         $this->template_id = $OOArticle->getTemplateId();
         return TRUE;
     }
     $this->article_id = 0;
     $this->template_id = 0;
     $this->category_id = 0;
     return FALSE;
 }
开发者ID:BackupTheBerlios,项目名称:redaxo-svn,代码行数:20,代码来源:class.rex_article.inc.php

示例15: rex_getUrl

/**
 * Gibt eine Url zu einem Artikel zurück
 *
 * @param [$_id] ArtikelId des Artikels
 * @param [$_clang] SprachId des Artikels
 * @param [$_params] Array von Parametern
 * @param [$_divider] Trennzeichen für Parameter
 * (z.B. &amp; für HTML, & für Javascript)
 */
function rex_getUrl($_id = '', $_clang = '', $_params = '', $_divider = '&amp;')
{
    global $REX, $article_id;
    $id = (int) $_id;
    $clang = (int) $_clang;
    // ----- get id
    if ($id == 0) {
        $id = $article_id;
    }
    // ----- get clang
    // Wenn eine rexExtension vorhanden ist, immer die clang mitgeben!
    // Die rexExtension muss selbst entscheiden was sie damit macht
    if ($_clang === '' && (count($REX['CLANG']) > 1 || rex_extension_is_registered('URL_REWRITE'))) {
        $clang = $REX['CUR_CLANG'];
    }
    // ----- get params
    $param_string = rex_param_string($_params, $_divider);
    if ($id != 0) {
        $ooa = OOArticle::getArticleById($id, $clang);
        if ($ooa) {
            $name = rex_parse_article_name($ooa->getName());
        }
    }
    if (!isset($name) or $name == '') {
        $name = 'NoName';
    }
    // ----- EXTENSION POINT
    $url = rex_register_extension_point('URL_REWRITE', '', array('id' => $id, 'name' => $name, 'clang' => $clang, 'params' => $param_string, 'divider' => $_divider));
    if ($url == '') {
        // ----- get rewrite function
        if ($REX['MOD_REWRITE'] === true || $REX['MOD_REWRITE'] == 'true') {
            $rewrite_fn = 'rex_apache_rewrite';
        } else {
            $rewrite_fn = 'rex_no_rewrite';
        }
        $url = call_user_func($rewrite_fn, $id, $name, $clang, $param_string, $_divider);
    }
    return $url;
}
开发者ID:BackupTheBerlios,项目名称:redaxo-svn,代码行数:48,代码来源:function_rex_url.inc.php


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