PluginProbe
FeedWordPress / trunk
FeedWordPress vtrunk
trunk 0.8 0.9 0.91 0.95 0.96 0.97 0.98 0.981 0.99 0.991 0.992 0.993 2008.1030 2008.1101 2008.1105 2008.1214 2009.0612 2009.0613 2009.0618 2009.0707 2009.1111 2009.1112 2010.0127 2010.0528 All 65 releases
feedwordpress / magpiemocklink.class.php

magpiemocklink.class.php in FeedWordPress trunk, at magpiemocklink.class.php

51 lines 1.2 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 require_once(dirname(__FILE__) . '/syndicatedlink.class.php');
3
4 class MagpieMockLink extends SyndicatedLink {
5 var $url;
6
7 function __construct( $rss, $url ) {
8 $this->link = $rss;
9
10 if (is_array($rss) and isset($rss['simplepie']) and isset($rss['magpie'])) :
11 $this->simplepie = $rss['simplepie'];
12 $this->magpie = $rss['magpie'];
13 else :
14 $this->magpie = $rss;
15 endif;
16
17 $this->url = $url;
18 $this->id = -1;
19 $this->settings = array(
20 'unfamiliar category' => 'default',
21
22 );
23 } /* function MagpieMockLink::MagpieMockLink () */
24
25 function MagpieMockLink( $rss, $url ) {
26 self::__construct( $rss, $url );
27 }
28
29 function poll ($crash_ts = NULL) {
30 // Do nothing but update copy of feed
31 $this->simplepie = FeedWordPress::fetch($this->url);
32 $this->magpie = new MagpieFromSimplePie($this->simplepie);
33
34 $this->link = $this->magpie;
35 } /* function MagpieMockLink::poll () */
36
37 function uri ($params = array()) {
38 return $this->url;
39 } /* function MagpieMockLink::uri() */
40
41 function homepage ($fromFeed = true) {
42 return ( !is_wp_error($this->simplepie) ? $this->simplepie->get_link() : null);
43 } /* function MagpieMockLink::homepage () */
44
45 function save_settings ($reload = false) {
46 // NOOP.
47 }
48 } /* class MagpieMockLink */
49
50
51