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


PHP rex_article::getContentAsQuery方法代码示例

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


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

示例1: rex_newsletter_sendmail

function rex_newsletter_sendmail($userinfo, $aid, $mail_reply, $mail_subject)
{
    global $REX;
    $tmp_redaxo = $REX['REDAXO'];
    $REX['REDAXO'] = true;
    // ***** HTML VERSION KOMPLETT
    $REX_ARTICLE = new rex_article();
    $REX_ARTICLE->setCLang(0);
    $REX_ARTICLE->setArticleId($aid);
    $REX_ARTICLE->getContentAsQuery(TRUE);
    // $REX_ARTICLE->setTemplateId(xx);
    $REX['ADDON']['NEWSLETTER_TEXT'] = FALSE;
    $html_body = $REX_ARTICLE->getArticleTemplate();
    // ***** TEXT VERSION
    $REX_ARTICLE = new rex_article();
    $REX_ARTICLE->setCLang(0);
    $REX_ARTICLE->setArticleId($aid);
    $REX_ARTICLE->getContentAsQuery(TRUE);
    // $REX_ARTICLE->setTemplateId(xx);
    $REX['ADDON']['NEWSLETTER_TEXT'] = TRUE;
    // FILTERN VERSION KOMPLETT
    $text_body = $REX_ARTICLE->getArticle();
    $text_body = str_replace("<br />", "<br />", $text_body);
    $text_body = str_replace("<p>", "\n\n</p>", $text_body);
    $text_body = str_replace("<ul>", "\n\n</ul>", $text_body);
    $text_body = preg_replace("#(\\<)(.*)(\\>)#imsU", "", $text_body);
    $text_body = html_entity_decode($text_body);
    $REX['REDAXO'] = true;
    // ***** MAIL VERSAND
    // Allgemeine Initialisierung
    // $mail = new PHPMailer();
    $mail = new rex_mailer();
    $mail->AddAddress($userinfo["email"]);
    $mail->From = $mail_reply;
    $mail->FromName = $mail_reply;
    $subject = $mail_subject;
    // Subject
    // Bodies
    // html
    foreach ($userinfo as $k => $v) {
        $subject = str_replace("###" . $k . "###", $v, $subject);
        $html_body = str_replace("###" . $k . "###", $v, $html_body);
        $text_body = str_replace("###" . $k . "###", $v, $text_body);
        $subject = str_replace("###" . strtoupper($k) . "###", $v, $subject);
        $html_body = str_replace("###" . strtoupper($k) . "###", $v, $html_body);
        $text_body = str_replace("###" . strtoupper($k) . "###", $v, $text_body);
    }
    // text
    // echo "<pre>$text_body</pre>";
    $mail->Subject = $subject;
    $mail->AltBody = $text_body;
    $mail->Body = $html_body;
    $mail->Send();
    $REX['REDAXO'] = $tmp_redaxo;
}
开发者ID:BackupTheBerlios,项目名称:redaxo-svn,代码行数:55,代码来源:config.inc.php

示例2: rex_generateArticle

/**
 * Generiert alle *.article u. *.content Dateien eines Artikels/einer Kategorie
 *
 * @param $id ArtikelId des Artikels, der generiert werden soll
 * @param $refreshall Boolean Bei True wird der Inhalte auch komplett neu generiert, bei False nur die Metainfos
 */
