WordPress.org

Plugin Directory

Changeset 1553712 for feedwordpress


Ignore:
Timestamp:
12/13/16 13:50:22 (9 months ago)
Author:
radgeek
Message:

Version 2016.1213 - WP 4.5-4.6.x backward compatibility restored; some PHP warnings suppressed.

Location:
feedwordpress/trunk
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • feedwordpress/trunk/admin-ui.php

    r1551908 r1553712  
    11<?php 
    22class FeedWordPressAdminPage { 
    3     var $context; 
    4     var $updated = false; 
    5     var $mesg = NULL; 
     3    protected $context; 
     4    protected $updated = false; 
     5    protected $mesg = NULL; 
    66 
    77    var $link = NULL; 
     
    2525    } /* FeedWordPressAdminPage constructor */ 
    2626 
    27     function pageslug () { 
     27    public function pageslug () { 
    2828        $slug = preg_replace('/FeedWordPress(.*)Page/', '$1', get_class($this)); 
    2929        return strtolower($slug); 
    3030    } 
    3131 
    32     function pagename ($context = NULL) { 
     32    public function pagename ($context = NULL) { 
    3333        if (is_null($context)) : 
    3434            $context = 'default'; 
     
    4545    } /* FeedWordPressAdminPage::pagename () */ 
    4646 
    47     function accept_POST ($post) { 
     47    public function accept_POST ($post) { 
    4848        if ($this->for_feed_settings() and $this->update_requested_in($post)) : 
    4949            $this->update_feed(); 
     
    5454    } 
    5555 
    56     function update_feed () { 
     56    public function update_feed () { 
    5757        global $feedwordpress; 
    5858 
     
    8686    } 
    8787 
    88     function save_settings ($post) { 
     88    public function save_settings ($post) { 
    8989        do_action($this->dispatch.'_save', $post, $this); 
    9090 
     
    103103    } /* FeedWordPressAdminPage::save_settings () */ 
    104104 
    105     function for_feed_settings () { return (is_object($this->link) and method_exists($this->link, 'found') and $this->link->found()); } 
    106     function for_default_settings () { return !$this->for_feed_settings(); } 
    107  
    108     function setting ($names, $fallback_value = NULL, $params = array()) { 
     105    public function for_feed_settings () { return (is_object($this->link) and method_exists($this->link, 'found') and $this->link->found()); } 
     106    public function for_default_settings () { return !$this->for_feed_settings(); } 
     107 
     108    public function setting ($names, $fallback_value = NULL, $params = array()) { 
    109109        if (!is_array($params)) : 
    110110            $params = array('default' => $params); 
     
    132132    } 
    133133 
    134     function update_setting ($names, $value, $default = 'default') { 
     134    public function update_setting ($names, $value, $default = 'default') { 
    135135        if (is_string($names)) : 
    136136            $feed_name = $names; 
     
    148148    } /* FeedWordPressAdminPage::update_setting () */ 
    149149 
    150     function save_requested_in ($post) { 
     150    public function save_requested_in ($post) { 
    151151        return (isset($post['save']) or isset($post['submit'])); 
    152152    } 
    153     function update_requested_in ($post) { 
     153    public function update_requested_in ($post) { 
    154154        return (isset($post['update']) and (strlen($post['update']) > 0)); 
    155155    } 
    156156 
    157     /*static*/ function submitted_link_id () { 
     157    public function submitted_link_id () { 
    158158        global $fwp_post; 
    159159 
     
    180180    } /* FeedWordPressAdminPage::submitted_link_id() */ 
    181181 
    182     /*static*/ function submitted_link () { 
    183         $link_id = FeedWordPressAdminPage::submitted_link_id(); 
     182    public function submitted_link () { 
     183        $link_id = $this->submitted_link_id(); 
    184184        if (is_numeric($link_id) and $link_id) : 
    185185            $link = new SyndicatedLink($link_id); 
     
    190190    } /* FeedWordPressAdminPage::submitted_link () */ 
    191191 
    192     function stamp_link_id ($field = null) { 
     192    public function stamp_link_id ($field = null) { 
    193193        if (is_null($field)) : $field = 'save_link_id'; endif; 
    194194        ?> 
     
    197197    } /* FeedWordPressAdminPage::stamp_link_id () */ 
    198198 
    199     function these_posts_phrase () { 
     199    public function these_posts_phrase () { 
    200200        if ($this->for_feed_settings()) : 
    201201            $phrase = __('posts from this feed'); 
     
    215215     * @see do_meta_boxes() 
    216216     */ 
    217     function meta_box_context () { 
     217    public function meta_box_context () { 
    218218        return $this->context; 
    219219    } /* FeedWordPressAdminPage::meta_box_context () */ 
     
    224224     * @uses FeedWordPressAdminPage::meta_box_context() 
    225225     */ 
    226      function fix_toggles () { 
     226     public function fix_toggles () { 
    227227         FeedWordPressSettingsUI::fix_toggles_js($this->meta_box_context()); 
    228228     } /* FeedWordPressAdminPage::fix_toggles() */ 
    229229 
    230      function ajax_interface_js () { 
     230     public function ajax_interface_js () { 
    231231?> 
    232232    function contextual_appearance (item, appear, disappear, value, visibleStyle, checkbox) { 
     
    247247    } /* FeedWordPressAdminPage::ajax_interface_js () */ 
    248248 
    249     function admin_page_href ($page, $params = array(), $link = NULL) { 
     249    public function admin_page_href ($page, $params = array(), $link = NULL) { 
    250250        global $fwp_path; 
    251251 
     
    279279    } /* FeedWordPressAdminPage::admin_page_href () */ 
    280280 
    281     function display_feed_settings_page_links ($params = array()) { 
     281    public function display_feed_settings_page_links ($params = array()) { 
    282282        global $fwp_path; 
    283283 
     
    339339    } /* FeedWordPressAdminPage::display_feed_settings_page_links */ 
    340340 
    341     function display_feed_select_dropdown() { 
     341    public function display_feed_select_dropdown() { 
    342342        $links = FeedWordPress::syndicated_links(); 
    343343 
     
    371371    } /* FeedWordPressAdminPage::display_feed_select_dropdown() */ 
    372372 
    373     function display_sheet_header ($pagename = 'Syndication', $all = false) { 
     373    public function display_sheet_header ($pagename = 'Syndication', $all = false) { 
    374374        global $fwp_path; 
    375375        ?> 
     
    379379    } 
    380380 
    381     function display_update_notice_if_updated ($pagename = 'Syndication', $mesg = NULL) { 
     381    public function display_update_notice_if_updated ($pagename = 'Syndication', $mesg = NULL) { 
    382382        if (!is_null($mesg)) : 
    383383            $this->mesg = $mesg; 
     
    401401    } /* FeedWordPressAdminPage::display_update_notice_if_updated() */ 
    402402 
    403     function display_settings_scope_message () { 
     403    public function display_settings_scope_message () { 
    404404        if ($this->for_feed_settings()) : 
    405405        ?> 
     
    417417    /*static*/ function has_link () { return true; } 
    418418 
    419     function form_action ($filename = NULL) { 
     419    public function form_action ($filename = NULL) { 
    420420        global $fwp_path; 
    421421 
     
    426426    } /* FeedWordPressAdminPage::form_action () */ 
    427427 
    428     function update_message () { 
     428    public function update_message () { 
    429429        return $this->mesg; 
    430430    } 
    431431 
    432     function display () { 
     432    public function display () { 
    433433        global $fwp_post; 
    434434 
     
    491491    } 
    492492 
    493     function open_sheet ($header) { 
     493    public function open_sheet ($header) { 
    494494        // Set up prepatory AJAX stuff 
    495495        ?> 
     
    546546    } /* FeedWordPressAdminPage::open_sheet () */ 
    547547 
    548     function close_sheet () { 
     548    public function close_sheet () { 
    549549        ?> 
    550550 
     
    561561    } /* FeedWordPressAdminPage::close_sheet () */ 
    562562 
    563     function setting_radio_control ($localName, $globalName, $options, $params = array()) { 
     563    public function setting_radio_control ($localName, $globalName, $options, $params = array()) { 
    564564        global $fwp_path; 
    565565 
     
    728728    } /* FeedWordPressAdminPage::setting_radio_control () */ 
    729729 
    730     function save_button ($caption = NULL) { 
     730    public function save_button ($caption = NULL) { 
    731731        if (is_null($caption)) : $caption = __('Save Changes'); endif; 
    732732        ?> 
     
    794794 
    795795    $tax_name = $params['taxonomy']; 
    796     $taxonomy = get_taxonomy($params['taxonomy']); 
    797     $disabled = (!current_user_can($taxonomy->cap->assign_terms) ? 'disabled="disabled"' : ''); 
     796     
     797    $oTax = get_taxonomy($params['taxonomy']); 
     798    $oTaxLabels = get_taxonomy_labels($oTax); 
     799     
     800    $disabled = (!current_user_can($oTax->cap->assign_terms) ? 'disabled="disabled"' : ''); 
    798801 
    799802    $desc = "<p style=\"font-size:smaller;font-style:bold;margin:0\">Tag $object as...</p>"; 
     
    823826    <div class="jaxtag"> 
    824827    <div class="nojs-tags hide-if-js"> 
    825     <p><?php echo $taxonomy->labels->add_or_remove_items; ?></p> 
     828    <p><?php echo $oTaxLabels->add_or_remove_items; ?></p> 
    826829    <textarea name="<?php echo $params['textarea_name']; ?>" class="the-tags" id="<?php echo $params['textarea_id']; ?>"><?php echo esc_attr(implode(",", $tags)); ?></textarea></div> 
    827830 
    828     <?php if ( current_user_can($taxonomy->cap->assign_terms) ) :?> 
     831    <?php if ( current_user_can($oTax->cap->assign_terms) ) :?> 
    829832    <div class="ajaxtag hide-if-no-js"> 
    830833        <label class="screen-reader-text" for="<?php echo $params['input_id']; ?>"><?php echo $params['box_title']; ?></label> 
    831         <div class="taghint"><?php echo $taxonomy->labels->add_new_item; ?></div> 
     834        <div class="taghint"><?php echo $oTaxLabels->add_new_item; ?></div> 
    832835        <p><input type="text" id="<?php print $params['input_id']; ?>" name="<?php print $params['input_name']; ?>" class="newtag form-input-tip" size="16" autocomplete="off" value="" /> 
    833836        <input type="button" class="button tagadd" value="<?php esc_attr_e('Add'); ?>" tabindex="3" /></p> 
    834837    </div> 
    835     <p class="howto"><?php echo esc_attr( $taxonomy->labels->separate_items_with_commas ); ?></p> 
     838    <p class="howto"><?php echo esc_attr( $oTaxLabels->separate_items_with_commas ); ?></p> 
    836839    <?php endif; ?> 
    837840    </div> 
     
    839842    <div class="tagchecklist"></div> 
    840843</div> 
    841 <?php if ( current_user_can($taxonomy->cap->assign_terms) ) : ?> 
    842 <p class="hide-if-no-js"><a href="#titlediv" class="tagcloud-link" id="link-<?php echo $tax_name; ?>"><?php echo $taxonomy->labels->choose_from_most_used; ?></a></p> 
     844<?php if ( current_user_can($oTax->cap->assign_terms) ) : ?> 
     845<p class="hide-if-no-js"><a href="#titlediv" class="tagcloud-link" id="link-<?php echo $tax_name; ?>"><?php echo $oTaxLabels->choose_from_most_used; ?></a></p> 
    843846<?php endif; 
    844847 
     
    855858        $taxonomy = (isset($params['taxonomy']) ? $params['taxonomy'] : 'category'); 
    856859    endif; 
    857     $tax = get_taxonomy($taxonomy); 
     860     
     861    $oTax = get_taxonomy($taxonomy); 
     862    $oTaxLabels = get_taxonomy_labels($oTax); 
    858863 
    859864    if (strlen($prefix) > 0) : 
     
    871876  <ul id="<?php print $idPrefix; ?><?php print $taxonomy; ?>-tabs" class="category-tabs"> 
    872877    <li class="ui-tabs-selected tabs"><a href="#<?php print $idPrefix; ?><?php print $taxonomy; ?>-all" tabindex="3"><?php _e( 'All posts' ); ?></a> 
    873     <p style="font-size:smaller;font-style:bold;margin:0">Give <?php print $object; ?> these <?php print $tax->labels->name; ?></p> 
     878    <p style="font-size:smaller;font-style:bold;margin:0">Give <?php print $object; ?> these <?php print $oTaxLabels->name; ?></p> 
    874879    </li> 
    875880  </ul> 
  • feedwordpress/trunk/authors-page.php

    r1551908 r1553712  
    88    public function __construct( $link = -1 ) { 
    99        if (is_numeric($link) and -1 == $link) : 
    10             $link = parent::submitted_link(); 
     10            $link = $this->submitted_link(); 
    1111        endif; 
    1212 
  • feedwordpress/trunk/feeds-page.php

    r1551908 r1553712  
    8686    public function __construct( $link = -1 ) { 
    8787        if (is_numeric($link) and -1 == $link) : 
    88             $link = parent::submitted_link(); 
     88            $link = $this->submitted_link(); 
    8989        endif; 
    9090 
  • feedwordpress/trunk/feedwordpress.php

    r1551908 r1553712  
    44Plugin URI: http://feedwordpress.radgeek.com/ 
    55Description: simple and flexible Atom/RSS syndication for WordPress 
    6 Version: 2016.1211 
     6Version: 2016.1213 
    77Author: Charles Johnson 
    88Author URI: http://radgeek.com/ 
     
    1212/** 
    1313 * @package FeedWordPress 
    14  * @version 2016.1211 
     14 * @version 2016.1213 
    1515 */ 
    1616 
     
    3333# -- Don't change these unless you know what you're doing... 
    3434 
    35 define ('FEEDWORDPRESS_VERSION', '2016.1211'); 
     35define ('FEEDWORDPRESS_VERSION', '2016.1213'); 
    3636define ('FEEDWORDPRESS_AUTHOR_CONTACT', 'http://radgeek.com/contact'); 
    3737 
     
    9292add_filter('wp_feed_cache_transient_lifetime', array('FeedWordPress', 'cache_lifetime')); 
    9393 
    94 // Ensure that we have SimplePie loaded up and ready to go. 
    95 // We no longer need a MagpieRSS upgrade module. Hallelujah! 
    96 if (!class_exists('SimplePie')) : 
    97     require_once(ABSPATH . WPINC . '/class-simplepie.php'); 
     94// Dependencies: modules packaged with WordPress core 
     95$wpCoreDependencies = array( 
     96"class:SimplePie" => "class-simplepie", 
     97"class:WP_Feed_Cache" => "class-wp-feed-cache", 
     98"class:WP_Feed_Cache_Transient" => "class-wp-feed-cache-transient", 
     99"class:WP_SimplePie_File" => "class-wp-simplepie-file", 
     100"class:WP_SimplePie_Sanitize_KSES" => "class-wp-simplepie-sanitize-kses", 
     101"function:wp_insert_user" => "registration", 
     102); 
     103 
     104// Ensure that we have SimplePie loaded up and ready to go 
     105// along with the WordPress auxiliary classes. 
     106$unmetCoreDependencies = array(); 
     107foreach ($wpCoreDependencies as $unit => $fileSlug) : 
     108    list($unitType, $unitName) = explode(":", $unit, 2); 
     109     
     110    $dependencyMet = (('class'==$unitType) ? class_exists($unitName) : function_exists($unitName)); 
     111    if (!$dependencyMet) : 
     112        $phpFileName = ABSPATH . WPINC . "/${fileSlug}.php"; 
     113        if (file_exists($phpFileName)) : 
     114            require_once($phpFileName); 
     115        else : 
     116            $unmetCoreDependencies[] = $unitName; 
     117        endif; 
     118    endif; 
     119endforeach; 
     120 
     121// Fallback garbage-pail module used in WP < 4.7 which may meet our dependencies 
     122if (count($unmetCoreDependencies) > 0) : 
     123    require_once(ABSPATH . WPINC . "/class-feed.php"); 
    98124endif; 
    99125 
    100 require_once( ABSPATH . WPINC . '/class-wp-feed-cache.php' ); 
    101 require_once( ABSPATH . WPINC . '/class-wp-feed-cache-transient.php' ); 
    102 require_once( ABSPATH . WPINC . '/class-wp-simplepie-file.php' ); 
    103 require_once( ABSPATH . WPINC . '/class-wp-simplepie-sanitize-kses.php' ); 
    104  
    105 if (!function_exists('wp_insert_user')) : 
    106     require_once (ABSPATH . WPINC . '/registration.php'); // for wp_insert_user 
    107 endif; 
    108  
     126// Dependences: modules packaged with FeedWordPress plugin 
    109127$dir = dirname(__FILE__); 
    110128require_once("${dir}/externals/myphp/myphp.class.php"); 
     
    18051823 
    18061824        // Explicit update request in the HTTP request (e.g. from a cron job) 
    1807         if ($this->update_requested()) : 
     1825        if (self::update_requested()) : 
    18081826 
    18091827            $this->update_hooked = "Initiating a CRON JOB CHECK-IN ON UPDATE SCHEDULE due to URL parameter = ".trim($this->val($_REQUEST['update_feedwordpress'])); 
     
    18381856    } /* FeedWordPress::update_magic_url () */ 
    18391857 
    1840     public function update_requested () { 
     1858    public static function update_requested () { 
    18411859        return MyPHP::request('update_feedwordpress'); 
    18421860    } /* FeedWordPress::update_requested() */ 
     
    23112329        $diagnostic_nesting = count(explode(":", $level)); 
    23122330 
    2313         if (FeedWordPress::diagnostic_on($level)) : 
     2331        if (self::diagnostic_on($level)) : 
    23142332            foreach ($output as $method) : 
    23152333                switch ($method) : 
    23162334                case 'echo' : 
    2317                     if (!FeedWordPress::update_requested()) : 
     2335                    if (!self::update_requested()) : 
    23182336                        echo "<div><pre><strong>Diag".str_repeat('====', $diagnostic_nesting-1).'|</strong> '.$out."</pre></div>\n"; 
    23192337                    endif; 
    23202338                    break; 
    23212339                case 'echo_in_cronjob' : 
    2322                     if (FeedWordPress::update_requested()) : 
    2323                         echo FeedWordPress::log_prefix()." ".$out."\n"; 
     2340                    if (self::update_requested()) : 
     2341                        echo self::log_prefix()." ".$out."\n"; 
    23242342                    endif; 
    23252343                    break; 
     
    23282346                    break; 
    23292347                case 'error_log' : 
    2330                     error_log(FeedWordPress::log_prefix().' '.$out); 
     2348                    error_log(self::log_prefix().' '.$out); 
    23312349                    break; 
    23322350                case 'email' : 
  • feedwordpress/trunk/posts-page.php

    r1551908 r1553712  
    1414    public function __construct( $link = -1 ) { 
    1515        if (is_numeric($link) and -1 == $link) : 
    16             $link = parent::submitted_link(); 
     16            $link = $this->submitted_link(); 
    1717        endif; 
    1818 
  • feedwordpress/trunk/readme.txt

    r1551908 r1553712  
    33Donate link: http://feedwordpress.radgeek.com/ 
    44Tags: syndication, aggregation, feed, atom, rss 
    5 Requires at least: 3.0 
     5Requires at least: 4.5 
    66Tested up to: 4.7 
    7 Stable tag: 2016.1211 
     7Stable tag: 2016.1213 
    88 
    99FeedWordPress syndicates content from feeds you choose into your WordPress weblog.  
     
    9494== Changelog == 
    9595 
     96= 2016.1213 = 
     97 
     98*   WORDPRSS BACKWARD COMPATIBILITY FOR VERSIONS [4.5, 4.7]: This change fixes 
     99    a fatal PHP error (on some web server configurations you'd see the message 
     100    "Fatal error: require_once(): Failed opening required '[...]/wp-includes/class-wp-feed-cache.php'" 
     101    on others, you might just see an HTTP 500 Internal Server Error or a blank 
     102    page) when using FeedWordPress with versions of WordPress before 4.7. A 
     103    change that I introduced to avoid a code module that had been deprecated in 
     104    version 4.7 ended up relying on code modules that were only introduced as 
     105    of version 4.7; so now, instead, FeedWordPress attempts to detect which 
     106    modules the current version of the WordPress core makes available, and load 
     107    the right modules depending on your WordPress version. 
     108 
     109    In theory, up to this point, FeedWordPress supported any version of 
     110    WordPress from version 3.0 onward. In practice, version 3.0 was released 
     111    over 6 years ago, and I can realistically commit only to testing out new 
     112    releases of FeedWordPress with a few prior versions of WordPress; so I've 
     113    updated the "Requires at least" field to version 4.5, the first major 
     114    release issued in 2016. If you've really got to use FeedWordPress with 
     115    older versions of WordPress, it will probably still work with any moderately 
     116    modern release of WordPress, but I won't promise to keep it working with 
     117    releases of WordPress that are more than about a year old. 
     118     
    96119= 2016.1211 = 
    97120 
  • feedwordpress/trunk/syndicatedlink.class.php

    r1551908 r1553712  
    4444    var $magpie = null; 
    4545 
    46     function __construct( $link ) { 
     46    public function __construct( $link ) { 
    4747        global $wpdb; 
    4848 
     
    5555        endif; 
    5656 
    57         if (strlen($this->link->link_rss) > 0) : 
    58             $this->get_settings_from_notes(); 
     57        if (is_object($this->link)) : 
     58            if (strlen($this->link->link_rss) > 0) : 
     59                $this->get_settings_from_notes(); 
     60            endif; 
    5961        endif; 
    6062 
    6163        add_filter('feedwordpress_update_complete', array($this, 'process_retirements'), 1000, 1); 
    62     } /* SyndicatedLink::SyndicatedLink () */ 
    63  
    64     function SyndicatedLink( $link ) { 
    65         self::__construct( $link ); 
    66     } 
    67  
    68     function found () { 
     64    } /* SyndicatedLink::__construct () */ 
     65 
     66    public function found () { 
    6967        return is_object($this->link) and !is_wp_error($this->link); 
    7068    } /* SyndicatedLink::found () */ 
    7169 
    72     function id () { 
     70    public function id () { 
    7371        return (is_object($this->link) ? $this->link->link_id : NULL); 
    7472    } 
    7573 
    76     function stale () { 
     74    public function stale () { 
    7775        global $feedwordpress; 
    7876 
     
    9795    } /* SyndicatedLink::stale () */ 
    9896 
    99     function fetch () { 
     97    public function fetch () { 
    10098        $timeout = $this->setting('fetch timeout', 'feedwordpress_fetch_timeout', FEEDWORDPRESS_FETCH_TIMEOUT_DEFAULT); 
    10199 
     
    112110            $this->magpie = new MagpieFromSimplePie($this->simplepie, NULL); 
    113111        endif; 
    114     } 
    115     function live_posts () { 
     112    } /* SyndicatedLink::fetch () */ 
     113     
     114    public function live_posts () { 
    116115        if (!is_object($this->simplepie)) : 
    117116            $this->fetch(); 
     
    128127        endif; 
    129128        return $ret; 
    130     } 
    131  
    132     function poll ($crash_ts = NULL) { 
     129    } /* SyndicatedLink::live_posts () */ 
     130 
     131    public function poll ($crash_ts = NULL) { 
    133132        global $wpdb; 
    134133 
     
    366365    } /* SyndicatedLink::poll() */ 
    367366 
    368     function process_retirements ($delta) { 
     367    public function process_retirements ($delta) { 
    369368        global $post; 
    370369 
     
    387386 
    388387        return $delta; 
    389     } 
     388    } /* SyndicatedLink::process_retirements () */ 
    390389 
    391390    /** 
     
    395394     * @return bool TRUE on success, FALSE on failure. 
    396395     */ 
    397     function set_uri ($url) { 
     396    public function set_uri ($url) { 
    398397        global $wpdb; 
    399398 
     
    414413    } /* SyndicatedLink::set_uri () */ 
    415414 
    416     function deactivate () { 
     415    public function deactivate () { 
    417416        global $wpdb; 
    418417 
     
    422421    } /* SyndicatedLink::deactivate () */ 
    423422 
    424     function delete () { 
     423    /** 
     424     * SyndicatedLink::delete() deletes a subscription from the WordPress links 
     425     * table. Any posts that were syndicated through that subscription will still 
     426     * be present in the wp_posts table; but postmeta fields that refer to the 
     427     * syndication feed's numeric id (which will no longer be valid) will be 
     428     * deleted. For most purposes, the posts remaining will be treated as if they 
     429     * were locally authored posts rather than syndicated posts. 
     430     * 
     431     * @global $wpdb 
     432     * @uses wpdb::query 
     433     */ 
     434    public function delete () { 
    425435        global $wpdb; 
    426436 
     
    437447    } /* SyndicatedLink::delete () */ 
    438448 
    439     function nuke () { 
     449    /** 
     450     * SyndicatedLink::nuke() deletes a subscription AND all of the 
     451     * posts syndicated through that subscription. 
     452     * 
     453     * @global $wpdb 
     454     * @uses wpdb::get_col 
     455     * @uses wp_delete_post 
     456     * @uses SyndicatedLink::delete 
     457     */ 
     458    public function nuke () { 
    440459        global $wpdb; 
    441460 
     
    462481    } /* SyndicatedLink::nuke () */ 
    463482 
    464     function map_name_to_new_user ($name, $newuser_name) { 
     483    public function map_name_to_new_user ($name, $newuser_name) { 
    465484        global $wpdb; 
    466485 
     
    483502    } /* SyndicatedLink::map_name_to_new_user () */ 
    484503 
    485     function imploded_settings () { 
     504    protected function imploded_settings () { 
    486505        return array('cats', 'tags', 'match/cats', 'match/tags', 'match/filter'); 
    487     } 
    488  
    489     function get_settings_from_notes () { 
     506    } /* SyndicatedLink::imploded_settings () */ 
     507 
     508    protected function get_settings_from_notes () { 
    490509        // Read off feed settings from link_notes 
    491510        $notes = explode("\n", $this->link->link_notes); 
     
    588607    } /* SyndicatedLink::get_settings_from_notes () */ 
    589608 
    590     function settings_to_notes () { 
     609    protected function settings_to_notes () { 
    591610        $to_notes = $this->settings; 
    592611 
     
    634653    } /* SyndicatedLink::settings_to_notes () */ 
    635654 
    636     function save_settings ($reload = false) { 
     655    public function save_settings ($reload = false) { 
    637656        global $wpdb; 
    638657 
     
    671690     * @return bool TRUE on success, FALSE on failure. 
    672691     */ 
    673     function setting ($name, $fallback_global = NULL, $fallback_value = NULL, $default = 'default') { 
     692    public function setting ($name, $fallback_global = NULL, $fallback_value = NULL, $default = 'default') { 
    674693        $ret = NULL; 
    675694        if (isset($this->settings[$name])) : 
     
    705724    } /* SyndicatedLink::setting () */ 
    706725 
    707     function merge_settings ($data, $prefix, $separator = '/') { 
     726    public function merge_settings ($data, $prefix, $separator = '/') { 
    708727        $dd = $this->flatten_array($data, $prefix, $separator); 
    709728        $this->settings = array_merge($this->settings, $dd); 
    710729    } /* SyndicatedLink::merge_settings () */ 
    711730 
    712     function update_setting ($name, $value, $default = 'default') { 
     731    public function update_setting ($name, $value, $default = 'default') { 
    713732        if (!is_null($value) and $value != $default) : 
    714733            $this->settings[$name] = $value; 
     
    718737    } /* SyndicatedLink::update_setting () */ 
    719738 
    720     function is_non_incremental () { 
     739    public function is_non_incremental () { 
    721740        return ('complete'==$this->setting('update_incremental', 'update_incremental', 'incremental')); 
    722741    } /* SyndicatedLink::is_non_incremental () */ 
    723742 
    724     function uri ($params = array()) { 
     743    public function uri ($params = array()) { 
    725744        $params = wp_parse_args($params, array( 
    726745        'add_params' => false, 
     
    764783    } /* SyndicatedLink::uri () */ 
    765784 
    766     function username () { 
     785    public function username () { 
    767786        return $this->setting('http username', 'http_username', NULL); 
    768787    } /* SyndicatedLink::username () */ 
    769788 
    770     function password () { 
     789    public function password () { 
    771790        return $this->setting('http password', 'http_password', NULL); 
    772791    } /* SyndicatedLink::password () */ 
    773792 
    774     function authentication_method () { 
     793    public function authentication_method () { 
    775794        $auth = $this->setting('http auth method', NULL); 
    776795        if (('-' == $auth) or (strlen($auth)==0)) : 
     
    781800 
    782801    var $postmeta = array(); 
    783     function postmeta ($params = array()) { 
     802    public function postmeta ($params = array()) { 
    784803        $params = wp_parse_args($params, /*defaults=*/ array( 
    785804        "field" => NULL, 
     
    825844    } /* SyndicatedLink::postmeta () */ 
    826845 
    827     function property_cascade ($fromFeed, $link_field, $setting, $method) { 
     846    public function property_cascade ($fromFeed, $link_field, $setting, $method) { 
    828847        $value = NULL; 
    829848        if ($fromFeed) : 
     
    841860    } /* SyndicatedLink::property_cascade () */ 
    842861 
    843     function homepage ($fromFeed = true) { 
     862    public function homepage ($fromFeed = true) { 
    844863        return $this->property_cascade($fromFeed, 'link_url', 'feed/link', 'get_link'); 
    845864    } /* SyndicatedLink::homepage () */ 
    846865 
    847     function name ($fromFeed = true) { 
     866    public function name ($fromFeed = true) { 
    848867        return $this->property_cascade($fromFeed, 'link_name', 'feed/title', 'get_title'); 
    849868    } /* SyndicatedLink::name () */ 
    850869 
    851     function guid () { 
     870    public function guid () { 
    852871        $ret = $this->setting('feed/id', NULL, $this->uri()); 
    853872 
     
    876895    } 
    877896 
    878     function links ($params = array()) { 
     897    public function links ($params = array()) { 
    879898        $params = wp_parse_args($params, array( 
    880899        "rel" => NULL, 
     
    930949    } 
    931950     
    932     function ttl ($return_element = false) { 
     951    public function ttl ($return_element = false) { 
    933952        if (is_object($this->magpie)) : 
    934953            $channel = $this->magpie->channel; 
     
    9871006    } /* SyndicatedLink::ttl() */ 
    9881007 
    989     function automatic_ttl () { 
     1008    public function automatic_ttl () { 
    9901009        // spread out over a time interval for staggered updates 
    9911010        $updateWindow = $this->setting('update/window', 'update_window', DEFAULT_UPDATE_PERIOD); 
     
    10001019    } /* SyndicatedLink::automatic_ttl () */ 
    10011020 
    1002     // SyndicatedLink::flatten_array (): flatten an array. Useful for 
    1003     // hierarchical and namespaced elements. 
    1004     // 
    1005     // Given an array which may contain array or object elements in it, 
    1006     // return a "flattened" array: a one-dimensional array of scalars 
    1007     // containing each of the scalar elements contained within the array 
    1008     // structure. Thus, for example, if $a['b']['c']['d'] == 'e', then the 
    1009     // returned array for FeedWordPress::flatten_array($a) will contain a key 
    1010     // $a['feed/b/c/d'] with value 'e'. 
    1011     function flatten_array ($arr, $prefix = 'feed/', $separator = '/') { 
     1021    /** 
     1022     * SyndicatedLink::flatten_array (): flatten an array. Useful for 
     1023     * hierarchical and namespaced elements. 
     1024     * 
     1025     * Given an array which may contain array or object elements in it, 
     1026     * return a "flattened" array: a one-dimensional array of scalars 
     1027     * containing each of the scalar elements contained within the array 
     1028     * structure. Thus, for example, if $a['b']['c']['d'] == 'e', then the 
     1029     * returned array for FeedWordPress::flatten_array($a) will contain a key 
     1030     * $a['feed/b/c/d'] with value 'e'. 
     1031     * 
     1032     * @param array $arr 
     1033     * @param string $prefix 
     1034     * @param string $separator 
     1035     * @return array 
     1036     */ 
     1037    public function flatten_array ($arr, $prefix = 'feed/', $separator = '/') { 
    10121038        $ret = array (); 
    10131039        if (is_array($arr)) : 
     
    10231049    } /* SyndicatedLink::flatten_array () */ 
    10241050 
    1025     function hardcode ($what) { 
     1051    public function hardcode ($what) { 
    10261052 
    10271053        $ret = $this->setting('hardcode '.$what, 'hardcode_'.$what, NULL); 
     
    10351061    } /* SyndicatedLink::hardcode () */ 
    10361062 
    1037     function syndicated_status ($what, $default, $fallback = true) { 
     1063    public function syndicated_status ($what, $default, $fallback = true) { 
    10381064        global $wpdb; 
    10391065 
     
    10441070    } /* SyndicatedLink:syndicated_status () */ 
    10451071 
    1046     function taxonomies () { 
     1072    public function taxonomies () { 
    10471073        $post_type = $this->setting('syndicated post type', 'syndicated_post_type', 'post'); 
    10481074        return get_object_taxonomies(array('object_type' => $post_type), 'names'); 
     
    10581084     * @return array 
    10591085     */ 
    1060     function category_ids ($post, $cats, $unfamiliar_category = 'create', $taxonomies = NULL, $params = array()) { 
     1086    public function category_ids ($post, $cats, $unfamiliar_category = 'create', $taxonomies = NULL, $params = array()) { 
    10611087        $singleton = (isset($params['singleton']) ? $params['singleton'] : true); 
    10621088        $allowFilters = (isset($params['filters']) ? $params['filters'] : false); 
     
    11551181        return $terms; 
    11561182    } /* SyndicatedLink::category_ids () */ 
    1157 } // class SyndicatedLink 
    1158  
     1183} /* class SyndicatedLink */ 
     1184 
Note: See TracChangeset for help on using the changeset viewer.