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


PHP Blog::getSettingsData方法代码示例

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


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

function blog_display_posts()
{
    global $content, $blogSettings, $data_index;
    // Declare GLOBAL variables
    $Blog = new Blog();
    // Create a new instance of the Blog class
    $slug = base64_encode(return_page_slug());
    // Determine the page we are on.
    $blogSettings = $Blog->getSettingsData();
    // Get the blog's settings
    $blog_slug = base64_encode($blogSettings["blogurl"]);
    // What page should the blog show on?
    if ($slug == $blog_slug) {
        // If we are on the page that should be showing the blog...
        $content = '';
        // Legacy support
        ob_start();
        // Create a buffer to load everything into
        switch (true) {
            // Ok, so what are we going to do?
            case isset($_GET['post']) == true:
                // Display a post
                $post_file = BLOGPOSTSFOLDER . $_GET['post'] . '.xml';
                // Get the post's XML file
                show_blog_post($post_file);
                // Show the post
                break;
            case isset($_POST['search_blog']) == true:
                // Search the blog
                search_posts($_POST['keyphrase']);
                // Search the blog with the given keyphrase
                break;
            case isset($_GET['archive']) == true:
                // View the archives
                $archive = $_GET['archive'];
                // @TODO: Redundant? Revision required...
                show_blog_archive($archive);
                // Show the requested archive
                break;
            case isset($_GET['tag']) == true:
                // Show specific post by tag
                $tag = $_GET['tag'];
                // @TODO: Redundant? Revision required...
                show_blog_tag($tag);
                // Show all posts that have the given tag
                break;
            case isset($_GET['category']) == true:
                // Show a category of posts
                $category = $_GET['category'];
                // @TODO: Redundant? Revision required...
                show_blog_category($category);
                // Show posts from the requested category
                break;
            case isset($_GET['import']):
                // RSS Auto-Importer
                auto_import();
                // Let the RSS Auto-Importer do its thing
                break;
            default:
                // None of the above?
                show_all_blog_posts();
                // Lets just show all the posts then
                break;
        }
        $content = ob_get_contents();
        // Legacy support
        ob_end_clean();
        // Output the buffer to the user.
    }
    return $content;
    // legacy support for non filter hook calls to this function
}
开发者ID:Luigi-,项目名称:gs-blog,代码行数:72,代码来源:frontEndFunctions.php

示例3: includeRssFeed

/** 
* Include RSS Feed (Link goes is included in header of front end pages)
* 
* @return void
*/
function includeRssFeed()
{
    global $SITEURL;
    $locationOfFeed = $SITEURL . "rss.rss";
    $blog = new Blog();
    $blogTitle = htmlspecialchars($blog->getSettingsData("rsstitle"));
    echo '<link href="' . $locationOfFeed . '" rel="alternate" type="application/rss+xml" title="' . $blogTitle . '">';
}
开发者ID:hatasu,项目名称:appdroid,代码行数:13,代码来源:common.php

示例4: show_settings_admin