function rex_generateArticle($id, $refreshall = true)
{
    global $REX, $I18N;
    // artikel generieren
    // vorraussetzung: articel steht schon in der datenbank
    //
    // -> infos schreiben -> abhaengig von clang
    // --> artikel infos / einzelartikel metadaten
    // --> artikel content / einzelartikel content
    // --> listen generieren // wenn startpage = 1
    // ---> artikel liste
    // ---> category liste
    // --------------------------------------------------- generiere generated/articles/xx.article
    foreach ($REX['CLANG'] as $clang => $clang_name) {
        $MSG = '';
        $CONT = new rex_article();
        $CONT->setCLang($clang);
        $CONT->getContentAsQuery();
        $CONT->setMode("generate");
        // keine Ausgabe als eval(CONTENT) sondern nur speichern in datei
        if (!$CONT->setArticleId($id)) {
            return false;
        }
        // --------------------------------------------------- Artikelparameter speichern
        $params = array('article_id' => $id, 'last_update_stamp' => time());
        $class_vars = OORedaxo::getClassVars();
        unset($class_vars[array_search('id', $class_vars)]);
        $db_fields = $class_vars;
        foreach ($db_fields as $field) {
            $params[$field] = $CONT->getValue($field);
        }
        $content = '<?php' . "\n";
        foreach ($params as $name => $value) {
            $content .= '$REX[\'ART\'][' . $id . '][\'' . $name . '\'][' . $clang . '] = \'' . rex_addslashes($value, '\\\'') . '\';' . "\n";
        }
        $content .= '?>';
        if ($fp = @fopen($REX['INCLUDE_PATH'] . "/generated/articles/{$id}.{$clang}.article", "w")) {
            fputs($fp, $content);
            fclose($fp);
            @chmod($REX['INCLUDE_PATH'] . "/generated/articles/{$id}.{$clang}.article", 0777);
        } else {
            $MSG = $I18N->msg('article_could_not_be_generated') . " " . $I18N->msg('check_rights_in_directory') . $REX['INCLUDE_PATH'] . "/generated/articles/";
        }
        // --------------------------------------------------- Artikelcontent speichern
        if ($refreshall) {
            if ($fp = @fopen($REX['INCLUDE_PATH'] . "/generated/articles/{$id}.{$clang}.content", "w")) {
                $article_content = "?>" . $CONT->getArticle();
                fputs($fp, $article_content);
                fclose($fp);
                @chmod($REX['INCLUDE_PATH'] . "/generated/articles/{$id}.{$clang}.content", 0777);
            } else {
                $MSG = $I18N->msg('article_could_not_be_generated') . " " . $I18N->msg('check_rights_in_directory') . $REX['INCLUDE_PATH'] . "/generated/articles/";
            }
        }
        // ----- EXTENSION POINT
        $MSG = rex_register_extension_point('CLANG_ARTICLE_GENERATED', '', array('id' => $id, 'clang' => $clang, 'article' => $CONT));
        if ($MSG != '') {
            echo rex_warning($MSG);
        }
        // --------------------------------------------------- Listen generieren
        if ($CONT->getValue("startpage") == 1) {
            rex_generateLists($id);
            rex_generateLists($CONT->getValue("re_id"));
        } else {
            rex_generateLists($CONT->getValue("re_id"));
        }
    }
    // ----- EXTENSION POINT
    $MSG = rex_register_extension_point('ARTICLE_GENERATED', '', array('id' => $id));
}
开发者ID:BackupTheBerlios,项目名称:redaxo,代码行数:76,代码来源:function_rex_generate.inc.php

