WordPress.org

Plugin Directory

Changeset 508474


Ignore:
Timestamp:
02/21/12 20:31:37 (2 years ago)
Author:
SteveAtty
Message:

Disabling frictionless sharing for the time being

Location:
wordbooker
Files:
9 edited
4 copied

Legend:

Unmodified
Added
Removed
  • wordbooker/tags/2.1.5/includes/wordbooker_comments.php

    r506216 r508474  
    153153                    wordbooker_debugger("Blogs posts to send comment to : ".$sql,count($wp_post_rows),-2,98); 
    154154                    foreach ($wp_post_rows as $wp_post_row) { 
    155                     $wordbooker_post_options = get_post_meta($wp_post_row->wp_post_id, '_wordbooker_options', true); 
    156                     if (!isset($wordbooker_post_options['wordbooker_comment_get'])) { 
    157                         wordbooker_debugger("Incoming comments disabled for WP post ".$wp_post_row->wp_post_id,' ',-2,9); 
    158                         wordbooker_debugger("Incoming comments disabled for WP post ".$wp_post_row->wp_post_id,' ',-3,9);    
    159                         continue ; 
    160                     } 
    161                     $data = array( 
    162                         'comment_post_ID' => $wp_post_row->wp_post_id, 
    163                         'comment_author' => $single_comment->from->name, 
    164                         'comment_author_email' => $commemail, 
    165                         'comment_author_url' => 'https://www.facebook.com/'.$single_comment->from->id, 
    166                         'comment_content' =>$single_comment->message, 
    167                         'comment_author_IP' => '127.0.0.1', 
    168                         'comment_date' => $atime, 
    169                         'comment_date_gmt' => $time, 
    170                         'comment_parent'=> 0, 
    171                         'user_id' => 0, 
    172                         'comment_agent' => 'Wordbooker plugin '.WORDBOOKER_CODE_RELEASE, 
    173                         'comment_approved' => $comment_approve, 
    174                     ); 
    175                     $data = apply_filters('preprocess_comment', $data);  
    176                     $data['comment_parent'] = isset($data['comment_parent']) ? absint($data['comment_parent']) : 0; 
    177                     $parent_status = ( 0 < $data['comment_parent'] ) ? wp_get_comment_status($data['comment_parent']) : ''; 
    178                     $data['comment_parent'] = ( 'approved' == $parent_status || 'unapproved' == $parent_status ) ? $data['comment_parent'] : 0; 
    179                     $newComment= wp_insert_comment($data); 
    180                     update_comment_meta($newComment, "fb_uid", $single_comment->from->id); 
    181                     wordbooker_debugger("Inserted comment from ".$single_comment->from->name." into ".$wp_post_row->wp_post_id,"",-2,9); 
    182                     wordbooker_debugger("Inserted comment from ".$single_comment->from->name." into ".$wp_post_row->wp_post_id,"",-3,9); 
    183                     $sql="Insert into ".WORDBOOKER_POSTCOMMENTS." (fb_post_id,user_id,comment_timestamp,wp_post_id,blog_id,wp_comment_id,fb_comment_id,in_out) values ('".$fb_comment->fb_post_id."',".$user_id.",".strtotime($single_comment->created_time).",".$wp_post_row->wp_post_id.",".$blog_id.",".$newComment.",'".$single_comment->id."','in' )"; 
    184                     $wpdb->query($sql); 
    185                     $processed_posts=$processed_posts+1; 
     155                        $wordbooker_post_options = get_post_meta($wp_post_row->wp_post_id, '_wordbooker_options', true); 
     156                        if (!isset($wordbooker_post_options['wordbooker_comment_get'])) { 
     157                            wordbooker_debugger("Incoming comments disabled for WP post ".$wp_post_row->wp_post_id,' ',-2,9); 
     158                            wordbooker_debugger("Incoming comments disabled for WP post ".$wp_post_row->wp_post_id,' ',-3,9);    
     159                            continue ; 
     160                        } 
     161                        $data = array( 
     162                            'comment_post_ID' => $wp_post_row->wp_post_id, 
     163                            'comment_author' => $single_comment->from->name, 
     164                            'comment_author_email' => $commemail, 
     165                            'comment_author_url' => 'https://www.facebook.com/'.$single_comment->from->id, 
     166                            'comment_content' =>$single_comment->message, 
     167                            'comment_author_IP' => '127.0.0.1', 
     168                            'comment_date' => $atime, 
     169                            'comment_date_gmt' => $time, 
     170                            'comment_parent'=> 0, 
     171                            'user_id' => 0, 
     172                            'comment_agent' => 'Wordbooker plugin '.WORDBOOKER_CODE_RELEASE, 
     173                            'comment_approved' => $comment_approve, 
     174                        ); 
     175                        $data = apply_filters('preprocess_comment', $data);  
     176                        $data['comment_parent'] = isset($data['comment_parent']) ? absint($data['comment_parent']) : 0; 
     177                        $parent_status = ( 0 < $data['comment_parent'] ) ? wp_get_comment_status($data['comment_parent']) : ''; 
     178                        $data['comment_parent'] = ( 'approved' == $parent_status || 'unapproved' == $parent_status ) ? $data['comment_parent'] : 0; 
     179                        $newComment= wp_insert_comment($data); 
     180                        update_comment_meta($newComment, "fb_uid", $single_comment->from->id); 
     181                        wordbooker_debugger("Inserted comment from ".$single_comment->from->name." into ".$wp_post_row->wp_post_id,"",-2,9); 
     182                        wordbooker_debugger("Inserted comment from ".$single_comment->from->name." into ".$wp_post_row->wp_post_id,"",-3,9); 
     183                        $sql="Insert into ".WORDBOOKER_POSTCOMMENTS." (fb_post_id,user_id,comment_timestamp,wp_post_id,blog_id,wp_comment_id,fb_comment_id,in_out) values ('".$fb_comment->fb_post_id."',".$user_id.",".strtotime($single_comment->created_time).",".$wp_post_row->wp_post_id.",".$blog_id.",".$newComment.",'".$single_comment->id."','in' )"; 
     184                        $wpdb->query($sql); 
     185                        $processed_posts=$processed_posts+1; 
    186186                    } 
    187187                    wordbooker_debugger("Finished comment inserts for FB post ".$fb_comment->fb_post_id,"",-2,9); 
    188188                    wordbooker_debugger("Finished comment inserts for FB post ".$fb_comment->fb_post_id,"",-3,9); 
     189                } 
     190               else { 
     191                    wordbooker_debugger("Found existing comment for FB post ".$fb_comment->fb_post_id,"from : ".$single_comment->from->name,-2,9); 
     192                    wordbooker_debugger("Found existing comment for FB post ".$fb_comment->fb_post_id,"from : ".$single_comment->from->name,-3,9);   
    189193                } 
    190194            } 
  • wordbooker/tags/2.1.5/includes/wordbooker_options.php

    r506160 r508474  
    384384        echo '<label for="wb_facebook_gravatars">'.__("Do not replace Gravtars with Facebook Photos", 'wordbooker'). ' : </label>'; 
    385385        echo '<INPUT TYPE=CHECKBOX NAME="wordbooker_settings[wordbooker_no_facebook_gravatars]" '.$checked_flag[$wordbooker_settings["wordbooker_no_facebook_gravatars"]].' ><br />'; 
    386  
     386/* 
    387387        echo "<hr><br />"; 
    388388        echo '<label for="wb_facebook_time">'.__("Use Frictionless sharing / Timeline instead of Share", 'wordbooker'). ' : </label>'; 
    389389        echo '<INPUT TYPE=CHECKBOX NAME="wordbooker_settings[wordbooker_time_button]" '.$checked_flag[$wordbooker_settings["wordbooker_time_button"]].' ><br />'; 
    390 /* 
     390 
    391391        echo '<label for="wb_fbread_location">&nbsp;'.__('Facebook Read - Display Button ', 'wordbooker').' :</label> <select id="wordbooker_fbread_location" name="wordbooker_settings[wordbooker_fbread_location]"  >'; 
    392392        foreach ($fblike_location as $i => $value) { 
     
    490490        global $ol_flash, $wordbooker_settings, $_POST, $wp_rewrite,$user_ID,$wpdb, $blog_id,$wordbooker_user_settings_id,$table_prefix; 
    491491        $checked_flag=array('on'=>'checked','off'=>''); 
     492        if (intval(WORDBOOKER_WP_VERSION)>30){ 
    492493        $admin_users=get_users(array('role'=>'administrator'));; 
    493494        echo '<label for="wordbooker_diagnostic admin">'.__('User who should get Admin level diagnostics', 'wordbooker').' :</label> <select id="wordbooker_diagnostic_admin" name="wordbooker_settings[wordbooker_diagnostic_admin]"  >'; 
     
    496497               else {print '<option value="'.$adminuser->ID.'" >'.$adminuser->display_name.' ( '.$adminuser->user_login.' ) </option>';}} 
    497498        echo "</select><br />"; 
     499        } 
    498500        if (!isset($wordbooker_settings['wordbooker_advanced_diagnostics_level'])) {$wordbooker_settings['wordbooker_advanced_diagnostics_level']=10;} 
    499         $arr = array(0=> __("Show Everything and I mean everything",'wordbooker'),10=> __("Show everything but Cache Diagnostics",'wordbooker'),20=> "50",40=> "100",60=> "120",80=> "150",90=> __("Show result of major actions",'wordbooker'),99 => __("Don't show anything apart from Fatal errors",'wordbooker'),999 => __("Disabled (Show nothing at all)",'wordbooker')); 
     501        $arr = array(0=> __("Show Everything and I mean everything",'wordbooker'),10=> __("Show everything but Cache Diagnostics",'wordbooker'),90=> __("Show result of major actions",'wordbooker'),99 => __("Don't show anything apart from Fatal errors",'wordbooker'),999 => __("Disabled (Show nothing at all)",'wordbooker')); 
    500502        echo '<p><label for="wb_advanced_diagnostics_level">'.__("Post Diagnostics display level", 'wordbooker'). ' : </label><select id="wordbooker_advanced_diagnostics_level" name="wordbooker_settings[wordbooker_advanced_diagnostics_level]"  >'; 
    501503         foreach ($arr as $i => $value) { 
  • wordbooker/tags/2.1.5/includes/wordbooker_posting.php

    r505615 r508474  
    2828function wordbooker_wall_post($post_id,$access_token,$post_title,$post_data,$target_id,$dummy,$target_name){ 
    2929    if (isset($dummy)) {     
    30         wordbooker_debugger("Wall Post to ".$target_name." Test Only",'No Post Made',$post_id) ; 
     30        wordbooker_debugger("Wall Post to ".$target_name." Test Only",'No Post Made',$post_id,90) ; 
    3131        return; 
    3232    } 
     
    3636        $result = wordbooker_fb_stream_pubish($post_data,$target_id); 
    3737        wordbooker_store_post_result($post_id,$result->id ); 
    38         wordbooker_debugger("Wall Post to ".$target_name." Succeeded - result : ",$result->id,$post_id) ; 
     38        wordbooker_debugger("Wall Post to ".$target_name." Succeeded - result : ",$result->id,$post_id,90) ; 
    3939        } 
    4040    catch (Exception $e) { 
     
    4848function wordbooker_link_post($post_id,$access_token,$post_title,$post_data,$target_id,$dummy,$target_name){ 
    4949    if (isset($dummy)) {     
    50         wordbooker_debugger("Link Post to ".$target_name." Test Only",'No Post Made',$post_id) ; 
     50        wordbooker_debugger("Link Post to ".$target_name." Test Only",'No Post Made',$post_id,90) ; 
    5151        return; 
    5252    } 
     
    5858        $result = wordbooker_fb_link_publish($post_data2,$target_id); 
    5959        wordbooker_store_post_result($post_id,$result->id ); 
    60         wordbooker_debugger("Link Post to ".$target_name." Succeeded - result : ",$result->id,$post_id) ; 
     60        wordbooker_debugger("Link Post to ".$target_name." Succeeded - result : ",$result->id,$post_id,90) ; 
    6161        } 
    6262    catch (Exception $e) { 
     
    7171    wordbooker_debugger("Setting status_text".$wordbooker_post_options['wordbooker_status_update_text']," ",$post_id) ;  
    7272    if (isset($dummy)) {     
    73         wordbooker_debugger("Status update to ".$target_name." Test Only",'No Post Made',$post_id) ; 
     73        wordbooker_debugger("Status update to ".$target_name." Test Only",'No Post Made',$post_id,90) ; 
    7474        return; 
    7575    } 
     
    8181        $result = wordbooker_fb_status_update($data,$target_id); 
    8282        wordbooker_store_post_result($post_id,$result->id ); 
    83         wordbooker_debugger("Status update  to ".$target_name." suceeded result : ",$result->id,$post_id) ; 
     83        wordbooker_debugger("Status update  to ".$target_name." suceeded result : ",$result->id,$post_id,90) ; 
    8484        } 
    8585    catch (Exception $e) { 
     
    9393function wordbooker_notes_post($post_id,$access_token,$post_title,$target_id,$dummy,$target_name){ 
    9494    if (isset($dummy)) {     
    95         wordbooker_debugger("Notes publish  to ".$target_name." Test Only",'No Post Made',$post_id) ; 
     95        wordbooker_debugger("Notes publish  to ".$target_name." Test Only",'No Post Made',$post_id,90) ; 
    9696        return; 
    9797    } 
     
    105105        $result = wordbooker_fb_note_publish($data,$target_id); 
    106106        wordbooker_store_post_result($post_id,$result->id); 
    107         wordbooker_debugger("Note Publish to ".$target_name." result : ",$result->id,$post_id) ; 
     107        wordbooker_debugger("Note Publish to ".$target_name." result : ",$result->id,$post_id,90) ; 
    108108    }    
    109109    catch (Exception $e) { 
  • wordbooker/tags/2.1.5/readme.txt

    r506219 r508474  
    44Tags: facebook, minifeed, newsfeed, crosspost, WPMU, Facebook Share, Facebook Like, social media 
    55Requires at least: 2.9 
    6 Tested up to: 3.2.1 
    7 Stable tag: 2.1.4 
     6Tested up to: 3.3.1 
     7Stable tag: 2.1.5 
    88 
    99This plugin allows you to cross-post your blog posts to your Facebook Wall and to any Facebook Fan Page / Group that you are an administrator for.  
     
    5353It is certainly similar, but not the same: 
    5454 
    55 - Facebook Notes imports and caches your blog posts (e.g., it subscribes to your blog's RSS feed). 
    56  
    57 Wordbooker uses the Facebook API to actively update your Facebook Wall just as if you had posted an update yourself on facebook.com. It also means that you can make changes to your blog postings *after* initially publishing them. 
     55- Facebook Notes imports and caches your entire blog post - Wordbooker uses the Facebook API to actively update your Facebook Wall just as if you had posted an update yourself on facebook.com. It also means that you can make changes to your blog postings *after* initially publishing them. 
    5856 
    5957- With Wordbooker, your blog postings will have their own space in your Facebook Wall - just as if you'd written directly on to the wall yourself. 
     
    6765So it looks something like :  <html xmlns="http://www.w3.org/1999/xhtml" xmlns:v="urn:schemas-microsoft-com:vml" xmlns:fb="http://www.facebook.com/2008/fbml"> 
    6866 
    69  
     67  
    7068= Why aren't my blog posts showing up in Facebook? = 
    7169 
     
    7876= My WordPress database doesn't use the default 'wp_' table prefix. Will this plugin still work? = 
    7977 
    80 Yes, and its also WPMU compliant. 
     78Yes, and its also WPMU/ WP Networked Blogs mode compliant. 
    8179 
    8280 
     
    10199- Use the [Wordbooker Support Forums](http://wordbooker.tty.org.uk/forums/). Either start a new topic, or add to an existing topic. 
    102100 
    103 - Alternatively, Go to the Wordbooker Page on [GoogleCode](http://code.google.com/p/wordbooker/). 
     101- Alternatively, for major feature requests go to the Wordbooker Page on [GoogleCode](http://code.google.com/p/wordbooker/). 
    104102 
    105103 
     
    117115== Changelog == 
    118116 
     117= Version 2.1.5 21/02/2012 = 
     118- Coded round the fact that get_users is a WP>3.0 function. So users on WP<3.1 dont get the option to chose the admin user for diagnostic messages 
     119- Added extra diagnostic for comments that have already ben pulled from Facebook 
     120- Reviewed and ratified all the diagnostic message levels. 
     121- Fixed an obscure bug where the FB Comments block didn't show if you turned off Wordbooker's FB Like and Share buttons. 
     122- Change image handling code so that filenames with single quotes in them don't blow things up. As Wordpress uses " " round image URLs this should be OK. 
     123- Fixed a typo in the user guide - all the short tags had [[ ]] rather than [ ] 
     124- Disabled the frictionless sharing option as it was doing some very odd things - like even though I was using an APP access token it was filling MY timeline up. 
     125- Removed a duplicated xmlns tag. 
     126 
     127 
    119128= Version 2.1.4 16/02/2012 =  
    120129- Rebuild for SVN after WP restored the plugin and messed things up 
    121130 
     131 
    122132= Version 2.1.3 16/02/2012 =  
    123133- Rebuild for SVN after WP restored the plugin and messed things up 
    124134 
     135 
    125136= Version 2.1.2 16/02/2012 =  
    126137- Lost in SVN after WP restored the plugin and messed things up 
     138 
    127139 
    128140= Version 2.1.1 16/02/2012 = 
  • wordbooker/tags/2.1.5/wordbooker.php

    r506219 r508474  
    66Author: Steve Atty  
    77Author URI: http://wordbooker.tty.org.uk 
    8 Version: 2.1.4 
     8Version: 2.1.5 
    99*/ 
    1010 
     
    3939define('WORDBOOKER_DEBUG', false); 
    4040define('WORDBOOKER_TESTING', false); 
    41 define('WORDBOOKER_CODE_RELEASE','2.1.4 - Fish Beach'); 
     41define('WORDBOOKER_CODE_RELEASE',"2.1.5 - Caliban's Pit"); 
    4242 
    4343# For Troubleshooting  
     
    721721    #echo "!!!!".$user_ID; 
    722722    $count_rows = $wpdb->get_results('SELECT count(*) as count FROM ' . WORDBOOKER_ERRORLOGS . ' WHERE user_ID = ' . $user_ID . '  and blog_id='.$blog_id); 
    723     $rows = $wpdb->get_results('SELECT * FROM ' . WORDBOOKER_ERRORLOGS . ' WHERE user_ID = ' . $user_ID . '  and blog_id='.$blog_id.' and diag_level >'.$diaglevel.' order by sequence_id asc'); 
     723    $rows = $wpdb->get_results('SELECT * FROM ' . WORDBOOKER_ERRORLOGS . ' WHERE user_ID = ' . $user_ID . '  and blog_id='.$blog_id.' and diag_level >='.$diaglevel.' order by sequence_id asc'); 
    724724    if ($count_rows[0]->count >= 1) { 
    725725?> 
     
    12521252 
    12531253    if ( function_exists( 'get_the_post_thumbnail' ) ) {  
    1254         wordbooker_debugger("Getting the thumnail image"," ",$post->ID) ; 
     1254        wordbooker_debugger("Getting the thumnail image"," ",$post->ID,80) ; 
    12551255        preg_match_all('/<img \s+ ([^>]*\s+)? src \s* = \s* [\'"](.*?)[\'"]/ix',get_the_post_thumbnail($post_id), $matches_tn);  
    12561256    } 
     
    12581258    $meta_tag_scan=explode(',',$wordbooker_settings['wordbooker_meta_tag_scan']); 
    12591259    foreach($meta_tag_scan as $meta_tag) { 
    1260         wordbooker_debugger("Getting image from custom meta : ",$meta_tag,$post->ID) ; 
     1260        wordbooker_debugger("Getting image from custom meta : ",$meta_tag,$post->ID,80) ; 
    12611261        $matches_ct[]=get_post_meta($post->ID, $meta_tag, TRUE); 
    12621262    } 
     
    12831283        if (!isset($wordbooker_settings["wordbooker_meta_tag_thumb"])) { 
    12841284            if (! isset($wordbooker_post_options["wordbooker_thumb_only"]) ) { 
    1285                 wordbooker_debugger("Setting image array to be both thumb and the post images "," ",$post->ID) ; 
     1285                wordbooker_debugger("Setting image array to be both thumb and the post images "," ",$post->ID,80) ; 
    12861286                $pulled_images=@array_merge($matches[2],$matched[2],$yturls,$matches); 
    12871287            } 
    12881288            else { 
    1289                 wordbooker_debugger("Setting image array to be just thumb "," ",$post->ID) ; 
     1289                wordbooker_debugger("Setting image array to be just thumb "," ",$post->ID,80) ; 
    12901290                $pulled_images[]=$matches[2]; 
    12911291            }  
     
    12941294 
    12951295    if (isset($wordbooker_settings["wordbooker_meta_tag_thumb"]) && isset($wordbooker_post_options["wordbooker_thumb_only"]) ) { 
    1296     wordbooker_debugger("Setting image array to be just thumb from meta. "," ",$post->ID) ; 
     1296    wordbooker_debugger("Setting image array to be just thumb from meta. "," ",$post->ID,80) ; 
    12971297    $pulled_images[]=$matches_ct[2];} 
    12981298 
    12991299    else { 
    1300         wordbooker_debugger("Setting image array to be post and thumb images. "," ",$post->ID) ; 
     1300        wordbooker_debugger("Setting image array to be post and thumb images. "," ",$post->ID,80) ; 
    13011301        if (is_array($matched[2])) {$pulled_images[]=array_merge($matches,$matched[2]);} 
    13021302        if (is_array($matched[2]) && is_array($yturls)) {$pulled_images=array_merge($matches,$matched[2],$yturls);} 
     
    13461346        if (isset($wordbooker_settings['wordbooker_use_this_image']))  { 
    13471347            $images[]=$wordbooker_settings['wb_wordbooker_default_image']; 
    1348             wordbooker_debugger("No Post images found so using open graph default to keep Facebook happy ",'',$post->ID) ; 
     1348            wordbooker_debugger("No Post images found so using open graph default to keep Facebook happy ",'',$post->ID,90) ; 
    13491349            }  
    13501350        else { 
    13511351            $x=get_bloginfo('wpurl').'/wp-content/plugins/wordbooker/includes/wordbooker_blank.jpg'; 
    13521352            $images[]=$x; 
    1353             wordbooker_debugger("No Post images found so loading blank to keep Facebook happy ",'',$post->ID) ;  
     1353            wordbooker_debugger("No Post images found so loading blank to keep Facebook happy ",'',$post->ID,90) ;   
    13541354            } 
    13551355        } 
     
    13711371    // Set post_meta to be first image 
    13721372    update_post_meta($post->ID,'_wordbooker_thumb',$images[0]['src']); 
    1373     wordbooker_debugger("Getting the Excerpt"," ",$post->ID) ; 
     1373    wordbooker_debugger("Getting the Excerpt"," ",$post->ID,80) ; 
    13741374    unset ($processed_content); 
    13751375    if (isset($wordbooker_post_options["wordbooker_use_excerpt"])  && (strlen($post->post_excerpt)>3)) {  
     
    14151415    ); 
    14161416    if (isset($wordbooker_settings['wordbooker_use_url_not_slug'])) { unset($wordbooker_fb_post['caption']);} 
    1417     wordbooker_debugger("Post Titled : ",$post_data['post_title'],$post_id,99) ; 
    1418     wordbooker_debugger("Post URL : ",$post_data['post_link'],$post_id,99) ; 
     1417    wordbooker_debugger("Post Titled : ",$post_data['post_title'],$post_id,90) ; 
     1418    wordbooker_debugger("Post URL : ",$post_data['post_link'],$post_id,90) ; 
    14191419     
    14201420    if ($wordbooker_post_options['wordbooker_actionlink']==100) { 
    14211421        // No action link 
    1422         wordbooker_debugger("No action link being used","",$post_id,99) ; 
     1422        wordbooker_debugger("No action link being used","",$post_id,80) ; 
    14231423    } 
    14241424    if ($wordbooker_post_options['wordbooker_actionlink']==200) { 
    14251425        // Share This 
    1426         wordbooker_debugger("Share Link being used"," ",$post_id,99) ; 
     1426        wordbooker_debugger("Share Link being used"," ",$post_id,80) ; 
    14271427        $action_links = array('name' => __('Share', 'wordbooker'),'link' => 'http://www.facebook.com/share.php?u='.urlencode($post_data['post_link_share'])); 
    14281428        $wordbooker_fb_post['actions']=json_encode($action_links); 
     
    14301430    if ($wordbooker_post_options['wordbooker_actionlink']==300) { 
    14311431        // Read Full 
    1432         wordbooker_debugger("Read Full link being used"," ",$post_id,99) ; 
     1432        wordbooker_debugger("Read Full link being used"," ",$post_id,80) ; 
    14331433        $action_links = array('name' => __('Read entire article', 'wordbooker'),'link' => $post_data['post_link_share']); 
    14341434        $wordbooker_fb_post['actions'] =json_encode($action_links); 
     
    14591459        if (isset($posting_target['target_active'])) { 
    14601460            $target_type=substr($posting_target['target'],0,2); 
    1461             wordbooker_debugger("Posting to ".$target_types[$target_type]." ".$target_name." (".$posting_target['target_id'].") as a ".$posting_type[$posting_target['target_type']],"",$post_id,99) ;  
     1461            wordbooker_debugger("Posting to ".$target_types[$target_type]." ".$target_name." (".$posting_target['target_id'].") as a ".$posting_type[$posting_target['target_type']],"",$post_id,90) ;  
    14621462            if ($access_token=='dummy access token') {$access_token=$wbuser->access_token;} 
    14631463            $target=substr($posting_target['target'],3); 
     
    14821482            } 
    14831483 
    1484         } else {wordbooker_debugger("Posting to ".$posting_target['target_id']." target (".$target_name.") not active","",$post_id,99) ; } 
     1484        } else {wordbooker_debugger("Posting to ".$posting_target['target_id']." target (".$target_name.") not active","",$post_id,90) ; } 
    14851485 
    14861486    } 
     
    14971497        if (in_array($file_extension,$image_types)){ 
    14981498        foreach ($strip_array as $strip_domain) { 
    1499             wordbooker_debugger("Looking for ".$strip_domain." in ".$single," ",$post->ID,200) ; 
    1500             if (stripos($single,$strip_domain)) {wordbooker_debugger("Found a match so dump the image",$single,$post->ID,200) ;} else { if (!in_array($single,$newimages)){$newimages[]=$single;}} 
    1501         }} else {wordbooker_debugger("Image URL ".$single." not valid "," ",$post->ID,200) ;} 
     1499            wordbooker_debugger("Looking for ".$strip_domain." in ".$single," ",$post->ID,80) ; 
     1500            if (stripos($single,$strip_domain)) {wordbooker_debugger("Found a match so dump the image",$single,$post->ID,80) ;} else { if (!in_array($single,$newimages)){$newimages[]=$single;}} 
     1501        }} else {wordbooker_debugger("Image URL ".$single." not valid "," ",$post->ID,90) ;} 
    15021502    } 
    15031503    return $newimages; 
     
    16091609     
    16101610    $wordbooker_settings = wordbooker_options();  
    1611     if  (isset($wordbooker_settings['wordbooker_like_button_show']) || isset($wordbooker_settings['wordbooker_like_share_too']))  
     1611    if  (isset($wordbooker_settings['wordbooker_like_button_show']) || isset($wordbooker_settings['wordbooker_like_share_too'] ) || isset($wordbooker_settings['wordbooker_use_fb_comments']))  
    16121612        { 
    16131613        echo $efb_script; 
     
    16181618#   echo '\n<script type="text/javascript " defer="defer" > setTimeout("wordbooker_read()",3000); </script> \n'; 
    16191619    echo "\n<!-- Wordbooker code revision : ".WORDBOOKER_CODE_RELEASE." -->\n"; 
    1620  
    1621 if ( is_single() ) { 
    1622     if (isset($wordbooker_settings['wordbooker_time_button'])) { 
    1623         $frictionless=array('article' => get_permalink(),'access_token'=>'AAAAAO0YAejkBAE3gGR2KjCr6WhUO1ZBNyXHP6vaQoQLbwvlDyKDK0BIMZBb6mVyk2ZAbvPEXyrZCLNd6Bb8TA0HJCKGkotUZD'); 
    1624         #var_dump($frictionless); 
    1625         try { 
    1626         #$x=wordbooker_make_curl_post_call('https://graph.facebook.com/me/news.reads',$frictionless); 
    1627         $x=wordbooker_make_curl_post_call('https://graph.facebook.com/me/wordbooker:wordbooker_read',$frictionless); 
    1628         #var_dump($x); 
    1629         }    
    1630         catch  (Exception $e) { 
    1631                 $error_msg = $e->getMessage(); 
    1632             #   var_dump($error_msg); 
    1633         } 
    1634     } 
    1635 } 
    1636  
     1620    if ( is_single() ) { 
     1621        if (isset($wordbooker_settings['wordbooker_time_button'])) { 
     1622            $stuff=array('type'=>'client_cred','client_id'=>WORDBOOKER_FB_ID,'client_secret'=>WORDBOOKER_FB_SECRET); 
     1623            $access_token=wordbooker_make_curl_call('https://graph.facebook.com/oauth/access_token',$stuff); 
     1624        #   $frictionless=array('article' => get_permalink(),'access_token'=>'AAAAAO0YAejkBAE3gGR2KjCr6WhUO1ZBNyXHP6vaQoQLbwvlDyKDK0BIMZBb6mVyk2ZAbvPEXyrZCLNd6Bb8TA0HJCKGkotUZD');# 
     1625            $frictionless=array('article' => get_permalink(),'access_token'=>$access_token); 
     1626            var_dump($frictionless); 
     1627            try { 
     1628            #$x=wordbooker_make_curl_post_call('https://graph.facebook.com/me/news.reads',$frictionless); 
     1629            #$x=wordbooker_make_curl_post_call('https://graph.facebook.com/me/wordbooker:wordbooker_read',$frictionless); 
     1630            var_dump($x); 
     1631            }    
     1632            catch  (Exception $e) { 
     1633                    $error_msg = $e->getMessage(); 
     1634                    var_dump($error_msg); 
     1635            } 
     1636        } 
     1637    } 
    16371638return $blah; 
    16381639} 
     
    17371738    $wordbooker_settings = wordbooker_options();  
    17381739    # Now we just call the wordbooker_og_tags function. 
    1739     if (!isset ( $wordbooker_settings['wordbooker_fb_disable_og'])) { 
    1740         wordbooker_og_tags(); 
    1741     } 
     1740    if (!isset ( $wordbooker_settings['wordbooker_fb_disable_og'])) { wordbooker_og_tags(); } 
    17421741    return $blah; 
    17431742} 
     
    20342033    if ($post->post_type=='forum') { return;} 
    20352034    $wordbooker_settings = wordbooker_options();  
    2036     if (!isset($wordbooker_settings['wordbooker_like_button_show']) && !isset($wordbooker_settings['wordbooker_like_share_too'])) {return $post_cont;} 
     2035    if (!isset($wordbooker_settings['wordbooker_like_button_show']) && !isset($wordbooker_settings['wordbooker_like_share_too']) && !isset($wordbooker_settings['wordbooker_use_fb_comments'])) {return $post_cont;} 
    20372036    $post_cont2=$post_cont; 
    20382037    $post_link = get_permalink($post->ID); 
     
    21152114    return $result; 
    21162115} 
    2117  
    2118  
    21192116 
    21202117function wordbooker_check_permissions($wbuser,$user) { 
     
    21452142} 
    21462143 
    2147 function wordbooker_contributed($url=0) { 
    2148     global $user_ID; 
    2149     if ($url==0){ 
    2150         $contributors=array('1595132200','100000818019269','39203171','666800299','500073624','711830142','503549492','100000589976474','254577506873','1567300610','701738627','100000442094620','754015348','29404010','748636937', 
    2151  '676888540','768354692','1607820784','1709067850','769804853','100001597808077','1162591229','736138968','532656880','1000013707847','1352285955','836328641', 
    2152  '23010694256','129976890383044','679511648','100001305747796','138561766210548','535106029','202891313077099','567894174','10150158518404391','689075829','214145618608444', 
    2153 '23087261000','195010903860640','123977274343185' 
    2154 ); 
    2155         $facebook_id=wordbooker_get_cache($user_ID,'facebook_id'); 
    2156         return in_array($facebook_id->facebook_id,$contributors); 
    2157     } 
    2158  
    2159     if ($url==1){ 
    2160         $blogs=array( 
    2161 "Steve's Blog"=>'blogs.canalplan.org.uk/steve',"Powered by Dan!"=>'dangarion.com',"Kathryn's Comments"=>'www.kathrynhuxtable.org/blog',"Luke Writes"=>'www.lukewrites.com', 
    2162 "It's Nature"=>'www.itsnature.org',"Eat in OC"=>'eatinoc.com',"Christian Albert Muller"=>'christian-albert-mueller.com/blog/',"[overcrooked|de]"=>'blog.overcrooked.de/', 
    2163 "Jesus is My Buddy"=>'www.jesusismybuddy.com',"Shirts of Bamboo"=>'www.shirtsofbamboo.com', "What's that bug?"=>'www.whatsthatbug.com',"Philip Bussman"=>'www.philipbussmann.com', 
    2164 "PhantaNews"=>'phantanews.de/wp/', "HKMacs"=>'hkmacs.com/Blog', "Techerator"=>'www.techerator.com', "Mosalar.com"=>'www.mosalar.com/', 
    2165 "Nono & His Self-Centered Universe"=>'www.noelacosta.com/',"Chart Porn"=>'www.chartporn.org',"Pawesome"=>'www.pawesome.net',"Margaret & Ian's Website"=>'www.margaretandian.com/', 
    2166 "The GBMINI website"=>'www.gbmini.net',"Roca"=>'rocamusic.ca/home',"Drew Rozell"=>'www.drewrozell.com/',"Kartext"=>'www.nitsche.org/', 
    2167 "Doug Berch - Musician and Appalachian Mountain Dulcimer Maker"=>'dougberch.com',"My Lifestyle Blog"=>'www.mylifestyleblog.de', 
    2168 "tina rawatta photography" => 'www.tinarawatta.com',"Gary Said..."=>'GarySaid.com',"Bachateros Online Magazine"=>'www.bachateros.com.au/',"Linh's e-place"=>'www.linh.se', 
    2169 "InkMusings" => 'www.inkmusings.com',"Jürgen Koller's website"=>'www.kollermedia.at',"Walk With Ben"=>'www.walkwithben.com',"GardenFork"=>'www.http://www.gardenfork.tv/', 
    2170 "A Low Man's Lyric"=>'vivekiyer.net/',"OutofRange.net"=>'www.outofrange.net/',"This Ambitious Orchestra"=>'ambitiousorchestra.com',"Lydia Salnikova"=>'www.lydiasalnikova.com/', 
    2171 "Westpark Gamers"=>'www.westpark-gamers.de/', "The Camera Zealot"=>'www.camerazealot.com', " Best Raw Organic" => 'BestRawOrganic.com',"Gibson Designs"=>'gibsondesigns.net', 
    2172 "Looking out from Under"=>'www.lookingoutfromunder.com',"Our Excellent Adventures"=>'www.ourexcellentadventures.com', 
    2173 "wisiwi.com - Das Magazin für Unternehmer"=>'www.wisiwi.com/',"Just One Cookbook"=>'justonecookbook.com/blog/',"Surfdog 2011"=>'hastenteufel.name/blog', 
    2174 "Vice Versa Advertising Photography"=>'www.viceversa.gr/',"Swimming Pools Designs"=>'www.swimming-pools-designs.com',"Eastleigh District Scouts"=>'www.eastleigh-scouts.org.uk',"Sparkpr"=>'www.sparkpr.com',"Charlie Glickman - Adult Sexuality Education"=>'www.charlieglickman.com/',"iEatAtTheBar"=>'www.ieatatthebar.com/',"Devil's Cove | Boats, Booze & Fun on Lake Travis"=>'http://www.devilscove.com/',"Bored. Cure your boredom!"=>'bored.overnow.com/',"KinkyThought"=>'kinkythought.com/', 
    2175 "The Chronicles of Mommia"=>'www.thechroniclesofmommia.com/',"Total Humour"=>'www.totalhumour.com/',"Six Seconds"=>'www.6seconds.org/',"The APBA Blog"=>'www.apbablog.com',"The Doc is In"=>'www.thedocisin.net',"KitchenTableWisdom"=>'www.kitchentablewisdom.com/',"CNYRadio.com / CNYTVNews.com"=>'www.cnyradio.com/' 
    2176  
    2177 ); 
    2178         $keys = array_keys($blogs); 
    2179         shuffle($keys); 
    2180      
    2181         foreach ( $keys as $key) { 
    2182             echo "<a href='http://".htmlspecialchars($blogs[$key])."' target='_new'>".htmlspecialchars($key)."</a>,&nbsp;"; 
    2183         } 
    2184         # And then put canalplan on the end of it - saves us having to do clever things to remove commas 
    2185         echo "<a href='http://www.canalplan.org.uk/' target='_new' >CanalPlan AC</a><br />"; 
    2186     } 
    2187 } 
    21882144/****************************************************************************** 
    21892145 * WordPress hooks: update Facebook when a blog entry gets published. 
     
    22092165         } 
    22102166    } 
    2211  
    22122167    $excerpt = preg_replace('#(<wpg.*?>).*?(</wpg2>)#', '$1$2', $excerpt); 
    22132168    $excerpt=wordbooker_translate($excerpt); 
     
    22542209        if (is_array($wordbooker_post_options)){ 
    22552210        foreach (array_keys($wordbooker_post_options) as $key){ 
    2256             wordbooker_debugger("Post option : ".$key,$wordbooker_post_options[$key],$post->ID) ; 
     2211            wordbooker_debugger("Post option : ".$key,$wordbooker_post_options[$key],$post->ID,80) ; 
    22572212        } 
    22582213    } 
    22592214     
    22602215    if ($wordbooker_post_options["wordbooker_publish_default"]=="200") { $wordbooker_post_options["wordbooker_publish_default"]='on';} 
    2261  
    22622216 
    22632217    # If the user_ID is set then lets use that, if not get the user_id from the post 
     
    22712225        return; 
    22722226    } 
    2273     wordbooker_debugger("User has been set to : ",$wpuserid,$post->ID) ; 
     2227    wordbooker_debugger("User has been set to : ",$wpuserid,$post->ID,80) ; 
    22742228    if (!$wbuser = wordbooker_get_userdata($wpuserid) ) { 
    22752229        wordbooker_debugger("Unable to get FB session for : ",$wpuserid,$post->ID) ; 
    22762230        return 28; 
    22772231    } 
    2278     wordbooker_debugger("Posting as user : ",$wpuserid,$post->ID) ; 
    2279  
    2280     wordbooker_debugger("Calling wordbooker_fbclient_publishaction"," ",$post->ID) ; 
     2232    wordbooker_debugger("Posting as user : ",$wpuserid,$post->ID,80) ; 
     2233 
     2234    wordbooker_debugger("Calling wordbooker_fbclient_publishaction"," ",$post->ID,99) ; 
    22812235    wordbooker_fbclient_publishaction($wbuser, $post->ID); 
    22822236    unset($doing_post); 
     
    22842238} 
    22852239 
    2286 /* 
    2287 function wordbooker_transition_post_status($newstatus, $oldstatus, $post_id) { 
    2288  
    2289     if ($newstatus == 'publish') { 
    2290         return wordbooker_publish_action($post_id); 
    2291     } 
    2292  
    2293     return 31;   
    2294 } 
    2295 */ 
    22962240 
    22972241function wordbooker_delete_post($post_id) {  
     
    23242268        update_post_meta($post->ID, '_wordbooker_options', $wordbooker_sets);  
    23252269    } 
    2326 if (!$newstatus=="publish") { return;} 
     2270    if (!$newstatus=="publish") { return;} 
    23272271    # If this is a password protected post we give up 
    23282272    if ($post->post_password != '') {return;} 
     
    23732317 
    23742318    if ( !wordbooker_get_userdata($post->post_author)) { 
    2375         wordbooker_debugger("No Settings for ".$post->post_author." so using default author settings",' ',$post->ID,99); 
     2319        wordbooker_debugger("No Settings for ".$post->post_author." so using default author settings",' ',$post->ID,80); 
    23762320        $wb_user_id=$wordbooker_settings["wordbooker_default_author"]; 
    23772321        # New get the user level settings from the DB 
     
    24062350    if ($newstatus=="future") {  
    24072351        $wb_params['wordbooker_scheduled_post']=1; 
    2408         wordbooker_debugger("This looks like a post that is scheduled for future publishing",$newstatus,$post->ID,99); 
     2352        wordbooker_debugger("This looks like a post that is scheduled for future publishing",$newstatus,$post->ID,80); 
    24092353    }    
    24102354    if ($newstatus=="publish" && (!isset($oldstatus) || $oldstatus!="publish") ) {  
    2411         wordbooker_debugger("This looks like a new post being published ",$newstatus,$post->ID,99) ; 
     2355        wordbooker_debugger("This looks like a new post being published ",$newstatus,$post->ID,80) ; 
    24122356        $wb_params['wordbooker_new_post']=1; 
    24132357 
     
    24172361 
    24182362    if ($newstatus=="publish") { 
    2419         wordbooker_debugger("Calling Wordbooker publishing function",' ',$post->ID,99) ; 
     2363        wordbooker_debugger("Calling Wordbooker publishing function",' ',$post->ID,90) ; 
    24202364        wordbooker_publish($post->ID); 
    24212365    } 
     
    24252369    global $user_ID, $user_identity, $user_login, $wpdb, $blog_id,$wordbooker_settings; 
    24262370    $post = get_post($post_id); 
    2427     # If its less than 10 seconds since we saw this post last we give up 
    2428     #$ts=wordbooker_postlogged($post_id,1); 
    2429     #if (isset($ts) && $ts<=60 && $ts>1) {wordbooker_debugger("Publish hook re-fire, ignoring ",$ts,$post_id,99) ; return;} 
    2430     # Clear down the error / diagnostic logs for this post. 
    2431     #wordbooker_deletefrom_errorlogs($post_id); 
    24322371    if ((isset($user_ID) && $user_ID>0) &&  (!current_user_can(WORDBOOKER_MINIMUM_ADMIN_LEVEL))) { wordbooker_debugger("This user doesn't have enough rights"," ",$post_id,99) ; return; } 
    24332372    wordbooker_debugger("Commence Publish "," ",$post_id,99) ;  
     
    24402379    if ((! wordbooker_get_userdata($post->post_author))  && ( !isset($wordbooker_settings['wordbooker_publish_no_user'])))  { wordbooker_debugger("Not a WB user (".$post->post_author.") and no overide - give up "," ",$post_id,99) ; return;} 
    24412380    if ((! wordbooker_get_userdata($wb_user_id))  && ( !isset($wordbooker_settings['wordbooker_publish_no_user'])))  {wordbooker_debugger("Author (".$post->post_author.") not a WB user and no overide- give up "," ",$post_id,99) ;  return;} 
    2442     if ($_POST["wordbooker_default_author"]== 0 ) { wordbooker_debugger("Author of this post is the Post Author"," ",$post->ID,99);  $_POST["wordbooker_default_author"]=$post->post_author; } 
    2443     wordbooker_debugger("Options Set - call transition  "," ",$post_id) ; 
     2381    if ($_POST["wordbooker_default_author"]== 0 ) { wordbooker_debugger("Author of this post is the Post Author"," ",$post->ID,80);  $_POST["wordbooker_default_author"]=$post->post_author; } 
     2382    wordbooker_debugger("Options Set - call transition  "," ",$post_id,80) ; 
    24442383    $retcode=wordbooker_publish_action($post_id); 
    24452384    return $retcode; 
     
    24502389    global $blog_id; 
    24512390    $post = get_post($post_id); 
    2452     wordbooker_debugger("Commence Remote publish "," ",$post->ID,99) ;  
     2391    wordbooker_debugger("Commence Remote publish "," ",$post->ID,80) ;  
    24532392    $wordbooker_settings = wordbooker_options(); 
    24542393}  
     
    25222461# When a user is deleted from the blog we should clear down everything they've done in Wordbooker. 
    25232462add_action('delete_user', 'wordbooker_remove_user'); 
    2524  
    25252463add_action ('init', 'wordbooker_init'); 
    25262464  
    25272465function wordbooker_init () { 
    2528     #load_plugin_textdomain( 'my-plugin', false, dirname( plugin_basename( __FILE__ ) ) ) 
    2529     #$plugin_dir = basename(dirname(__FILE__)); 
    25302466    load_plugin_textdomain ('wordbooker',false,basename(dirname(__FILE__)).'/languages'); 
    25312467} 
    25322468 
    25332469function wordbooker_schema($attr) { 
    2534         $attr .= " xmlns:fb=\"http://www.facebook.com/2008/fbml\" xmlns:og=\"http://opengraphprotocol.org/schema/\" xmlns:fb=\"http://ogp.me/ns/fb#\"  "; 
     2470        $attr .= " xmlns:fb=\"http://www.facebook.com/2008/fbml\" xmlns:og=\"http://ogp.me/ns/fb#\"  "; 
    25352471        return $attr; 
    25362472} 
     
    26132549        add_filter('get_avatar','wordbooker_get_avatar',1, 3 ); 
    26142550    } 
    2615     #add_action('comment_post', 'wordbooker_post_comment', 20); 
    2616     #add_action('wp_set_comment_status', 'wordbooker_set_comment_status', 20, 2); 
    26172551    add_filter('the_content', 'wordbooker_append_post'); 
    26182552    add_filter('the_excerpt','wordbooker_append_post'); 
  • wordbooker/trunk/includes/wordbooker_comments.php

    r506216 r508474  
    153153                    wordbooker_debugger("Blogs posts to send comment to : ".$sql,count($wp_post_rows),-2,98); 
    154154                    foreach ($wp_post_rows as $wp_post_row) { 
    155                     $wordbooker_post_options = get_post_meta($wp_post_row->wp_post_id, '_wordbooker_options', true); 
    156                     if (!isset($wordbooker_post_options['wordbooker_comment_get'])) { 
    157                         wordbooker_debugger("Incoming comments disabled for WP post ".$wp_post_row->wp_post_id,' ',-2,9); 
    158                         wordbooker_debugger("Incoming comments disabled for WP post ".$wp_post_row->wp_post_id,' ',-3,9);    
    159                         continue ; 
    160                     } 
    161                     $data = array( 
    162                         'comment_post_ID' => $wp_post_row->wp_post_id, 
    163                         'comment_author' => $single_comment->from->name, 
    164                         'comment_author_email' => $commemail, 
    165                         'comment_author_url' => 'https://www.facebook.com/'.$single_comment->from->id, 
    166                         'comment_content' =>$single_comment->message, 
    167                         'comment_author_IP' => '127.0.0.1', 
    168                         'comment_date' => $atime, 
    169                         'comment_date_gmt' => $time, 
    170                         'comment_parent'=> 0, 
    171                         'user_id' => 0, 
    172                         'comment_agent' => 'Wordbooker plugin '.WORDBOOKER_CODE_RELEASE, 
    173                         'comment_approved' => $comment_approve, 
    174                     ); 
    175                     $data = apply_filters('preprocess_comment', $data);  
    176                     $data['comment_parent'] = isset($data['comment_parent']) ? absint($data['comment_parent']) : 0; 
    177                     $parent_status = ( 0 < $data['comment_parent'] ) ? wp_get_comment_status($data['comment_parent']) : ''; 
    178                     $data['comment_parent'] = ( 'approved' == $parent_status || 'unapproved' == $parent_status ) ? $data['comment_parent'] : 0; 
    179                     $newComment= wp_insert_comment($data); 
    180                     update_comment_meta($newComment, "fb_uid", $single_comment->from->id); 
    181                     wordbooker_debugger("Inserted comment from ".$single_comment->from->name." into ".$wp_post_row->wp_post_id,"",-2,9); 
    182                     wordbooker_debugger("Inserted comment from ".$single_comment->from->name." into ".$wp_post_row->wp_post_id,"",-3,9); 
    183                     $sql="Insert into ".WORDBOOKER_POSTCOMMENTS." (fb_post_id,user_id,comment_timestamp,wp_post_id,blog_id,wp_comment_id,fb_comment_id,in_out) values ('".$fb_comment->fb_post_id."',".$user_id.",".strtotime($single_comment->created_time).",".$wp_post_row->wp_post_id.",".$blog_id.",".$newComment.",'".$single_comment->id."','in' )"; 
    184                     $wpdb->query($sql); 
    185                     $processed_posts=$processed_posts+1; 
     155                        $wordbooker_post_options = get_post_meta($wp_post_row->wp_post_id, '_wordbooker_options', true); 
     156                        if (!isset($wordbooker_post_options['wordbooker_comment_get'])) { 
     157                            wordbooker_debugger("Incoming comments disabled for WP post ".$wp_post_row->wp_post_id,' ',-2,9); 
     158                            wordbooker_debugger("Incoming comments disabled for WP post ".$wp_post_row->wp_post_id,' ',-3,9);    
     159                            continue ; 
     160                        } 
     161                        $data = array( 
     162                            'comment_post_ID' => $wp_post_row->wp_post_id, 
     163                            'comment_author' => $single_comment->from->name, 
     164                            'comment_author_email' => $commemail, 
     165                            'comment_author_url' => 'https://www.facebook.com/'.$single_comment->from->id, 
     166                            'comment_content' =>$single_comment->message, 
     167                            'comment_author_IP' => '127.0.0.1', 
     168                            'comment_date' => $atime, 
     169                            'comment_date_gmt' => $time, 
     170                            'comment_parent'=> 0, 
     171                            'user_id' => 0, 
     172                            'comment_agent' => 'Wordbooker plugin '.WORDBOOKER_CODE_RELEASE, 
     173                            'comment_approved' => $comment_approve, 
     174                        ); 
     175                        $data = apply_filters('preprocess_comment', $data);  
     176                        $data['comment_parent'] = isset($data['comment_parent']) ? absint($data['comment_parent']) : 0; 
     177                        $parent_status = ( 0 < $data['comment_parent'] ) ? wp_get_comment_status($data['comment_parent']) : ''; 
     178                        $data['comment_parent'] = ( 'approved' == $parent_status || 'unapproved' == $parent_status ) ? $data['comment_parent'] : 0; 
     179                        $newComment= wp_insert_comment($data); 
     180                        update_comment_meta($newComment, "fb_uid", $single_comment->from->id); 
     181                        wordbooker_debugger("Inserted comment from ".$single_comment->from->name." into ".$wp_post_row->wp_post_id,"",-2,9); 
     182                        wordbooker_debugger("Inserted comment from ".$single_comment->from->name." into ".$wp_post_row->wp_post_id,"",-3,9); 
     183                        $sql="Insert into ".WORDBOOKER_POSTCOMMENTS." (fb_post_id,user_id,comment_timestamp,wp_post_id,blog_id,wp_comment_id,fb_comment_id,in_out) values ('".$fb_comment->fb_post_id."',".$user_id.",".strtotime($single_comment->created_time).",".$wp_post_row->wp_post_id.",".$blog_id.",".$newComment.",'".$single_comment->id."','in' )"; 
     184                        $wpdb->query($sql); 
     185                        $processed_posts=$processed_posts+1; 
    186186                    } 
    187187                    wordbooker_debugger("Finished comment inserts for FB post ".$fb_comment->fb_post_id,"",-2,9); 
    188188                    wordbooker_debugger("Finished comment inserts for FB post ".$fb_comment->fb_post_id,"",-3,9); 
     189                } 
     190               else { 
     191                    wordbooker_debugger("Found existing comment for FB post ".$fb_comment->fb_post_id,"from : ".$single_comment->from->name,-2,9); 
     192                    wordbooker_debugger("Found existing comment for FB post ".$fb_comment->fb_post_id,"from : ".$single_comment->from->name,-3,9);   
    189193                } 
    190194            } 
  • wordbooker/trunk/includes/wordbooker_options.php

    r506160 r508474  
    384384        echo '<label for="wb_facebook_gravatars">'.__("Do not replace Gravtars with Facebook Photos", 'wordbooker'). ' : </label>'; 
    385385        echo '<INPUT TYPE=CHECKBOX NAME="wordbooker_settings[wordbooker_no_facebook_gravatars]" '.$checked_flag[$wordbooker_settings["wordbooker_no_facebook_gravatars"]].' ><br />'; 
    386  
     386/* 
    387387        echo "<hr><br />"; 
    388388        echo '<label for="wb_facebook_time">'.__("Use Frictionless sharing / Timeline instead of Share", 'wordbooker'). ' : </label>'; 
    389389        echo '<INPUT TYPE=CHECKBOX NAME="wordbooker_settings[wordbooker_time_button]" '.$checked_flag[$wordbooker_settings["wordbooker_time_button"]].' ><br />'; 
    390 /* 
     390 
    391391        echo '<label for="wb_fbread_location">&nbsp;'.__('Facebook Read - Display Button ', 'wordbooker').' :</label> <select id="wordbooker_fbread_location" name="wordbooker_settings[wordbooker_fbread_location]"  >'; 
    392392        foreach ($fblike_location as $i => $value) { 
     
    490490        global $ol_flash, $wordbooker_settings, $_POST, $wp_rewrite,$user_ID,$wpdb, $blog_id,$wordbooker_user_settings_id,$table_prefix; 
    491491        $checked_flag=array('on'=>'checked','off'=>''); 
     492        if (intval(WORDBOOKER_WP_VERSION)>30){ 
    492493        $admin_users=get_users(array('role'=>'administrator'));; 
    493494        echo '<label for="wordbooker_diagnostic admin">'.__('User who should get Admin level diagnostics', 'wordbooker').' :</label> <select id="wordbooker_diagnostic_admin" name="wordbooker_settings[wordbooker_diagnostic_admin]"  >'; 
     
    496497               else {print '<option value="'.$adminuser->ID.'" >'.$adminuser->display_name.' ( '.$adminuser->user_login.' ) </option>';}} 
    497498        echo "</select><br />"; 
     499        } 
    498500        if (!isset($wordbooker_settings['wordbooker_advanced_diagnostics_level'])) {$wordbooker_settings['wordbooker_advanced_diagnostics_level']=10;} 
    499         $arr = array(0=> __("Show Everything and I mean everything",'wordbooker'),10=> __("Show everything but Cache Diagnostics",'wordbooker'),20=> "50",40=> "100",60=> "120",80=> "150",90=> __("Show result of major actions",'wordbooker'),99 => __("Don't show anything apart from Fatal errors",'wordbooker'),999 => __("Disabled (Show nothing at all)",'wordbooker')); 
     501        $arr = array(0=> __("Show Everything and I mean everything",'wordbooker'),10=> __("Show everything but Cache Diagnostics",'wordbooker'),90=> __("Show result of major actions",'wordbooker'),99 => __("Don't show anything apart from Fatal errors",'wordbooker'),999 => __("Disabled (Show nothing at all)",'wordbooker')); 
    500502        echo '<p><label for="wb_advanced_diagnostics_level">'.__("Post Diagnostics display level", 'wordbooker'). ' : </label><select id="wordbooker_advanced_diagnostics_level" name="wordbooker_settings[wordbooker_advanced_diagnostics_level]"  >'; 
    501503         foreach ($arr as $i => $value) { 
  • wordbooker/trunk/includes/wordbooker_posting.php

    r505615 r508474  
    2828function wordbooker_wall_post($post_id,$access_token,$post_title,$post_data,$target_id,$dummy,$target_name){ 
    2929    if (isset($dummy)) {     
    30         wordbooker_debugger("Wall Post to ".$target_name." Test Only",'No Post Made',$post_id) ; 
     30        wordbooker_debugger("Wall Post to ".$target_name." Test Only",'No Post Made',$post_id,90) ; 
    3131        return; 
    3232    } 
     
    3636        $result = wordbooker_fb_stream_pubish($post_data,$target_id); 
    3737        wordbooker_store_post_result($post_id,$result->id ); 
    38         wordbooker_debugger("Wall Post to ".$target_name." Succeeded - result : ",$result->id,$post_id) ; 
     38        wordbooker_debugger("Wall Post to ".$target_name." Succeeded - result : ",$result->id,$post_id,90) ; 
    3939        } 
    4040    catch (Exception $e) { 
     
    4848function wordbooker_link_post($post_id,$access_token,$post_title,$post_data,$target_id,$dummy,$target_name){ 
    4949    if (isset($dummy)) {     
    50         wordbooker_debugger("Link Post to ".$target_name." Test Only",'No Post Made',$post_id) ; 
     50        wordbooker_debugger("Link Post to ".$target_name." Test Only",'No Post Made',$post_id,90) ; 
    5151        return; 
    5252    } 
     
    5858        $result = wordbooker_fb_link_publish($post_data2,$target_id); 
    5959        wordbooker_store_post_result($post_id,$result->id ); 
    60         wordbooker_debugger("Link Post to ".$target_name." Succeeded - result : ",$result->id,$post_id) ; 
     60        wordbooker_debugger("Link Post to ".$target_name." Succeeded - result : ",$result->id,$post_id,90) ; 
    6161        } 
    6262    catch (Exception $e) { 
     
    7171    wordbooker_debugger("Setting status_text".$wordbooker_post_options['wordbooker_status_update_text']," ",$post_id) ;  
    7272    if (isset($dummy)) {     
    73         wordbooker_debugger("Status update to ".$target_name." Test Only",'No Post Made',$post_id) ; 
     73        wordbooker_debugger("Status update to ".$target_name." Test Only",'No Post Made',$post_id,90) ; 
    7474        return; 
    7575    } 
     
    8181        $result = wordbooker_fb_status_update($data,$target_id); 
    8282        wordbooker_store_post_result($post_id,$result->id ); 
    83         wordbooker_debugger("Status update  to ".$target_name." suceeded result : ",$result->id,$post_id) ; 
     83        wordbooker_debugger("Status update  to ".$target_name." suceeded result : ",$result->id,$post_id,90) ; 
    8484        } 
    8585    catch (Exception $e) { 
     
    9393function wordbooker_notes_post($post_id,$access_token,$post_title,$target_id,$dummy,$target_name){ 
    9494    if (isset($dummy)) {     
    95         wordbooker_debugger("Notes publish  to ".$target_name." Test Only",'No Post Made',$post_id) ; 
     95        wordbooker_debugger("Notes publish  to ".$target_name." Test Only",'No Post Made',$post_id,90) ; 
    9696        return; 
    9797    } 
     
    105105        $result = wordbooker_fb_note_publish($data,$target_id); 
    106106        wordbooker_store_post_result($post_id,$result->id); 
    107         wordbooker_debugger("Note Publish to ".$target_name." result : ",$result->id,$post_id) ; 
     107        wordbooker_debugger("Note Publish to ".$target_name." result : ",$result->id,$post_id,90) ; 
    108108    }    
    109109    catch (Exception $e) { 
  • wordbooker/trunk/readme.txt

    r506219 r508474  
    44Tags: facebook, minifeed, newsfeed, crosspost, WPMU, Facebook Share, Facebook Like, social media 
    55Requires at least: 2.9 
    6 Tested up to: 3.2.1 
    7 Stable tag: 2.1.4 
     6Tested up to: 3.3.1 
     7Stable tag: 2.1.5 
    88 
    99This plugin allows you to cross-post your blog posts to your Facebook Wall and to any Facebook Fan Page / Group that you are an administrator for.  
     
    5353It is certainly similar, but not the same: 
    5454 
    55 - Facebook Notes imports and caches your blog posts (e.g., it subscribes to your blog's RSS feed). 
    56  
    57 Wordbooker uses the Facebook API to actively update your Facebook Wall just as if you had posted an update yourself on facebook.com. It also means that you can make changes to your blog postings *after* initially publishing them. 
     55- Facebook Notes imports and caches your entire blog post - Wordbooker uses the Facebook API to actively update your Facebook Wall just as if you had posted an update yourself on facebook.com. It also means that you can make changes to your blog postings *after* initially publishing them. 
    5856 
    5957- With Wordbooker, your blog postings will have their own space in your Facebook Wall - just as if you'd written directly on to the wall yourself. 
     
    6765So it looks something like :  <html xmlns="http://www.w3.org/1999/xhtml" xmlns:v="urn:schemas-microsoft-com:vml" xmlns:fb="http://www.facebook.com/2008/fbml"> 
    6866 
    69  
     67  
    7068= Why aren't my blog posts showing up in Facebook? = 
    7169 
     
    7876= My WordPress database doesn't use the default 'wp_' table prefix. Will this plugin still work? = 
    7977 
    80 Yes, and its also WPMU compliant. 
     78Yes, and its also WPMU/ WP Networked Blogs mode compliant. 
    8179 
    8280 
     
    10199- Use the [Wordbooker Support Forums](http://wordbooker.tty.org.uk/forums/). Either start a new topic, or add to an existing topic. 
    102100 
    103 - Alternatively, Go to the Wordbooker Page on [GoogleCode](http://code.google.com/p/wordbooker/). 
     101- Alternatively, for major feature requests go to the Wordbooker Page on [GoogleCode](http://code.google.com/p/wordbooker/). 
    104102 
    105103 
     
    117115== Changelog == 
    118116 
     117= Version 2.1.5 21/02/2012 = 
     118- Coded round the fact that get_users is a WP>3.0 function. So users on WP<3.1 dont get the option to chose the admin user for diagnostic messages 
     119- Added extra diagnostic for comments that have already ben pulled from Facebook 
     120- Reviewed and ratified all the diagnostic message levels. 
     121- Fixed an obscure bug where the FB Comments block didn't show if you turned off Wordbooker's FB Like and Share buttons. 
     122- Change image handling code so that filenames with single quotes in them don't blow things up. As Wordpress uses " " round image URLs this should be OK. 
     123- Fixed a typo in the user guide - all the short tags had [[ ]] rather than [ ] 
     124- Disabled the frictionless sharing option as it was doing some very odd things - like even though I was using an APP access token it was filling MY timeline up. 
     125- Removed a duplicated xmlns tag. 
     126 
     127 
    119128= Version 2.1.4 16/02/2012 =  
    120129- Rebuild for SVN after WP restored the plugin and messed things up 
    121130 
     131 
    122132= Version 2.1.3 16/02/2012 =  
    123133- Rebuild for SVN after WP restored the plugin and messed things up 
    124134 
     135 
    125136= Version 2.1.2 16/02/2012 =  
    126137- Lost in SVN after WP restored the plugin and messed things up 
     138 
    127139 
    128140= Version 2.1.1 16/02/2012 = 
  • wordbooker/trunk/wordbooker.php

    r506219 r508474  
    66Author: Steve Atty  
    77Author URI: http://wordbooker.tty.org.uk 
    8 Version: 2.1.4 
     8Version: 2.1.5 
    99*/ 
    1010 
     
    3939define('WORDBOOKER_DEBUG', false); 
    4040define('WORDBOOKER_TESTING', false); 
    41 define('WORDBOOKER_CODE_RELEASE','2.1.4 - Fish Beach'); 
     41define('WORDBOOKER_CODE_RELEASE',"2.1.5 - Caliban's Pit"); 
    4242 
    4343# For Troubleshooting  
     
    721721    #echo "!!!!".$user_ID; 
    722722    $count_rows = $wpdb->get_results('SELECT count(*) as count FROM ' . WORDBOOKER_ERRORLOGS . ' WHERE user_ID = ' . $user_ID . '  and blog_id='.$blog_id); 
    723     $rows = $wpdb->get_results('SELECT * FROM ' . WORDBOOKER_ERRORLOGS . ' WHERE user_ID = ' . $user_ID . '  and blog_id='.$blog_id.' and diag_level >'.$diaglevel.' order by sequence_id asc'); 
     723    $rows = $wpdb->get_results('SELECT * FROM ' . WORDBOOKER_ERRORLOGS . ' WHERE user_ID = ' . $user_ID . '  and blog_id='.$blog_id.' and diag_level >='.$diaglevel.' order by sequence_id asc'); 
    724724    if ($count_rows[0]->count >= 1) { 
    725725?> 
     
    12521252 
    12531253    if ( function_exists( 'get_the_post_thumbnail' ) ) {  
    1254         wordbooker_debugger("Getting the thumnail image"," ",$post->ID) ; 
     1254        wordbooker_debugger("Getting the thumnail image"," ",$post->ID,80) ; 
    12551255        preg_match_all('/<img \s+ ([^>]*\s+)? src \s* = \s* [\'"](.*?)[\'"]/ix',get_the_post_thumbnail($post_id), $matches_tn);  
    12561256    } 
     
    12581258    $meta_tag_scan=explode(',',$wordbooker_settings['wordbooker_meta_tag_scan']); 
    12591259    foreach($meta_tag_scan as $meta_tag) { 
    1260         wordbooker_debugger("Getting image from custom meta : ",$meta_tag,$post->ID) ; 
     1260        wordbooker_debugger("Getting image from custom meta : ",$meta_tag,$post->ID,80) ; 
    12611261        $matches_ct[]=get_post_meta($post->ID, $meta_tag, TRUE); 
    12621262    } 
     
    12831283        if (!isset($wordbooker_settings["wordbooker_meta_tag_thumb"])) { 
    12841284            if (! isset($wordbooker_post_options["wordbooker_thumb_only"]) ) { 
    1285                 wordbooker_debugger("Setting image array to be both thumb and the post images "," ",$post->ID) ; 
     1285                wordbooker_debugger("Setting image array to be both thumb and the post images "," ",$post->ID,80) ; 
    12861286                $pulled_images=@array_merge($matches[2],$matched[2],$yturls,$matches); 
    12871287            } 
    12881288            else { 
    1289                 wordbooker_debugger("Setting image array to be just thumb "," ",$post->ID) ; 
     1289                wordbooker_debugger("Setting image array to be just thumb "," ",$post->ID,80) ; 
    12901290                $pulled_images[]=$matches[2]; 
    12911291            }  
     
    12941294 
    12951295    if (isset($wordbooker_settings["wordbooker_meta_tag_thumb"]) && isset($wordbooker_post_options["wordbooker_thumb_only"]) ) { 
    1296     wordbooker_debugger("Setting image array to be just thumb from meta. "," ",$post->ID) ; 
     1296    wordbooker_debugger("Setting image array to be just thumb from meta. "," ",$post->ID,80) ; 
    12971297    $pulled_images[]=$matches_ct[2];} 
    12981298 
    12991299    else { 
    1300         wordbooker_debugger("Setting image array to be post and thumb images. "," ",$post->ID) ; 
     1300        wordbooker_debugger("Setting image array to be post and thumb images. "," ",$post->ID,80) ; 
    13011301        if (is_array($matched[2])) {$pulled_images[]=array_merge($matches,$matched[2]);} 
    13021302        if (is_array($matched[2]) && is_array($yturls)) {$pulled_images=array_merge($matches,$matched[2],$yturls);} 
     
    13461346        if (isset($wordbooker_settings['wordbooker_use_this_image']))  { 
    13471347            $images[]=$wordbooker_settings['wb_wordbooker_default_image']; 
    1348             wordbooker_debugger("No Post images found so using open graph default to keep Facebook happy ",'',$post->ID) ; 
     1348            wordbooker_debugger("No Post images found so using open graph default to keep Facebook happy ",'',$post->ID,90) ; 
    13491349            }  
    13501350        else { 
    13511351            $x=get_bloginfo('wpurl').'/wp-content/plugins/wordbooker/includes/wordbooker_blank.jpg'; 
    13521352            $images[]=$x; 
    1353             wordbooker_debugger("No Post images found so loading blank to keep Facebook happy ",'',$post->ID) ;  
     1353            wordbooker_debugger("No Post images found so loading blank to keep Facebook happy ",'',$post->ID,90) ;   
    13541354            } 
    13551355        } 
     
    13711371    // Set post_meta to be first image 
    13721372    update_post_meta($post->ID,'_wordbooker_thumb',$images[0]['src']); 
    1373     wordbooker_debugger("Getting the Excerpt"," ",$post->ID) ; 
     1373    wordbooker_debugger("Getting the Excerpt"," ",$post->ID,80) ; 
    13741374    unset ($processed_content); 
    13751375    if (isset($wordbooker_post_options["wordbooker_use_excerpt"])  && (strlen($post->post_excerpt)>3)) {  
     
    14151415    ); 
    14161416    if (isset($wordbooker_settings['wordbooker_use_url_not_slug'])) { unset($wordbooker_fb_post['caption']);} 
    1417     wordbooker_debugger("Post Titled : ",$post_data['post_title'],$post_id,99) ; 
    1418     wordbooker_debugger("Post URL : ",$post_data['post_link'],$post_id,99) ; 
     1417    wordbooker_debugger("Post Titled : ",$post_data['post_title'],$post_id,90) ; 
     1418    wordbooker_debugger("Post URL : ",$post_data['post_link'],$post_id,90) ; 
    14191419     
    14201420    if ($wordbooker_post_options['wordbooker_actionlink']==100) { 
    14211421        // No action link 
    1422         wordbooker_debugger("No action link being used","",$post_id,99) ; 
     1422        wordbooker_debugger("No action link being used","",$post_id,80) ; 
    14231423    } 
    14241424    if ($wordbooker_post_options['wordbooker_actionlink']==200) { 
    14251425        // Share This 
    1426         wordbooker_debugger("Share Link being used"," ",$post_id,99) ; 
     1426        wordbooker_debugger("Share Link being used"," ",$post_id,80) ; 
    14271427        $action_links = array('name' => __('Share', 'wordbooker'),'link' => 'http://www.facebook.com/share.php?u='.urlencode($post_data['post_link_share'])); 
    14281428        $wordbooker_fb_post['actions']=json_encode($action_links); 
     
    14301430    if ($wordbooker_post_options['wordbooker_actionlink']==300) { 
    14311431        // Read Full 
    1432         wordbooker_debugger("Read Full link being used"," ",$post_id,99) ; 
     1432        wordbooker_debugger("Read Full link being used"," ",$post_id,80) ; 
    14331433        $action_links = array('name' => __('Read entire article', 'wordbooker'),'link' => $post_data['post_link_share']); 
    14341434        $wordbooker_fb_post['actions'] =json_encode($action_links); 
     
    14591459        if (isset($posting_target['target_active'])) { 
    14601460            $target_type=substr($posting_target['target'],0,2); 
    1461             wordbooker_debugger("Posting to ".$target_types[$target_type]." ".$target_name." (".$posting_target['target_id'].") as a ".$posting_type[$posting_target['target_type']],"",$post_id,99) ;  
     1461            wordbooker_debugger("Posting to ".$target_types[$target_type]." ".$target_name." (".$posting_target['target_id'].") as a ".$posting_type[$posting_target['target_type']],"",$post_id,90) ;  
    14621462            if ($access_token=='dummy access token') {$access_token=$wbuser->access_token;} 
    14631463            $target=substr($posting_target['target'],3); 
     
    14821482            } 
    14831483 
    1484         } else {wordbooker_debugger("Posting to ".$posting_target['target_id']." target (".$target_name.") not active","",$post_id,99) ; } 
     1484        } else {wordbooker_debugger("Posting to ".$posting_target['target_id']." target (".$target_name.") not active","",$post_id,90) ; } 
    14851485 
    14861486    } 
     
    14971497        if (in_array($file_extension,$image_types)){ 
    14981498        foreach ($strip_array as $strip_domain) { 
    1499             wordbooker_debugger("Looking for ".$strip_domain." in ".$single," ",$post->ID,200) ; 
    1500             if (stripos($single,$strip_domain)) {wordbooker_debugger("Found a match so dump the image",$single,$post->ID,200) ;} else { if (!in_array($single,$newimages)){$newimages[]=$single;}} 
    1501         }} else {wordbooker_debugger("Image URL ".$single." not valid "," ",$post->ID,200) ;} 
     1499            wordbooker_debugger("Looking for ".$strip_domain." in ".$single," ",$post->ID,80) ; 
     1500            if (stripos($single,$strip_domain)) {wordbooker_debugger("Found a match so dump the image",$single,$post->ID,80) ;} else { if (!in_array($single,$newimages)){$newimages[]=$single;}} 
     1501        }} else {wordbooker_debugger("Image URL ".$single." not valid "," ",$post->ID,90) ;} 
    15021502    } 
    15031503    return $newimages; 
     
    16091609     
    16101610    $wordbooker_settings = wordbooker_options();  
    1611     if  (isset($wordbooker_settings['wordbooker_like_button_show']) || isset($wordbooker_settings['wordbooker_like_share_too']))  
     1611    if  (isset($wordbooker_settings['wordbooker_like_button_show']) || isset($wordbooker_settings['wordbooker_like_share_too'] ) || isset($wordbooker_settings['wordbooker_use_fb_comments']))  
    16121612        { 
    16131613        echo $efb_script; 
     
    16181618#   echo '\n<script type="text/javascript " defer="defer" > setTimeout("wordbooker_read()",3000); </script> \n'; 
    16191619    echo "\n<!-- Wordbooker code revision : ".WORDBOOKER_CODE_RELEASE." -->\n"; 
    1620  
    1621 if ( is_single() ) { 
    1622     if (isset($wordbooker_settings['wordbooker_time_button'])) { 
    1623         $frictionless=array('article' => get_permalink(),'access_token'=>'AAAAAO0YAejkBAE3gGR2KjCr6WhUO1ZBNyXHP6vaQoQLbwvlDyKDK0BIMZBb6mVyk2ZAbvPEXyrZCLNd6Bb8TA0HJCKGkotUZD'); 
    1624         #var_dump($frictionless); 
    1625         try { 
    1626         #$x=wordbooker_make_curl_post_call('https://graph.facebook.com/me/news.reads',$frictionless); 
    1627         $x=wordbooker_make_curl_post_call('https://graph.facebook.com/me/wordbooker:wordbooker_read',$frictionless); 
    1628         #var_dump($x); 
    1629         }    
    1630         catch  (Exception $e) { 
    1631                 $error_msg = $e->getMessage(); 
    1632             #   var_dump($error_msg); 
    1633         } 
    1634     } 
    1635 } 
    1636  
     1620    if ( is_single() ) { 
     1621        if (isset($wordbooker_settings['wordbooker_time_button'])) { 
     1622            $stuff=array('type'=>'client_cred','client_id'=>WORDBOOKER_FB_ID,'client_secret'=>WORDBOOKER_FB_SECRET); 
     1623            $access_token=wordbooker_make_curl_call('https://graph.facebook.com/oauth/access_token',$stuff); 
     1624        #   $frictionless=array('article' => get_permalink(),'access_token'=>'AAAAAO0YAejkBAE3gGR2KjCr6WhUO1ZBNyXHP6vaQoQLbwvlDyKDK0BIMZBb6mVyk2ZAbvPEXyrZCLNd6Bb8TA0HJCKGkotUZD');# 
     1625            $frictionless=array('article' => get_permalink(),'access_token'=>$access_token); 
     1626            var_dump($frictionless); 
     1627            try { 
     1628            #$x=wordbooker_make_curl_post_call('https://graph.facebook.com/me/news.reads',$frictionless); 
     1629            #$x=wordbooker_make_curl_post_call('https://graph.facebook.com/me/wordbooker:wordbooker_read',$frictionless); 
     1630            var_dump($x); 
     1631            }    
     1632            catch  (Exception $e) { 
     1633                    $error_msg = $e->getMessage(); 
     1634                    var_dump($error_msg); 
     1635            } 
     1636        } 
     1637    } 
    16371638return $blah; 
    16381639} 
     
    17371738    $wordbooker_settings = wordbooker_options();  
    17381739    # Now we just call the wordbooker_og_tags function. 
    1739     if (!isset ( $wordbooker_settings['wordbooker_fb_disable_og'])) { 
    1740         wordbooker_og_tags(); 
    1741     } 
     1740    if (!isset ( $wordbooker_settings['wordbooker_fb_disable_og'])) { wordbooker_og_tags(); } 
    17421741    return $blah; 
    17431742} 
     
    20342033    if ($post->post_type=='forum') { return;} 
    20352034    $wordbooker_settings = wordbooker_options();  
    2036     if (!isset($wordbooker_settings['wordbooker_like_button_show']) && !isset($wordbooker_settings['wordbooker_like_share_too'])) {return $post_cont;} 
     2035    if (!isset($wordbooker_settings['wordbooker_like_button_show']) && !isset($wordbooker_settings['wordbooker_like_share_too']) && !isset($wordbooker_settings['wordbooker_use_fb_comments'])) {return $post_cont;} 
    20372036    $post_cont2=$post_cont; 
    20382037    $post_link = get_permalink($post->ID); 
     
    21152114    return $result; 
    21162115} 
    2117  
    2118  
    21192116 
    21202117function wordbooker_check_permissions($wbuser,$user) { 
     
    21452142} 
    21462143 
    2147 function wordbooker_contributed($url=0) { 
    2148     global $user_ID; 
    2149     if ($url==0){ 
    2150         $contributors=array('1595132200','100000818019269','39203171','666800299','500073624','711830142','503549492','100000589976474','254577506873','1567300610','701738627','100000442094620','754015348','29404010','748636937', 
    2151  '676888540','768354692','1607820784','1709067850','769804853','100001597808077','1162591229','736138968','532656880','1000013707847','1352285955','836328641', 
    2152  '23010694256','129976890383044','679511648','100001305747796','138561766210548','535106029','202891313077099','567894174','10150158518404391','689075829','214145618608444', 
    2153 '23087261000','195010903860640','123977274343185' 
    2154 ); 
    2155         $facebook_id=wordbooker_get_cache($user_ID,'facebook_id'); 
    2156         return in_array($facebook_id->facebook_id,$contributors); 
    2157     } 
    2158  
    2159     if ($url==1){ 
    2160         $blogs=array( 
    2161 "Steve's Blog"=>'blogs.canalplan.org.uk/steve',"Powered by Dan!"=>'dangarion.com',"Kathryn's Comments"=>'www.kathrynhuxtable.org/blog',"Luke Writes"=>'www.lukewrites.com', 
    2162 "It's Nature"=>'www.itsnature.org',"Eat in OC"=>'eatinoc.com',"Christian Albert Muller"=>'christian-albert-mueller.com/blog/',"[overcrooked|de]"=>'blog.overcrooked.de/', 
    2163 "Jesus is My Buddy"=>'www.jesusismybuddy.com',"Shirts of Bamboo"=>'www.shirtsofbamboo.com', "What's that bug?"=>'www.whatsthatbug.com',"Philip Bussman"=>'www.philipbussmann.com', 
    2164 "PhantaNews"=>'phantanews.de/wp/', "HKMacs"=>'hkmacs.com/Blog', "Techerator"=>'www.techerator.com', "Mosalar.com"=>'www.mosalar.com/', 
    2165 "Nono & His Self-Centered Universe"=>'www.noelacosta.com/',"Chart Porn"=>'www.chartporn.org',"Pawesome"=>'www.pawesome.net',"Margaret & Ian's Website"=>'www.margaretandian.com/', 
    2166 "The GBMINI website"=>'www.gbmini.net',"Roca"=>'rocamusic.ca/home',"Drew Rozell"=>'www.drewrozell.com/',"Kartext"=>'www.nitsche.org/', 
    2167 "Doug Berch - Musician and Appalachian Mountain Dulcimer Maker"=>'dougberch.com',"My Lifestyle Blog"=>'www.mylifestyleblog.de', 
    2168 "tina rawatta photography" => 'www.tinarawatta.com',"Gary Said..."=>'GarySaid.com',"Bachateros Online Magazine"=>'www.bachateros.com.au/',"Linh's e-place"=>'www.linh.se', 
    2169 "InkMusings" => 'www.inkmusings.com',"Jürgen Koller's website"=>'www.kollermedia.at',"Walk With Ben"=>'www.walkwithben.com',"GardenFork"=>'www.http://www.gardenfork.tv/', 
    2170 "A Low Man's Lyric"=>'vivekiyer.net/',"OutofRange.net"=>'www.outofrange.net/',"This Ambitious Orchestra"=>'ambitiousorchestra.com',"Lydia Salnikova"=>'www.lydiasalnikova.com/', 
    2171 "Westpark Gamers"=>'www.westpark-gamers.de/', "The Camera Zealot"=>'www.camerazealot.com', " Best Raw Organic" => 'BestRawOrganic.com',"Gibson Designs"=>'gibsondesigns.net', 
    2172 "Looking out from Under"=>'www.lookingoutfromunder.com',"Our Excellent Adventures"=>'www.ourexcellentadventures.com', 
    2173 "wisiwi.com - Das Magazin für Unternehmer"=>'www.wisiwi.com/',"Just One Cookbook"=>'justonecookbook.com/blog/',"Surfdog 2011"=>'hastenteufel.name/blog', 
    2174 "Vice Versa Advertising Photography"=>'www.viceversa.gr/',"Swimming Pools Designs"=>'www.swimming-pools-designs.com',"Eastleigh District Scouts"=>'www.eastleigh-scouts.org.uk',"Sparkpr"=>'www.sparkpr.com',"Charlie Glickman - Adult Sexuality Education"=>'www.charlieglickman.com/',"iEatAtTheBar"=>'www.ieatatthebar.com/',"Devil's Cove | Boats, Booze & Fun on Lake Travis"=>'http://www.devilscove.com/',"Bored. Cure your boredom!"=>'bored.overnow.com/',"KinkyThought"=>'kinkythought.com/', 
    2175 "The Chronicles of Mommia"=>'www.thechroniclesofmommia.com/',"Total Humour"=>'www.totalhumour.com/',"Six Seconds"=>'www.6seconds.org/',"The APBA Blog"=>'www.apbablog.com',"The Doc is In"=>'www.thedocisin.net',"KitchenTableWisdom"=>'www.kitchentablewisdom.com/',"CNYRadio.com / CNYTVNews.com"=>'www.cnyradio.com/' 
    2176  
    2177 ); 
    2178         $keys = array_keys($blogs); 
    2179         shuffle($keys); 
    2180      
    2181         foreach ( $keys as $key) { 
    2182             echo "<a href='http://".htmlspecialchars($blogs[$key])."' target='_new'>".htmlspecialchars($key)."</a>,&nbsp;"; 
    2183         } 
    2184         # And then put canalplan on the end of it - saves us having to do clever things to remove commas 
    2185         echo "<a href='http://www.canalplan.org.uk/' target='_new' >CanalPlan AC</a><br />"; 
    2186     } 
    2187 } 
    21882144/****************************************************************************** 
    21892145 * WordPress hooks: update Facebook when a blog entry gets published. 
     
    22092165         } 
    22102166    } 
    2211  
    22122167    $excerpt = preg_replace('#(<wpg.*?>).*?(</wpg2>)#', '$1$2', $excerpt); 
    22132168    $excerpt=wordbooker_translate($excerpt); 
     
    22542209        if (is_array($wordbooker_post_options)){ 
    22552210        foreach (array_keys($wordbooker_post_options) as $key){ 
    2256             wordbooker_debugger("Post option : ".$key,$wordbooker_post_options[$key],$post->ID) ; 
     2211            wordbooker_debugger("Post option : ".$key,$wordbooker_post_options[$key],$post->ID,80) ; 
    22572212        } 
    22582213    } 
    22592214     
    22602215    if ($wordbooker_post_options["wordbooker_publish_default"]=="200") { $wordbooker_post_options["wordbooker_publish_default"]='on';} 
    2261  
    22622216 
    22632217    # If the user_ID is set then lets use that, if not get the user_id from the post 
     
    22712225        return; 
    22722226    } 
    2273     wordbooker_debugger("User has been set to : ",$wpuserid,$post->ID) ; 
     2227    wordbooker_debugger("User has been set to : ",$wpuserid,$post->ID,80) ; 
    22742228    if (!$wbuser = wordbooker_get_userdata($wpuserid) ) { 
    22752229        wordbooker_debugger("Unable to get FB session for : ",$wpuserid,$post->ID) ; 
    22762230        return 28; 
    22772231    } 
    2278     wordbooker_debugger("Posting as user : ",$wpuserid,$post->ID) ; 
    2279  
    2280     wordbooker_debugger("Calling wordbooker_fbclient_publishaction"," ",$post->ID) ; 
     2232    wordbooker_debugger("Posting as user : ",$wpuserid,$post->ID,80) ; 
     2233 
     2234    wordbooker_debugger("Calling wordbooker_fbclient_publishaction"," ",$post->ID,99) ; 
    22812235    wordbooker_fbclient_publishaction($wbuser, $post->ID); 
    22822236    unset($doing_post); 
     
    22842238} 
    22852239 
    2286 /* 
    2287 function wordbooker_transition_post_status($newstatus, $oldstatus, $post_id) { 
    2288  
    2289     if ($newstatus == 'publish') { 
    2290         return wordbooker_publish_action($post_id); 
    2291     } 
    2292  
    2293     return 31;   
    2294 } 
    2295 */ 
    22962240 
    22972241function wordbooker_delete_post($post_id) {  
     
    23242268        update_post_meta($post->ID, '_wordbooker_options', $wordbooker_sets);  
    23252269    } 
    2326 if (!$newstatus=="publish") { return;} 
     2270    if (!$newstatus=="publish") { return;} 
    23272271    # If this is a password protected post we give up 
    23282272    if ($post->post_password != '') {return;} 
     
    23732317 
    23742318    if ( !wordbooker_get_userdata($post->post_author)) { 
    2375         wordbooker_debugger("No Settings for ".$post->post_author." so using default author settings",' ',$post->ID,99); 
     2319        wordbooker_debugger("No Settings for ".$post->post_author." so using default author settings",' ',$post->ID,80); 
    23762320        $wb_user_id=$wordbooker_settings["wordbooker_default_author"]; 
    23772321        # New get the user level settings from the DB 
     
    24062350    if ($newstatus=="future") {  
    24072351        $wb_params['wordbooker_scheduled_post']=1; 
    2408         wordbooker_debugger("This looks like a post that is scheduled for future publishing",$newstatus,$post->ID,99); 
     2352        wordbooker_debugger("This looks like a post that is scheduled for future publishing",$newstatus,$post->ID,80); 
    24092353    }    
    24102354    if ($newstatus=="publish" && (!isset($oldstatus) || $oldstatus!="publish") ) {  
    2411         wordbooker_debugger("This looks like a new post being published ",$newstatus,$post->ID,99) ; 
     2355        wordbooker_debugger("This looks like a new post being published ",$newstatus,$post->ID,80) ; 
    24122356        $wb_params['wordbooker_new_post']=1; 
    24132357 
     
    24172361 
    24182362    if ($newstatus=="publish") { 
    2419         wordbooker_debugger("Calling Wordbooker publishing function",' ',$post->ID,99) ; 
     2363        wordbooker_debugger("Calling Wordbooker publishing function",' ',$post->ID,90) ; 
    24202364        wordbooker_publish($post->ID); 
    24212365    } 
     
    24252369    global $user_ID, $user_identity, $user_login, $wpdb, $blog_id,$wordbooker_settings; 
    24262370    $post = get_post($post_id); 
    2427     # If its less than 10 seconds since we saw this post last we give up 
    2428     #$ts=wordbooker_postlogged($post_id,1); 
    2429     #if (isset($ts) && $ts<=60 && $ts>1) {wordbooker_debugger("Publish hook re-fire, ignoring ",$ts,$post_id,99) ; return;} 
    2430     # Clear down the error / diagnostic logs for this post. 
    2431     #wordbooker_deletefrom_errorlogs($post_id); 
    24322371    if ((isset($user_ID) && $user_ID>0) &&  (!current_user_can(WORDBOOKER_MINIMUM_ADMIN_LEVEL))) { wordbooker_debugger("This user doesn't have enough rights"," ",$post_id,99) ; return; } 
    24332372    wordbooker_debugger("Commence Publish "," ",$post_id,99) ;  
     
    24402379    if ((! wordbooker_get_userdata($post->post_author))  && ( !isset($wordbooker_settings['wordbooker_publish_no_user'])))  { wordbooker_debugger("Not a WB user (".$post->post_author.") and no overide - give up "," ",$post_id,99) ; return;} 
    24412380    if ((! wordbooker_get_userdata($wb_user_id))  && ( !isset($wordbooker_settings['wordbooker_publish_no_user'])))  {wordbooker_debugger("Author (".$post->post_author.") not a WB user and no overide- give up "," ",$post_id,99) ;  return;} 
    2442     if ($_POST["wordbooker_default_author"]== 0 ) { wordbooker_debugger("Author of this post is the Post Author"," ",$post->ID,99);  $_POST["wordbooker_default_author"]=$post->post_author; } 
    2443     wordbooker_debugger("Options Set - call transition  "," ",$post_id) ; 
     2381    if ($_POST["wordbooker_default_author"]== 0 ) { wordbooker_debugger("Author of this post is the Post Author"," ",$post->ID,80);  $_POST["wordbooker_default_author"]=$post->post_author; } 
     2382    wordbooker_debugger("Options Set - call transition  "," ",$post_id,80) ; 
    24442383    $retcode=wordbooker_publish_action($post_id); 
    24452384    return $retcode; 
     
    24502389    global $blog_id; 
    24512390    $post = get_post($post_id); 
    2452     wordbooker_debugger("Commence Remote publish "," ",$post->ID,99) ;  
     2391    wordbooker_debugger("Commence Remote publish "," ",$post->ID,80) ;  
    24532392    $wordbooker_settings = wordbooker_options(); 
    24542393}  
     
    25222461# When a user is deleted from the blog we should clear down everything they've done in Wordbooker. 
    25232462add_action('delete_user', 'wordbooker_remove_user'); 
    2524  
    25252463add_action ('init', 'wordbooker_init'); 
    25262464  
    25272465function wordbooker_init () { 
    2528     #load_plugin_textdomain( 'my-plugin', false, dirname( plugin_basename( __FILE__ ) ) ) 
    2529     #$plugin_dir = basename(dirname(__FILE__)); 
    25302466    load_plugin_textdomain ('wordbooker',false,basename(dirname(__FILE__)).'/languages'); 
    25312467} 
    25322468 
    25332469function wordbooker_schema($attr) { 
    2534         $attr .= " xmlns:fb=\"http://www.facebook.com/2008/fbml\" xmlns:og=\"http://opengraphprotocol.org/schema/\" xmlns:fb=\"http://ogp.me/ns/fb#\"  "; 
     2470        $attr .= " xmlns:fb=\"http://www.facebook.com/2008/fbml\" xmlns:og=\"http://ogp.me/ns/fb#\"  "; 
    25352471        return $attr; 
    25362472} 
     
    26132549        add_filter('get_avatar','wordbooker_get_avatar',1, 3 ); 
    26142550    } 
    2615     #add_action('comment_post', 'wordbooker_post_comment', 20); 
    2616     #add_action('wp_set_comment_status', 'wordbooker_set_comment_status', 20, 2); 
    26172551    add_filter('the_content', 'wordbooker_append_post'); 
    26182552    add_filter('the_excerpt','wordbooker_append_post'); 
Note: See TracChangeset for help on using the changeset viewer.