コード例 #1
0
/**
 * Draw normal options page.
 */
function simplepie_core_options_page()
{
    global $simplepie_loaded;
    if ($simplepie_loaded) {
        if ($e = version_compare(SimplePie_Core::convert_to_version(SIMPLEPIE_BUILD), SimplePie_Core::convert_to_version($simplepie_core_build)) > -1) {
            echo '<div id="message" class="updated fade">Another extension has already loaded the SimplePie API, but it\'s loading a version that is the same or newer than what we\'re trying to load. It would be better, however, if that extension loaded this version of the SimplePie API instead. Contact the author of the conflicting plugin, and let them know about this plugin.</div>';
        } else {
            echo '<div id="message" class="updated fade">Another extension has already loaded an older version of the SimplePie API, so to avoid conflicts we will not load our version. This means that you don\'t have the latest version of SimplePie available to your extensions. Contact the author of the conflicting plugin, and let them know about this plugin.</div>';
        }
    }
    ?>

<div style="margin:50px auto; text-align:center;">
	<h3>SimplePie core API library, version <?php 
    echo SIMPLEPIE_VERSION;
    ?>
</h3>
	<p>(Built <?php 
    echo date('D, j M Y \\a\\t H:i:s T', strtotime(SIMPLEPIE_BUILD));
    ?>
) is available to your other extensions. Read the <a href="http://simplepie.org/wiki/misc/release_notes/simplepie_1.1">Release Notes</a>.</p>
</div>

<?php 
}
コード例 #2
0
ファイル: utils.php プロジェクト: netcon-source/apps
 /**
  * Perform a "slim" fetch of a feed from remote.
  * Differently from Utils::fetch(), it doesn't retrieve items nor a favicon
  *
  * @param url remote url of the feed
  * @returns an instance of OC_News_Feed
  */
 public static function slimFetch($url)
 {
     $spfeed = new \SimplePie_Core();
     $spfeed->set_feed_url($url);
     $spfeed->enable_cache(false);
     $spfeed->set_stupidly_fast(true);
     if (!$spfeed->init()) {
         return null;
     }
     //temporary try-catch to bypass SimplePie bugs
     try {
         $title = $spfeed->get_title();
         $feed = new Feed($url, $title);
         return $feed;
     } catch (Exception $e) {
         return null;
     }
 }