function show_settings_admin()
{
    # Init function
    global $SITEURL;
    // Declare required GLOBALS
    $Blog = new Blog();
    // Bring in the Blog class
    # Build the array of setting to save to the blog_settings.xml file
    if (isset($_POST['blog_settings'])) {
        // The user has submitted an update.
        $blog_settings_array = array('blogurl' => !empty($_POST['blog_url']) ? $_POST['blog_url'] : $Blog->getSettingsData("blogurl"), 'template' => !empty($_POST['template']) ? $_POST['template'] : $Blog->getSettingsData("template"), 'excerptlength' => !empty($_POST['excerpt_length']) ? $_POST['excerpt_length'] : $Blog->getSettingsData("excerptlength"), 'postformat' => !empty($_POST['show_excerpt']) ? $_POST['show_excerpt'] : $Blog->getSettingsData("postformat"), 'postperpage' => !empty($_POST['posts_per_page']) ? $_POST['posts_per_page'] : $Blog->getSettingsData("postperpage"), 'recentposts' => !empty($_POST['recent_posts']) ? $_POST['recent_posts'] : $Blog->getSettingsData("recentposts"), 'prettyurls' => !empty($_POST['pretty_urls']) ? $_POST['pretty_urls'] : $Blog->getSettingsData("prettyurls"), 'autoimporter' => !empty($_POST['auto_importer']) ? $_POST['auto_importer'] : $Blog->getSettingsData("autoimporter"), 'autoimporterpass' => !empty($_POST['auto_importer_pass']) ? $_POST['auto_importer_pass'] : $Blog->getSettingsData("autoimporterpass"), 'rsstitle' => !empty($_POST['rss_title']) ? $_POST['rss_title'] : $Blog->getSettingsData("rsstitle"), 'rssinclude' => !empty($_POST['rss_include']) ? $_POST['rss_include'] : $Blog->getSettingsData("rssinclude"), 'rssdescription' => !empty($_POST['rss_description']) ? $_POST['rss_description'] : $Blog->getSettingsData("rssdescription"), 'rssfeedposts' => !empty($_POST['rss_feed_num_posts']) ? $_POST['rss_feed_num_posts'] : $Blog->getSettingsData("rssfeedposts"), 'archivepostcount' => !empty($_POST['display_archives_post_count']) ? $_POST['display_archives_post_count'] : $Blog->getSettingsData("archivespostcount"));
        # Attempt to save the settings array to file.
        if ($Blog->saveSettings($blog_settings_array)) {
            // Success: Notify the user.
            echo '<script>clearNotify();notifyOk(\'' . i18n_r(BLOGFILE . '/SETTINGS_SAVE_OK') . '\').popit().removeit();</script>';
        } else {
            // Failed: Notify the user.
            echo '<script>clearNotify();notifyError(\'' . i18n_r(BLOGFILE . '/SETTINGS_SAVE_ERROR') . '\').popit().removeit();</script>';
        }
    }
    # Include the HTML for the settings page we are trying to display.
    if ($_GET['settings'] == 'rss') {
        // RSS Auto-Importer settings
        require_once 'html/settings-rss.php';
    } else {
        // The default main settings page
        require_once 'html/settings-main.php';
    }
}
开发者ID:hatasu,项目名称:appdroid,代码行数:29,代码来源:adminFunctions.php

示例5: includeRssFeed

function includeRssFeed()
{
    global $SITEURL;
    // Declare GLOBAL variables
    $locationOfFeed = $SITEURL . "rss.rss";
    // Define location of the RSS file.
    $blog = new Blog();
    // Create instance of the BLOG class
    $blogTitle = htmlspecialchars($blog->getSettingsData("rsstitle"));
    // Get the RSS feed title
    echo '<link href="' . $locationOfFeed . '"
    rel="alternate" type="application/rss+xml" title="' . $blogTitle . '">';
    // Echo out the <link>
}
开发者ID:hatasu,项目名称:appdroid,代码行数:14,代码来源:common.php

示例6: feedBurnerTool

/** 
* Display Feed Burner Tool
* 
* @return void
*/
function feedBurnerTool()
{
    $Blog = new Blog();
    ?>
		<a href="<?php 
    echo $Blog->getSettingsData("feedburnerlink");
    ?>
" title="Subscribe to my feed" rel="alternate" type="application/rss+xml"><img src="http://www.feedburner.com/fb/images/pub/feed-icon32x32.png" alt="" style="border:0"/></a><a href="<?php 
    echo $Blog->getSettingsData("feedburnerlink");
    ?>
" title="Subscribe to my feed" rel="alternate" type="application/rss+xml">Subscribe in a reader</a>
	<?php 
}
开发者ID:hatasu,项目名称:appdroid,代码行数:18,代码来源:frontEndFunctions.php

示例7: blog_display_posts

