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


PHP Blog::create_excerpt方法代码示例

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


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

示例1: auto_import

function auto_import()
{
    $Blog = new Blog();
    if ($_GET['import'] == urldecode($Blog->getSettingsData("autoimporterpass")) && $Blog->getSettingsData("autoimporter") == 'Y') {
        ini_set("memory_limit", "350M");
        define('MAGPIE_CACHE_DIR', GSCACHEPATH . 'magpierss/');
        require_once BLOGPLUGINFOLDER . 'inc/magpierss/rss_fetch.inc';
        $rss_feed_file = getXML(BLOGRSSFILE);
        foreach ($rss_feed_file->rssfeed as $the_fed) {
            $rss_uri = $the_fed->feed;
            $rss_category = $the_fed->category;
            $rss = fetch_rss($rss_uri);
            $items = array_slice($rss->items, 0);
            foreach ($items as $item) {
                $post_data['title'] = $item['title'];
                $post_data['slug'] = '';
                $post_data['date'] = $item['pubdate'];
                $post_data['private'] = '';
                $post_data['tags'] = '';
                $post_data['category'] = $rss_category;
                if ($Blog->getSettingsData('rssinclude') == 'Y') {
                    if (!empty($item['content']['encoded'])) {
                        $post_data['content'] = htmlentities($item['content']['encoded'], ENT_QUOTES, 'iso-8859-1');
                    } else {
                        $post_data['content'] = htmlentities($item['summary'], ENT_QUOTES, 'iso-8859-1') . '<p class="blog_auto_import_readmore"><a href="' . $item['link'] . '" target="_blank">' . i18n_r(BLOGFILE . '/READ_FULL_ARTICLE') . '</a></p>';
                    }
                } else {
                    $post_data['content'] = htmlentities($item['summary'], ENT_QUOTES, 'iso-8859-1') . '<p class="blog_auto_import_readmore"><a href="' . $item['link'] . '" target="_blank">' . i18n_r(BLOGFILE . '/READ_FULL_ARTICLE') . '</a></p>';
                }
                $post_data['excerpt'] = $Blog->create_excerpt($item['summary'], 0, $Blog->getSettingsData("excerptlength"));
                $post_data['thumbnail'] = auto_import_thumbnail($item);
                $post_data['current_slug'] = '';
                $post_data['author'] = htmlentities('<a href="' . $rss_uri . '">RSS Feed</a>', ENT_QUOTES, 'iso-8859-1');
                $Blog->savePost($post_data, true);
                echo '<p class="blog_rss_post_added">' . i18n_r(BLOGFILE . '/ADDED') . ': ' . $post_data['title'] . '</p>';
            }
        }
    }
}
开发者ID:hatasu,项目名称:appdroid,代码行数:39,代码来源:rssAutoImporter.php

示例2: set_post_description

function set_post_description()
{
    global $metad, $post, $blogSettings;
    // Declare GLOBAL variables
    $Blog = new Blog();
    // Create a new instance of the Blog class
    if (isset($_GET['id']) && $_GET['id'] == $blogSettings['blogurl'] && isset($_GET['post'])) {
        $excerpt_length = $blogSettings["excerptlength"] == '' ? 150 : $blogSettings["excerptlength"];
        $metad = $Blog->create_excerpt(html_entity_decode($post->content), 0, $excerpt_length);
    }
}
开发者ID:Luigi-,项目名称:gs-blog,代码行数:11,代码来源:frontEndFunctions.php

示例3: set_post_description

function set_post_description()
{
    global $metad, $post, $blogSettings;
    $Blog = new Blog();
    if ($blogSettings["postdescription"] == 'Y') {
        $excerpt_length = $blogSettings["excerptlength"] == '' ? 150 : $blogSettings["excerptlength"];
        $metad = $Blog->create_excerpt(html_entity_decode($post->content), 0, $excerpt_length);
    }
}
开发者ID:hatasu,项目名称:appdroid,代码行数:9,代码来源:frontEndFunctions.php


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