示例3:

        $nl_from_name = $redaxo_nl_from_name;
        $nl_subject = $redaxo_nl_subject;
        if ($nl_from_email == "" || $nl_from_name == "" || $nl_subject == "" || $redaxo_nl_article_id == 0) {
            $error[] = "Bitte prüfen Sie ob alle Infos eingetragen sind";
        } else {
            $tmp_redaxo = $REX['REDAXO'];
            // ***** HTML VERSION KOMPLETT
            $REX['REDAXO'] = true;
            $REX_ARTICLE = new rex_article($redaxo_nl_article_id, 0);
            $REX_ARTICLE->getContentAsQuery(TRUE);
            $REX['ADDON']['NEWSLETTER_TEXT'] = FALSE;
            $nl_body_html = $REX_ARTICLE->getArticleTemplate();
            // ***** TEXT VERSION
            $REX['REDAXO'] = true;
            $REX_ARTICLE = new rex_article($redaxo_nl_article_id, 0);
            $REX_ARTICLE->getContentAsQuery(TRUE);
            $REX['ADDON']['NEWSLETTER_TEXT'] = TRUE;
            // FILTERN VERSION KOMPLETT
            $nl_body_text = $REX_ARTICLE->getArticle();
            $nl_body_text = str_replace("<br />", "<br />", $nl_body_text);
            $nl_body_text = str_replace("<p>", "\n\n</p>", $nl_body_text);
            $nl_body_text = str_replace("<ul>", "\n\n</ul>", $nl_body_text);
            $nl_body_text = preg_replace("#(\\<)(.*)(\\>)#imsU", "", $nl_body_text);
            $nl_body_text = html_entity_decode($nl_body_text);
            $REX['REDAXO'] = $tmp_redaxo;
            $send = TRUE;
        }
    }
}
// ---------- Testversand
if ($method == "start" && $method_all != "all" && count($error) == 0 && $send) {
开发者ID:BackupTheBerlios,项目名称:redaxo-svn,代码行数:31,代码来源:index.inc.php

示例4:

     if ($info != '') {
         echo rex_info($info);
     }
 }
 echo '
     <div class="rex-content-body">
     <div class="rex-content-body-2">
     ';
 if ($mode == 'edit') {
     // ------------------------------------------ START: MODULE EDITIEREN/ADDEN ETC.
     echo '
           <!-- *** OUTPUT OF ARTICLE-CONTENT-EDIT-MODE - START *** -->
           <div class="rex-content-editmode">
           ';
     $CONT = new rex_article();
     $CONT->getContentAsQuery();
     $CONT->info = $info;
     $CONT->warning = $warning;
     $CONT->template_attributes = $template_attributes;
     $CONT->setArticleId($article_id);
     $CONT->setSliceId($slice_id);
     $CONT->setMode($mode);
     $CONT->setCLang($clang);
     $CONT->setEval(TRUE);
     $CONT->setSliceRevision($slice_revision);
     $CONT->setFunction($function);
     echo $CONT->getArticle($ctype);
     echo '
           </div>
           <!-- *** OUTPUT OF ARTICLE-CONTENT-EDIT-MODE - END *** -->
           ';
开发者ID:BackupTheBerlios,项目名称:redaxo-svn,代码行数:31,代码来源:content.inc.php

示例5: rex_generateArticle

/**
 * Generiert alle *.article u. *.content Dateien eines Artikels/einer Kategorie
 *
 * @param $id ArtikelId des Artikels, der generiert werden soll
 * @param $refreshall Boolean Bei True wird der Inhalte auch komplett neu generiert, bei False nur die Metainfos
 * 
 * @return TRUE bei Erfolg, FALSE wenn eine ungütlige article_id übergeben wird
 */
function rex_generateArticle($id, $refreshall = true)
{
    global $REX, $I18N;
    // artikel generieren
    // vorraussetzung: articel steht schon in der datenbank
    //
    // -> infos schreiben -> abhaengig von clang
    // --> artikel infos / einzelartikel metadaten
    // --> artikel content / einzelartikel content
    // --> listen generieren // wenn startpage = 1
    // ---> artikel liste
    // ---> category liste
    foreach ($REX['CLANG'] as $clang => $clang_name) {
        $CONT = new rex_article();
        $CONT->setCLang($clang);
        $CONT->getContentAsQuery();
        // Content aus Datenbank holen, no cache
        $CONT->setEval(FALSE);
        // Content nicht ausführen, damit in Cachedatei gespeichert werden kann
        if (!$CONT->setArticleId($id)) {
            return FALSE;
        }
        // ----------------------- generiere generated/articles/xx.article
        $MSG = rex_generateArticleMeta($id, $clang);
        if ($MSG === FALSE) {
            return FALSE;
        }
        if ($refreshall) {
            // ----------------------- generiere generated/articles/xx.content
            $MSG = rex_generateArticleContent($id, $clang);
            if ($MSG === FALSE) {
                return FALSE;
            }
        }
        // ----- EXTENSION POINT
        $MSG = rex_register_extension_point('CLANG_ARTICLE_GENERATED', '', array('id' => $id, 'clang' => $clang, 'article' => $CONT));
        if ($MSG != '') {
            echo rex_warning($MSG);
        }
        // --------------------------------------------------- Listen generieren
        if ($CONT->getValue("startpage") == 1) {
            rex_generateLists($id);
            rex_generateLists($CONT->getValue("re_id"));
        } else {
            rex_generateLists($CONT->getValue("re_id"));
        }
    }
    // ----- EXTENSION POINT
    $MSG = rex_register_extension_point('ARTICLE_GENERATED', '', array('id' => $id));
    return TRUE;
}
开发者ID:BackupTheBerlios,项目名称:redaxo-svn,代码行数:59,代码来源:function_rex_generate.inc.php


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