Plugin Directory

Changeset 677798


Ignore:
Timestamp:
03/08/2013 01:04:01 AM (13 years ago)
Author:
acegiak
Message:

Fixed the error preventing whispers to actually be added to the wall created from last bugfix

Location:
whisperfollow/trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • whisperfollow/trunk/WhisperFollow.php

    r676682 r677798  
    44    Plugin URI: http://www.machinespirit.net/acegiak
    55    Description: Follow and reblog multiple sites with simplepie RSS
    6     Version: 1.2.3
     6    Version: 1.2.4
    77    Author: Ashton McAllan
    88    Author URI: http://www.machinespirit.net/acegiak
     
    126126
    127127function add_whisper($permalink,$title,$content,$authorname='',$authorurl='',$time=0,$avurl=''){
     128    //whisperfollow_log("adding whisper: ".$permalink.": ".$title);
    128129    global $wpdb;
    129130    if($time < 1){
     
    131132    }
    132133    $table_name = $wpdb->prefix . "whisperfollow";
    133     if($wpdb->get_var( $wpdb->prepare("SELECT COUNT(*) FROM ".$table_name." WHERE permalink LIKE \"%p\";",$permalink))<1){
     134    if($wpdb->get_var( "SELECT COUNT(*) FROM ".$table_name." WHERE permalink LIKE \"".$permalink."\";")<1){
     135        whisperfollow_log("no duplicate found");
    134136        $rows_affected = $wpdb->insert( $table_name,
    135137            array(
     
    145147
    146148        if($rows_affected == false){
     149       
     150            whisperfollow_log("could not insert whisper into database!");
    147151            die("could not insert whisper into database!");
    148         }
    149         whisperfollow_log("added ".$title." from ".$authorurl);
     152        }else{
     153            whisperfollow_log("added ".$title." from ".$authorurl);
     154        }
     155    }else{
     156        whisperfollow_log("duplicate detected");
    150157    }
    151158
     
    514521                $hub = rss_hubget($body);
    515522                if(strlen($self) > 0){
     523                    whisperfollow_log("PUSH START: ".substr($self,0,50));
    516524                    if(!in_array($self,array_map(create_function('$o', 'return $o->link_rss;'),get_bookmarks( array(    'orderby' => 'name','order'=> 'ASC','category_name'  => 'Blogroll'))))){
    517525                        whisperfollow_pubsub_change_subscription("unsubscribe",$self,$hub);
     
    605613
    606614function whisperfollow_aggregator( $args = array() ) {
    607 
     615    whisperfollow_log("aggregation!");
    608616    $bookmarks = get_bookmarks( array(
    609617    'orderby'        => 'name',
     
    623631
    624632function whisperfollow_aggregate($feeds,$pushed=false){
     633    //whisperfollow_log("Aggregating feeds:"+count(feeds));
    625634    if ( !empty( $feeds ) ) {
    626635
     
    637646        $feed->strip_htmltags(false);   
    638647       
    639     echo "<br/>Feed object:";
    640     print_r($feed);
     648    //whisperfollow_log("<br/>Feed object:");
     649    //whisperfollow_log(print_r($feed,true));
    641650    $items = $feed->get_items();
    642     echo "<br/>items object:";
    643     print_r($items);   
     651
     652    whisperfollow_log(substr(print_r($items,true),0,500));
     653    whisperfollow_log("<br/>items object:");
    644654    usort($items,'date_sort');
    645655    foreach ($items as $item){
    646         echo "<br/>got ".$item->get_title()." from ". $item->get_feed()->get_title()."<br/>";
     656        whisperfollow_log("<br/>got ".$item->get_title()." from ". $item->get_feed()->get_title()."<br/>");
    647657        add_whisper($item->get_permalink(),$item->get_title(),html_entity_decode ($item->get_description()),$item->get_feed()->get_title(),$item->get_feed()->get_link(),$item->get_date("U"));
    648658
    649659    }
    650     }
    651     else echo 'No feed defined';
     660   
    652661    remove_filter( 'wp_feed_cache_transient_lifetime', 'whisperfollow_feed_time' );
     662    }
     663    whisperfollow_log('No feed defined');
    653664   
    654665}
  • whisperfollow/trunk/readme.txt

    r676682 r677798  
    4242
    4343== Changelog ==
     44
     45= 1.2.4 =
     46* Fixed the error preventing whispers to actually be added to the wall created from last bugfix
    4447
    4548= 1.2.3 =
Note: See TracChangeset for help on using the changeset viewer.