/** 
* Conditionals to display posts/search/archive/tags/category/importer on front end of website
* 
* @return void
*/
function blog_display_posts()
{
    global $content, $blogSettings;
    $Blog = new Blog();
    $slug = base64_encode(return_page_slug());
    $blogSettings = $Blog->getSettingsData();
    $blog_slug = base64_encode($blogSettings["blogurl"]);
    if ($slug == $blog_slug) {
        $content = '';
        ob_start();
        if ($blogSettings["displaycss"] == 'Y') {
            echo "<style>\n";
            echo $blogSettings["csscode"];
            echo "\n</style>";
        }
        switch (true) {
            case isset($_GET['post']) == true:
                $post_file = BLOGPOSTSFOLDER . $_GET['post'] . '.xml';
                show_blog_post($post_file);
                break;
            case isset($_POST['search_blog']) == true:
                search_posts($_POST['keyphrase']);
                break;
            case isset($_GET['archive']) == true:
                $archive = $_GET['archive'];
                show_blog_archive($archive);
                break;
            case isset($_GET['tag']) == true:
                $tag = $_GET['tag'];
                show_blog_tag($tag);
                break;
            case isset($_GET['category']) == true:
                $category = $_GET['category'];
                show_blog_category($category);
                break;
            case isset($_GET['import']):
                auto_import();
                break;
            default:
                show_all_blog_posts();
                break;
        }
        $content = ob_get_contents();
        ob_end_clean();
    }
    return $content;
    // legacy support for non filter hook calls to this function
}
开发者ID:hatasu,项目名称:appdroid,代码行数:53,代码来源:blog.php

示例8: show_help_admin


//.........这里部分代码省略.........
    ?>
:</label>
		<?php 
    highlight_string('<?php show_blog_categories(); ?>');
    ?>
	</p>
	<p>
		<label><?php 
    i18n(BLOGFILE . '/HELP_SEARCH');
    ?>
:</label>
		<?php 
    highlight_string('<?php show_blog_search(); ?>');
    ?>
	</p>
	<p>
		<label><?php 
    i18n(BLOGFILE . '/HELP_ARCHIVES');
    ?>
:</label>
		<?php 
    highlight_string('<?php show_blog_archives(); ?>');
    ?>
	</p>
	<p>
		<label><?php 
    i18n(BLOGFILE . '/HELP_RECENT');
    ?>
:</label>
		<?php 
    highlight_string('<?php show_blog_recent_posts(); ?>');
    ?>
<br/><br/>
		<?php 
    i18n(BLOGFILE . '/HELP_RECENT_2');
    ?>
: <br/>
		<?php 
    highlight_string('<?php ($excerpt=false, $excerpt_length=null, $thumbnail=null, $read_more=null) ?>');
    ?>
<br/>
		<?php 
    i18n(BLOGFILE . '/HELP_RECENT_3');
    ?>
:<br/>
		<?php 
    highlight_string('<?php show_blog_recent_posts(true, null, true, true); ?>');
    ?>
<br/>
	</p>
	<p>
		<label><?php 
    i18n(BLOGFILE . '/RSS_LOCATION');
    ?>
 :</label>
		<a href="<?php 
    echo $SITEURL . "rss.rss";
    ?>
" target="_blank"><?php 
    echo $SITEURL . "rss.rss";
    ?>
</a>
	</p>
	<p>
		<label><?php 
    i18n(BLOGFILE . '/DYNAMIC_RSS_LOCATION');
    ?>
 :</label>
		<a href="<?php 
    echo $SITEURL . "plugins/blog/rss.php";
    ?>
" target="_blank"><?php 
    echo $SITEURL . "plugins/blog/rss.php";
    ?>
</a>
	</p>

	<h3><?php 
    i18n(BLOGFILE . '/AUTO_IMPORTER_TITLE');
    ?>
</h3>
	<p>
		<?php 
    i18n(BLOGFILE . '/AUTO_IMPORTER_DESC');
    ?>
		<br/>
		<strong>lynx -dump <?php 
    echo $SITEURL;
    ?>
index.php?id=<?php 
    echo $Blog->getSettingsData("blogurl");
    ?>
&import=<?php 
    echo $Blog->getSettingsData("autoimporterpass");
    ?>
 > /dev/null</strong>
	</p>
	<?php 
    blog_page_help_html();
}
开发者ID:hatasu,项目名称:appdroid,代码行数:101,代码来源:adminFunctions.php


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