WordPress.org

Plugin Directory

Changeset 540440


Ignore:
Timestamp:
05/06/12 09:37:50 (2 years ago)
Author:
SteveAtty
Message:

2.1.11 - fixes serious bug in attachment handling

Location:
wordbooker
Files:
5 edited
13 copied

Legend:

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

    r539162 r540440  
    118118    $wordbooker_settings=get_option('wordbooker_settings');  
    119119    $comment_approve=0; 
    120     if (isset($wordbooker_settings['wordbook_comment_approve'])) {$comment_approve=1;} 
     120    if (isset($wordbooker_settings['wordbooker_comment_approve'])) {$comment_approve=1;} 
    121121    $sql='Select distinct fb_post_id from '.WORDBOOKER_POSTCOMMENTS.' where fb_comment_id is null and user_id='.$user_id.' and blog_id='.$blog_id. " and in_out is null "; 
    122122    $rows = $wpdb->get_results($sql); 
  • wordbooker/tags/2.1.11/includes/wordbooker_facebook_curl.php

    r539162 r540440  
    6868 
    6969function wordbooker_get_access_token($access_token) { 
    70     $url='https://graph.facebook.com/oauth/access_token?client_id='.WORDBOOKER_FB_ID.'&client_secret='.WORDBOOKER_FB_SECRET.'&grant_type=fb_exchange_token&fb_exchange_token='.$access_token.'&format=JSON-STRINGS'; 
     70    $url='https://graph.facebook.com/oauth/access_token?client_id='.WORDBOOKER_FB_ID.'&client_secret='.WORDBOOKER_FB_SECRET.'&grant_type=fb_exchange_token&fb_exchange_token='.$access_token; 
     71    #var_dump($url); 
    7172    $x=wordbooker_make_curl_call($url); 
     73    #var_dump($x); 
    7274    return($x); 
    7375} 
  • wordbooker/tags/2.1.11/includes/wordbooker_fb_widget.php

    r539162 r540440  
    7878        echo "<!-- Wordbooker FB like box widget -->"; 
    7979        if ( (!isset($wordbooker_settings['wordbooker_like_button_show']) && !isset($wordbooker_settings['wordbooker_like_share_too'])) || isset($wordbooker_settings['wordbooker_iframe'])) { 
    80     echo'<iframe src="http://www.facebook.com/plugins/likebox.php?href='.urlencode(strtolower($url)).'&amp;width='.$width.'&amp;colorscheme='.$scheme.'&amp;show_faces='.$faces.'&amp;border_color=%23'.$border_colour.'&amp;stream='.$stream.'&amp;header='.$header.'&amp;height='.$height.'" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:'.$width.'px; height:'.$height.'px;" allowTransparency="true"></iframe>'; 
     80    echo'<iframe src="https://www.facebook.com/plugins/likebox.php?href='.urlencode(strtolower($url)).'&amp;width='.$width.'&amp;colorscheme='.$scheme.'&amp;show_faces='.$faces.'&amp;border_color=%23'.$border_colour.'&amp;stream='.$stream.'&amp;header='.$header.'&amp;height='.$height.'" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:'.$width.'px; height:'.$height.'px;" allowTransparency="true"></iframe>'; 
    8181        } 
    8282        else { 
     
    114114        $result = wordbooker_get_cache($user_ID,'pages',1); 
    115115        $fanpages=unserialize($result->pages); 
    116         $xx=array('id'=>'FW:254577506873','name'=>'Wordbooker','url'=>'http://www.facebook.com/wordbooker'); 
     116        $xx=array('id'=>'FW:254577506873','name'=>'Wordbooker','url'=>'https://www.facebook.com/wordbooker'); 
    117117        $fanpages[]=$xx; 
    118118        $default = array( 'title' => __('Fan Page','wordbooker'), 'snorl'=>$user_ID, 'dname'=>'', 'pid'=>'254577506873', 'stream'=>'false', 'connections'=>6, 'width'=>188, 'height'=>260, 'header'=>'false', 'scheme'=>'light' ); 
  • wordbooker/tags/2.1.11/readme.txt

    r539774 r540440  
    55Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=8XNJMQCYDJT6U&lc=GB&currency_code=GBP&bn=PP%2dDonationsBF%3abtn_donateCC_LG%2egif%3aNonHosted 
    66Requires at least: 2.9 
    7 Tested up to: 3.3.1 
    8 Stable tag: 2.1.10 
     7Tested up to: 3.3.2 
     8Stable tag: 2.1.11 
    99 
    1010This 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.  
     
    117117 
    118118== Changelog == 
     119 
     120= Version 2.1.11 06/05/2012 = 
     121- Added some more diagnostics to the token exchange code to try to work out what is going on when its too short 
     122- Put in a patch so that if the token update fails it uses the existing token - this is a dirty fix but gives me time to work on a proper fix. 
     123- Put some null post_ID checking in to get round Wordpress returning ALL assets in a blog when you pass a null ID to it which blew up blogs when you went to add a post. 
     124- Changed some HTTP references to HTTPS to hopefully stop warnings when running blogs on HTTPS front ends. 
     125- Fixed a typo in the auto approve comment variable check. Thanks to Stefan Jacobi 
     126- Tidied up the schema cross check code and moved it into its own function. Part of longer term plan to strip a lot of the "non core" code out of the main wordbooker file. 
     127 
    119128 
    120129= Version 2.1.10 04/05/2012 = 
  • wordbooker/tags/2.1.11/wordbooker.php

    r539774 r540440  
    66Author: Steve Atty  
    77Author URI: http://wordbooker.tty.org.uk 
    8 Version: 2.1.10 
     8Version: 2.1.11 
    99*/ 
    1010 
     
    3939define('WORDBOOKER_DEBUG', false); 
    4040define('WORDBOOKER_TESTING', false); 
    41 define('WORDBOOKER_CODE_RELEASE',"2.1.10 - Far Beyond The Sun"); 
     41define('WORDBOOKER_CODE_RELEASE',"2.1.11 - The Trouble with Never"); 
    4242 
    4343# For Troubleshooting  
     
    467467    #wordbooker_set_option('schema_vers', WORDBOOKER_SCHEMA_VERSION ); 
    468468    wp_cache_flush(); 
     469} 
     470 
     471function wordbooker_db_crosscheck() { 
     472    global $wpdb;  
     473    $table_array= array (WORDBOOKER_ERRORLOGS,WORDBOOKER_POSTLOGS,WORDBOOKER_USERDATA,WORDBOOKER_USERSTATUS,WORDBOOKER_POSTCOMMENTS,WORDBOOKER_PROCESS_QUEUE,WORDBOOKER_FB_FRIENDS,WORDBOOKER_FB_FRIEND_LISTS); 
     474 
     475    $wordbooker_columns[WORDBOOKER_ERRORLOGS]=array('timestamp','user_ID','method','error_code','error_msg','post_id','blog_id','sequence_id','diag_level'); 
     476 
     477    $wordbooker_columns[WORDBOOKER_POSTLOGS]=array('post_id','blog_id','timestamp'); 
     478 
     479    $wordbooker_columns[WORDBOOKER_USERDATA]=array('user_ID','uid','expires','access_token','sig','use_facebook','onetime_data','facebook_error','secret','session_key','facebook_id','name','status','updated','url','pic','pages','auths_needed','blog_id'); 
     480 
     481    $wordbooker_columns[WORDBOOKER_USERSTATUS]=array('user_ID','name','status','updated','url','pic','blog_id','facebook_id'); 
     482 
     483    $wordbooker_columns[WORDBOOKER_POSTCOMMENTS]=array('fb_post_id','user_id','comment_timestamp','wp_post_id','blog_id','wp_comment_id','fb_comment_id','in_out'); 
     484 
     485    $wordbooker_columns[WORDBOOKER_PROCESS_QUEUE]=array('entry_type','blog_id','post_id','priority','status'); 
     486 
     487    $wordbooker_columns[WORDBOOKER_FB_FRIENDS]=array('user_id','blog_id','facebook_id','name'); 
     488 
     489    $wordbooker_columns[WORDBOOKER_FB_FRIEND_LISTS]=array('user_id','flid','owner','name'); 
     490 
     491 
     492    $wordbooker_column_def[WORDBOOKER_ERRORLOGS]=array ('timestamp'=>'timestamp','user_ID'=>'bigint(20) unsigned','method'=>'longtext','error_code'=>'int(11)','error_msg'=>'longtext','post_id'=>'bigint(20)','blog_id'=>'bigint(20)','sequence_id'=>'bigint(20)','diag_level'=>'int(4)'); 
     493 
     494    $wordbooker_column_def[WORDBOOKER_POSTLOGS]=array ('post_id'=>'bigint(20)','blog_id'=>'bigint(20)','timestamp'=>'timestamp'); 
     495 
     496    $wordbooker_column_def[WORDBOOKER_USERDATA]=array ('user_ID'=>'bigint(20) unsigned','uid'=>'varchar(80)','expires'=>'varchar(80)','access_token'=>'varchar(255)','sig'=>'varchar(80)','use_facebook'=>'tinyint(1)','onetime_data'=>'longtext','facebook_error'=>'longtext','secret'=>'varchar(80)','session_key'=>'varchar(80)','facebook_id'=>'varchar(40)','name'=>'varchar(250)','status'=>'varchar(2048)','updated'=>'int(20)','url'=>'varchar(250)','pic'=>'varchar(250)','pages'=>'longtext','auths_needed'=>'int(1)','blog_id'=>'bigint(20)'); 
     497 
     498    $wordbooker_column_def[WORDBOOKER_USERSTATUS]=array ('user_ID'=>'bigint(20) unsigned','name'=>'varchar(250)','status'=>'varchar(2048)','updated'=>'int(20)','url'=>'varchar(250)','pic'=>'varchar(250)','blog_id'=>'bigint(20)','facebook_id'=>'varchar(40)'); 
     499 
     500    $wordbooker_column_def[WORDBOOKER_POSTCOMMENTS]=array ('fb_post_id'=>'varchar(40)','user_id'=>'bigint(20)','comment_timestamp'=>'int(20)','wp_post_id'=>'int(11)','blog_id'=>'bigint(20)','wp_comment_id'=>'int(20)','fb_comment_id'=>'varchar(40)','in_out'=>'varchar(20)'); 
     501 
     502    $wordbooker_column_def[WORDBOOKER_PROCESS_QUEUE]=array ('entry_type'=>'varchar(20)','blog_id'=>'int(11)','post_id'=>'int(11)','priority'=>'int(11)','status'=>'varchar(20)'); 
     503 
     504    $wordbooker_column_def[WORDBOOKER_FB_FRIENDS]=array ('user_id'=>'int(11)','blog_id'=>'bigint(20)','facebook_id'=>'varchar(20)','name'=>'varchar(200)'); 
     505 
     506    $wordbooker_column_def[WORDBOOKER_FB_FRIEND_LISTS]=array ('user_id'=>'int(11)','flid'=>'varchar(80)','owner'=>'varchar(80)','name'=>'varchar(240)'); 
     507    foreach ($table_array as $table) { 
     508        $working_table=$wordbooker_columns[$table]; 
     509        $working_table_def=$wordbooker_column_def[$table]; 
     510        foreach ($working_table as $chardata){ 
     511            $sql="SELECT column_name,column_type FROM information_schema.COLUMNS WHERE table_name='".$table."' and table_schema='".DB_NAME."' and column_name='".$chardata."'"; 
     512            $rows =  $wpdb->get_row($sql,ARRAY_N); 
     513        if ($chardata==$rows[0]) { 
     514            $col_status=" present";$correct_sql='zed';       
     515            if ($working_table_def[$chardata]==$rows[1]) {$col_def_status=" matches";$correct_def_sql='zed';}  
     516            else {$col_def_status=" mismatches"; $correct_def_sql="alter table ".$table." change ".$chardata." ".$chardata." ".$working_table_def[$chardata];} 
     517        } else { 
     518            $col_status=" missing"; $correct_sql="alter table ".$table." add ".$chardata." ".$working_table_def[$chardata]; 
     519        } 
     520        if ($correct_sql!='zed') {$sql_run[]=$correct_sql;} 
     521        if ($correct_def_sql!='zed') {$sql_run[]=$correct_def_sql;} 
     522    } 
     523} 
     524    if (is_array($sql_run)) { 
     525        echo "Schema differences found - fixing up <br />"; 
     526        foreach($sql_run as $sql_fix) { 
     527            #echo "Executing : ".$sql_fix."<br />"; 
     528            $result=@mysql_query($sql_fix); 
     529        } 
     530        echo "<br />"; 
     531    } 
    469532} 
    470533 
     
    875938    global $user_ID, $wp_version,$blog_id; 
    876939    wordbooker_upgrade(); 
     940    wordbooker_db_crosscheck(); 
    877941    wordbooker_trim_postlogs(); 
    878942    wordbooker_trim_errorlogs(); 
     
    929993            wordbooker_debugger("Access token already updated today"," ",-1,99) ;  
    930994            } else { 
     995            wordbooker_debugger("Access token was ",unserialize($user_row->access_token),-1,99) ; 
    931996            try { 
    932997                $ret_code=wordbooker_get_access_token(unserialize($user_row->access_token)); 
     
    9371002                wordbooker_debugger("Access token refresh failed   ".$error_msg,$error_code,-1,99) ; 
    9381003            }    
    939         #   var_dump($user_ID); 
     1004        #   wordbooker_debugger("Return code is ",$ret_code,-1,99) ; 
    9401005            $x=split('&',$ret_code); 
    9411006            $x=split('=',$x[0]); 
    9421007            $access_token=$x[1]; 
     1008            if (strlen($access_token) < 15) {$access_token=unserialize($user_row->access_token);} 
    9431009            if (strlen($access_token) > 15) { 
    9441010                $sql= "Update " . WORDBOOKER_USERDATA . " set access_token = '" . serialize($access_token) . "', updated=".$today." where user_id=".$userid; 
    9451011                $result = $wpdb->query($sql); 
    946                 wordbooker_debugger("Access token was ",unserialize($user_row->access_token),-1,99) ; 
     1012            #   wordbooker_debugger("Access token was ",unserialize($user_row->access_token),-1,99) ; 
    9471013                wordbooker_debugger("Access token is now ",$access_token,-1,99) ; 
    9481014                wordbooker_debugger("Access token updated"," ",-1,99) ; 
    9491015            } 
     1016            else {wordbooker_debugger("Access token wasn't updated as it was too short",print_r($ret_code,true),-1,99) ; } 
    9501017        } 
    9511018    } 
     
    12241291    echo "</b>"; 
    12251292 
    1226 $wordbooker_columns[WORDBOOKER_ERRORLOGS]=array('timestamp','user_ID','method','error_code','error_msg','post_id','blog_id','sequence_id','diag_level'); 
    1227  
    1228 $wordbooker_columns[WORDBOOKER_POSTLOGS]=array('post_id','blog_id','timestamp'); 
    1229  
    1230 $wordbooker_columns[WORDBOOKER_USERDATA]=array('user_ID','uid','expires','access_token','sig','use_facebook','onetime_data','facebook_error','secret','session_key','facebook_id','name','status','updated','url','pic','pages','auths_needed','blog_id'); 
    1231  
    1232 $wordbooker_columns[WORDBOOKER_USERSTATUS]=array('user_ID','name','status','updated','url','pic','blog_id','facebook_id'); 
    1233  
    1234 $wordbooker_columns[WORDBOOKER_POSTCOMMENTS]=array('fb_post_id','user_id','comment_timestamp','wp_post_id','blog_id','wp_comment_id','fb_comment_id','in_out'); 
    1235  
    1236 $wordbooker_columns[WORDBOOKER_PROCESS_QUEUE]=array('entry_type','blog_id','post_id','priority','status'); 
    1237  
    1238 $wordbooker_columns[WORDBOOKER_FB_FRIENDS]=array('user_id','blog_id','facebook_id','name'); 
    1239  
    1240 $wordbooker_columns[WORDBOOKER_FB_FRIEND_LISTS]=array('user_id','flid','owner','name'); 
    1241  
    1242  
    1243 $wordbooker_column_def[WORDBOOKER_ERRORLOGS]=array ('timestamp'=>'timestamp','user_ID'=>'bigint(20) unsigned','method'=>'longtext','error_code'=>'int(11)','error_msg'=>'longtext','post_id'=>'bigint(20)','blog_id'=>'bigint(20)','sequence_id'=>'bigint(20)','diag_level'=>'int(4)'); 
    1244  
    1245 $wordbooker_column_def[WORDBOOKER_POSTLOGS]=array ('post_id'=>'bigint(20)','blog_id'=>'bigint(20)','timestamp'=>'timestamp'); 
    1246  
    1247 $wordbooker_column_def[WORDBOOKER_USERDATA]=array ('user_ID'=>'bigint(20) unsigned','uid'=>'varchar(80)','expires'=>'varchar(80)','access_token'=>'varchar(255)','sig'=>'varchar(80)','use_facebook'=>'tinyint(1)','onetime_data'=>'longtext','facebook_error'=>'longtext','secret'=>'varchar(80)','session_key'=>'varchar(80)','facebook_id'=>'varchar(40)','name'=>'varchar(250)','status'=>'varchar(2048)','updated'=>'int(20)','url'=>'varchar(250)','pic'=>'varchar(250)','pages'=>'longtext','auths_needed'=>'int(1)','blog_id'=>'bigint(20)'); 
    1248  
    1249 $wordbooker_column_def[WORDBOOKER_USERSTATUS]=array ('user_ID'=>'bigint(20) unsigned','name'=>'varchar(250)','status'=>'varchar(2048)','updated'=>'int(20)','url'=>'varchar(250)','pic'=>'varchar(250)','blog_id'=>'bigint(20)','facebook_id'=>'varchar(40)'); 
    1250  
    1251 $wordbooker_column_def[WORDBOOKER_POSTCOMMENTS]=array ('fb_post_id'=>'varchar(40)','user_id'=>'bigint(20)','comment_timestamp'=>'int(20)','wp_post_id'=>'int(11)','blog_id'=>'bigint(20)','wp_comment_id'=>'int(20)','fb_comment_id'=>'varchar(40)','in_out'=>'varchar(20)'); 
    1252  
    1253 $wordbooker_column_def[WORDBOOKER_PROCESS_QUEUE]=array ('entry_type'=>'varchar(20)','blog_id'=>'int(11)','post_id'=>'int(11)','priority'=>'int(11)','status'=>'varchar(20)'); 
    1254  
    1255 $wordbooker_column_def[WORDBOOKER_FB_FRIENDS]=array ('user_id'=>'int(11)','blog_id'=>'bigint(20)','facebook_id'=>'varchar(20)','name'=>'varchar(200)'); 
    1256  
    1257 $wordbooker_column_def[WORDBOOKER_FB_FRIEND_LISTS]=array ('user_id'=>'int(11)','flid'=>'varchar(80)','owner'=>'varchar(80)','name'=>'varchar(240)'); 
    1258     foreach ($table_array as $table) { 
    1259         $working_table=$wordbooker_columns[$table]; 
    1260         $working_table_def=$wordbooker_column_def[$table]; 
    1261         foreach ($working_table as $chardata){ 
    1262             $sql="SELECT column_name,column_type FROM information_schema.COLUMNS WHERE table_name='".$table."' and table_schema='".DB_NAME."' and column_name='".$chardata."'"; 
    1263     $rows =  $wpdb->get_row($sql,ARRAY_N); 
    1264     #var_dump($rows); 
    1265         if ($chardata==$rows[0]) { 
    1266             $col_status=" present";$correct_sql='zed';       
    1267             if ($working_table_def[$chardata]==$rows[1]) {$col_def_status=" matches";$correct_def_sql='zed';}  
    1268             else {$col_def_status=" mismatches"; $correct_def_sql="alter table ".$table." change ".$chardata." ".$chardata." ".$working_table_def[$chardata];} 
    1269         } else { 
    1270             $col_status=" missing"; $correct_sql="alter table ".$table." add ".$chardata." ".$working_table_def[$chardata]; 
    1271         } 
    1272     #   echo "<li>". $chardata ." is ".$col_status." - ".$correct_sql."</li>"; 
    1273     #   echo "<li>". $chardata ." type ".$col_def_status." - ".$correct_def_sql."</li>"; 
    1274     #       echo "'".$chardata->column_name."',"; 
    1275         #echo "'".$chardata->column_name."'=>'".$chardata->column_type."',"; 
    1276         if ($correct_sql!='zed') {$sql_run[]=$correct_sql;} 
    1277         if ($correct_def_sql!='zed') {$sql_run[]=$correct_def_sql;} 
    1278     } 
    1279 } 
    1280     #var_dump($sql_run); 
    1281     if (is_array($sql_run)) { 
    1282         echo "Schema differences found - fixing up <br />"; 
    1283         foreach($sql_run as $sql_fix) { 
    1284             echo "Executing : ".$sql_fix."<br />"; 
    1285             $result=@mysql_query($sql_fix); 
    1286         } 
    1287         echo "<br />"; 
    1288     } 
    12891293    if (ADVANCED_DEBUG) { phpinfo(INFO_MODULES);} 
    12901294?> 
     
    13221326function wordbooker_return_images($post_content,$flag) { 
    13231327    global $wordbooker_post_options,$wpdb,$post; 
     1328    if(is_null($post->ID)) {return;} 
    13241329    $wordbooker_settings =wordbooker_options();  
    13251330    # Grab the content of the post once its been filtered for display - this converts app tags into HTML so we can grab gallery images etc. 
     
    13311336    ); 
    13321337    $postcontent2=""; 
     1338    #var_dump($post->ID); 
    13331339    $attachments = get_posts( $args ); 
     1340    #var_dump($attachments); 
    13341341    if ( $attachments ) { 
    13351342        foreach ( $attachments as $attachment ) { 
    1336             if ($flag==1) {wordbooker_debugger("Adding image",wp_get_attachment_url($attachment->ID),$post->ID,80) ;} 
    1337             $post_content2 .= ' <img src="' . wp_get_attachment_url($attachment->ID) . '"> '; 
     1343            if ($attachment->post_type=='attachment') {wordbooker_debugger("Adding image",wp_get_attachment_url($attachment->ID),$post->ID,80) ; 
     1344            $post_content2 .= ' <img src="' . wp_get_attachment_url($attachment->ID) . '"> ';} 
    13381345        } 
    13391346    } 
     
    15551562        // Share This 
    15561563        wordbooker_debugger("Share Link being used"," ",$post_id,80) ; 
    1557         $action_links = array('name' => __('Share', 'wordbooker'),'link' => 'http://www.facebook.com/share.php?u='.urlencode($post_data['post_link_share'])); 
     1564        $action_links = array('name' => __('Share', 'wordbooker'),'link' => 'https://www.facebook.com/share.php?u='.urlencode($post_data['post_link_share'])); 
    15581565        $wordbooker_fb_post['actions']=json_encode($action_links); 
    15591566    } 
     
    19381945    if (isset($wordbooker_settings['wordbooker_time_button'])) { 
    19391946        if (isset($wordbooker_settings['wordbooker_iframe'])) { 
    1940              $share_code='<!-- Wordbooker created FB tags --> <iframe src="http://www.facebook.com/plugins/add_to_timeline.php?show-faces=true&amp;mode=button&amp;appId=277399175632726" style="border:none; overflow:hidden;"></iframe>'; 
     1947             $share_code='<!-- Wordbooker created FB tags --> <iframe src="https://www.facebook.com/plugins/add_to_timeline.php?show-faces=true&amp;mode=button&amp;appId=277399175632726" style="border:none; overflow:hidden;"></iframe>'; 
    19411948        } 
    19421949        else { 
     
    19821989    if (isset($wordbooker_settings['wordbooker_time_button'])) { 
    19831990        if (isset($wordbooker_settings['wordbooker_iframe'])) { 
    1984              $share_code='<!-- Wordbooker created FB tags --> <iframe src="http://www.facebook.com/plugins/add_to_timeline.php?show-faces=true&amp;mode=button&amp;appId=277399175632726" frameborder="0" style="border:none; overflow:hidden;" ></iframe>'; 
     1991             $share_code='<!-- Wordbooker created FB tags --> <iframe src="https://www.facebook.com/plugins/add_to_timeline.php?show-faces=true&amp;mode=button&amp;appId=277399175632726" frameborder="0" style="border:none; overflow:hidden;" ></iframe>'; 
    19851992        } 
    19861993        else { 
     
    20192026            $wplang=wordbooker_get_language(); 
    20202027            if ($wordbooker_settings['wordbooker_fblike_faces']=='true') {$px=80;} 
    2021             $like_code='<!-- Wordbooker created FB tags --> <iframe src="http://www.facebook.com/plugins/send.php?locale='.$wplang.'&amp;href='.$post_link.'&amp;layout='.$wordbooker_settings['wordbooker_fblike_button'].'&amp;show_faces='.$wordbooker_settings['wordbooker_fblike_faces'].'&amp;width='.$wordbooker_settings["wordbooker_like_width"].'&amp;action='.$wordbooker_settings['wordbooker_fblike_action'].'&amp;colorscheme='.$wordbooker_settings['wordbooker_fblike_colorscheme'].'&amp;font='.$wordbooker_settings['wordbooker_fblike_font'].'&amp;height='.$px.'px" style="border:none; overflow:hidden; width:'.$wordbooker_settings["wordbooker_like_width"].'px; height:'.$px.'px;" ></iframe>'; 
     2028            $like_code='<!-- Wordbooker created FB tags --> <iframe src="https://www.facebook.com/plugins/send.php?locale='.$wplang.'&amp;href='.$post_link.'&amp;layout='.$wordbooker_settings['wordbooker_fblike_button'].'&amp;show_faces='.$wordbooker_settings['wordbooker_fblike_faces'].'&amp;width='.$wordbooker_settings["wordbooker_like_width"].'&amp;action='.$wordbooker_settings['wordbooker_fblike_action'].'&amp;colorscheme='.$wordbooker_settings['wordbooker_fblike_colorscheme'].'&amp;font='.$wordbooker_settings['wordbooker_fblike_font'].'&amp;height='.$px.'px" style="border:none; overflow:hidden; width:'.$wordbooker_settings["wordbooker_like_width"].'px; height:'.$px.'px;" ></iframe>'; 
    20222029 
    20232030        } 
     
    20542061            $wplang=wordbooker_get_language(); 
    20552062            if ($wordbooker_settings['wordbooker_fblike_faces']=='true') {$px=80;} 
    2056             $like_code='<!-- Wordbooker created FB tags --> <iframe src="http://www.facebook.com/plugins/send.php?locale='.$wplang.'&amp;href='.$post_link.'&amp;layout='.$wordbooker_settings['wordbooker_fblike_button'].'&amp;show_faces='.$wordbooker_settings['wordbooker_fblike_faces'].'&amp;width='.$wordbooker_settings["wordbooker_like_width"].'&amp;action='.$wordbooker_settings['wordbooker_fblike_action'].'&amp;colorscheme='.$wordbooker_settings['wordbooker_fblike_colorscheme'].'&amp;font='.$wordbooker_settings['wordbooker_fblike_font'].'&amp;height='.$px.'px" style="border:none; overflow:hidden; width:'.$wordbooker_settings["wordbooker_like_width"].'px; height:'.$px.'px;" ></iframe>'; 
     2063            $like_code='<!-- Wordbooker created FB tags --> <iframe src="https://www.facebook.com/plugins/send.php?locale='.$wplang.'&amp;href='.$post_link.'&amp;layout='.$wordbooker_settings['wordbooker_fblike_button'].'&amp;show_faces='.$wordbooker_settings['wordbooker_fblike_faces'].'&amp;width='.$wordbooker_settings["wordbooker_like_width"].'&amp;action='.$wordbooker_settings['wordbooker_fblike_action'].'&amp;colorscheme='.$wordbooker_settings['wordbooker_fblike_colorscheme'].'&amp;font='.$wordbooker_settings['wordbooker_fblike_font'].'&amp;height='.$px.'px" style="border:none; overflow:hidden; width:'.$wordbooker_settings["wordbooker_like_width"].'px; height:'.$px.'px;" ></iframe>'; 
    20572064 
    20582065        } 
     
    20892096            $wplang=wordbooker_get_language(); 
    20902097            if ($wordbooker_settings['wordbooker_fblike_faces']=='true') {$px=95;} 
    2091             $like_code='<!-- Wordbooker created FB tags --> <iframe src="http://www.facebook.com/plugins/like.php?locale='.$wplang.'&amp;href='.$post_link.'&amp;layout='.$wordbooker_settings['wordbooker_fblike_button'].'&amp;show_faces='.$wordbooker_settings['wordbooker_fblike_faces'].'&amp;width='.$wordbooker_settings["wordbooker_like_width"].'&amp;action='.$wordbooker_settings['wordbooker_fblike_action'].'&amp;colorscheme='.$wordbooker_settings['wordbooker_fblike_colorscheme'].'&amp;font='.$wordbooker_settings['wordbooker_fblike_font'].'&amp;height='.$px.'px" style="border:none; overflow:hidden; width:'.$wordbooker_settings["wordbooker_like_width"].'px; height:'.$px.'px;" ></iframe>'; 
     2098            $like_code='<!-- Wordbooker created FB tags --> <iframe src="https://www.facebook.com/plugins/like.php?locale='.$wplang.'&amp;href='.$post_link.'&amp;layout='.$wordbooker_settings['wordbooker_fblike_button'].'&amp;show_faces='.$wordbooker_settings['wordbooker_fblike_faces'].'&amp;width='.$wordbooker_settings["wordbooker_like_width"].'&amp;action='.$wordbooker_settings['wordbooker_fblike_action'].'&amp;colorscheme='.$wordbooker_settings['wordbooker_fblike_colorscheme'].'&amp;font='.$wordbooker_settings['wordbooker_fblike_font'].'&amp;height='.$px.'px" style="border:none; overflow:hidden; width:'.$wordbooker_settings["wordbooker_like_width"].'px; height:'.$px.'px;" ></iframe>'; 
    20922099 
    20932100        } 
     
    21302137            if ($wplang=="WPLANG" ) {$wplang="en_US";} 
    21312138            if ($wordbooker_settings['wordbooker_fblike_faces']=='true') {$px=95;} 
    2132             $like_code='<!-- Wordbooker created FB tags --> <iframe src="http://www.facebook.com/plugins/like.php?locale='.$wplang.'&amp;href='.$post_link.'&amp;layout='.$wordbooker_settings['wordbooker_fblike_button'].'&amp;show_faces='.$wordbooker_settings['wordbooker_fblike_faces'].'&amp;width='.$wordbooker_settings["wordbooker_like_width"].'&amp;action='.$wordbooker_settings['wordbooker_fblike_action'].'&amp;colorscheme='.$wordbooker_settings['wordbooker_fblike_colorscheme'].'&amp;font='.$wordbooker_settings['wordbooker_fblike_font'].'&amp;height='.$px.'px" style="border:none; overflow:hidden; width:'.$wordbooker_settings["wordbooker_like_width"].'px; height:'.$px.'px;" ></iframe>'; 
     2139            $like_code='<!-- Wordbooker created FB tags --> <iframe src="https://www.facebook.com/plugins/like.php?locale='.$wplang.'&amp;href='.$post_link.'&amp;layout='.$wordbooker_settings['wordbooker_fblike_button'].'&amp;show_faces='.$wordbooker_settings['wordbooker_fblike_faces'].'&amp;width='.$wordbooker_settings["wordbooker_like_width"].'&amp;action='.$wordbooker_settings['wordbooker_fblike_action'].'&amp;colorscheme='.$wordbooker_settings['wordbooker_fblike_colorscheme'].'&amp;font='.$wordbooker_settings['wordbooker_fblike_font'].'&amp;height='.$px.'px" style="border:none; overflow:hidden; width:'.$wordbooker_settings["wordbooker_like_width"].'px; height:'.$px.'px;" ></iframe>'; 
    21332140 
    21342141        } 
     
    22722279        $midamble=trim(preg_replace("/(.*?)((,|\s)*)$/m", "$1", $midamble)); 
    22732280        $midamble=substr_replace($midamble, " and ", strrpos($midamble, ","), strlen(","));  
    2274         echo " ".$preamble.$midamble.$postamble.'</p><div style="text-align: center;"><a href="'.$loginUrl2.'" > <img src="http://static.ak.facebook.com/images/devsite/facebook_login.gif"  alt="Facebook Login Button" /></a><br /></div>';        
     2281        echo " ".$preamble.$midamble.$postamble.'</p><div style="text-align: center;"><a href="'.$loginUrl2.'" > <img src="https://static.ak.facebook.com/images/devsite/facebook_login.gif"  alt="Facebook Login Button" /></a><br /></div>';       
    22752282    } 
    22762283    echo "and then save your settings<br />"; 
  • wordbooker/trunk/includes/wordbooker_comments.php

    r539162 r540440  
    118118    $wordbooker_settings=get_option('wordbooker_settings');  
    119119    $comment_approve=0; 
    120     if (isset($wordbooker_settings['wordbook_comment_approve'])) {$comment_approve=1;} 
     120    if (isset($wordbooker_settings['wordbooker_comment_approve'])) {$comment_approve=1;} 
    121121    $sql='Select distinct fb_post_id from '.WORDBOOKER_POSTCOMMENTS.' where fb_comment_id is null and user_id='.$user_id.' and blog_id='.$blog_id. " and in_out is null "; 
    122122    $rows = $wpdb->get_results($sql); 
  • wordbooker/trunk/includes/wordbooker_facebook_curl.php

    r539162 r540440  
    6868 
    6969function wordbooker_get_access_token($access_token) { 
    70     $url='https://graph.facebook.com/oauth/access_token?client_id='.WORDBOOKER_FB_ID.'&client_secret='.WORDBOOKER_FB_SECRET.'&grant_type=fb_exchange_token&fb_exchange_token='.$access_token.'&format=JSON-STRINGS'; 
     70    $url='https://graph.facebook.com/oauth/access_token?client_id='.WORDBOOKER_FB_ID.'&client_secret='.WORDBOOKER_FB_SECRET.'&grant_type=fb_exchange_token&fb_exchange_token='.$access_token; 
     71    #var_dump($url); 
    7172    $x=wordbooker_make_curl_call($url); 
     73    #var_dump($x); 
    7274    return($x); 
    7375} 
  • wordbooker/trunk/includes/wordbooker_fb_widget.php

    r539162 r540440  
    7878        echo "<!-- Wordbooker FB like box widget -->"; 
    7979        if ( (!isset($wordbooker_settings['wordbooker_like_button_show']) && !isset($wordbooker_settings['wordbooker_like_share_too'])) || isset($wordbooker_settings['wordbooker_iframe'])) { 
    80     echo'<iframe src="http://www.facebook.com/plugins/likebox.php?href='.urlencode(strtolower($url)).'&amp;width='.$width.'&amp;colorscheme='.$scheme.'&amp;show_faces='.$faces.'&amp;border_color=%23'.$border_colour.'&amp;stream='.$stream.'&amp;header='.$header.'&amp;height='.$height.'" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:'.$width.'px; height:'.$height.'px;" allowTransparency="true"></iframe>'; 
     80    echo'<iframe src="https://www.facebook.com/plugins/likebox.php?href='.urlencode(strtolower($url)).'&amp;width='.$width.'&amp;colorscheme='.$scheme.'&amp;show_faces='.$faces.'&amp;border_color=%23'.$border_colour.'&amp;stream='.$stream.'&amp;header='.$header.'&amp;height='.$height.'" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:'.$width.'px; height:'.$height.'px;" allowTransparency="true"></iframe>'; 
    8181        } 
    8282        else { 
     
    114114        $result = wordbooker_get_cache($user_ID,'pages',1); 
    115115        $fanpages=unserialize($result->pages); 
    116         $xx=array('id'=>'FW:254577506873','name'=>'Wordbooker','url'=>'http://www.facebook.com/wordbooker'); 
     116        $xx=array('id'=>'FW:254577506873','name'=>'Wordbooker','url'=>'https://www.facebook.com/wordbooker'); 
    117117        $fanpages[]=$xx; 
    118118        $default = array( 'title' => __('Fan Page','wordbooker'), 'snorl'=>$user_ID, 'dname'=>'', 'pid'=>'254577506873', 'stream'=>'false', 'connections'=>6, 'width'=>188, 'height'=>260, 'header'=>'false', 'scheme'=>'light' ); 
  • wordbooker/trunk/readme.txt

    r539774 r540440  
    55Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=8XNJMQCYDJT6U&lc=GB&currency_code=GBP&bn=PP%2dDonationsBF%3abtn_donateCC_LG%2egif%3aNonHosted 
    66Requires at least: 2.9 
    7 Tested up to: 3.3.1 
    8 Stable tag: 2.1.10 
     7Tested up to: 3.3.2 
     8Stable tag: 2.1.11 
    99 
    1010This 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.  
     
    117117 
    118118== Changelog == 
     119 
     120= Version 2.1.11 06/05/2012 = 
     121- Added some more diagnostics to the token exchange code to try to work out what is going on when its too short 
     122- Put in a patch so that if the token update fails it uses the existing token - this is a dirty fix but gives me time to work on a proper fix. 
     123- Put some null post_ID checking in to get round Wordpress returning ALL assets in a blog when you pass a null ID to it which blew up blogs when you went to add a post. 
     124- Changed some HTTP references to HTTPS to hopefully stop warnings when running blogs on HTTPS front ends. 
     125- Fixed a typo in the auto approve comment variable check. Thanks to Stefan Jacobi 
     126- Tidied up the schema cross check code and moved it into its own function. Part of longer term plan to strip a lot of the "non core" code out of the main wordbooker file. 
     127 
    119128 
    120129= Version 2.1.10 04/05/2012 = 
  • wordbooker/trunk/wordbooker.php

    r539774 r540440  
    66Author: Steve Atty  
    77Author URI: http://wordbooker.tty.org.uk 
    8 Version: 2.1.10 
     8Version: 2.1.11 
    99*/ 
    1010 
     
    3939define('WORDBOOKER_DEBUG', false); 
    4040define('WORDBOOKER_TESTING', false); 
    41 define('WORDBOOKER_CODE_RELEASE',"2.1.10 - Far Beyond The Sun"); 
     41define('WORDBOOKER_CODE_RELEASE',"2.1.11 - The Trouble with Never"); 
    4242 
    4343# For Troubleshooting  
     
    467467    #wordbooker_set_option('schema_vers', WORDBOOKER_SCHEMA_VERSION ); 
    468468    wp_cache_flush(); 
     469} 
     470 
     471function wordbooker_db_crosscheck() { 
     472    global $wpdb;  
     473    $table_array= array (WORDBOOKER_ERRORLOGS,WORDBOOKER_POSTLOGS,WORDBOOKER_USERDATA,WORDBOOKER_USERSTATUS,WORDBOOKER_POSTCOMMENTS,WORDBOOKER_PROCESS_QUEUE,WORDBOOKER_FB_FRIENDS,WORDBOOKER_FB_FRIEND_LISTS); 
     474 
     475    $wordbooker_columns[WORDBOOKER_ERRORLOGS]=array('timestamp','user_ID','method','error_code','error_msg','post_id','blog_id','sequence_id','diag_level'); 
     476 
     477    $wordbooker_columns[WORDBOOKER_POSTLOGS]=array('post_id','blog_id','timestamp'); 
     478 
     479    $wordbooker_columns[WORDBOOKER_USERDATA]=array('user_ID','uid','expires','access_token','sig','use_facebook','onetime_data','facebook_error','secret','session_key','facebook_id','name','status','updated','url','pic','pages','auths_needed','blog_id'); 
     480 
     481    $wordbooker_columns[WORDBOOKER_USERSTATUS]=array('user_ID','name','status','updated','url','pic','blog_id','facebook_id'); 
     482 
     483    $wordbooker_columns[WORDBOOKER_POSTCOMMENTS]=array('fb_post_id','user_id','comment_timestamp','wp_post_id','blog_id','wp_comment_id','fb_comment_id','in_out'); 
     484 
     485    $wordbooker_columns[WORDBOOKER_PROCESS_QUEUE]=array('entry_type','blog_id','post_id','priority','status'); 
     486 
     487    $wordbooker_columns[WORDBOOKER_FB_FRIENDS]=array('user_id','blog_id','facebook_id','name'); 
     488 
     489    $wordbooker_columns[WORDBOOKER_FB_FRIEND_LISTS]=array('user_id','flid','owner','name'); 
     490 
     491 
     492    $wordbooker_column_def[WORDBOOKER_ERRORLOGS]=array ('timestamp'=>'timestamp','user_ID'=>'bigint(20) unsigned','method'=>'longtext','error_code'=>'int(11)','error_msg'=>'longtext','post_id'=>'bigint(20)','blog_id'=>'bigint(20)','sequence_id'=>'bigint(20)','diag_level'=>'int(4)'); 
     493 
     494    $wordbooker_column_def[WORDBOOKER_POSTLOGS]=array ('post_id'=>'bigint(20)','blog_id'=>'bigint(20)','timestamp'=>'timestamp'); 
     495 
     496    $wordbooker_column_def[WORDBOOKER_USERDATA]=array ('user_ID'=>'bigint(20) unsigned','uid'=>'varchar(80)','expires'=>'varchar(80)','access_token'=>'varchar(255)','sig'=>'varchar(80)','use_facebook'=>'tinyint(1)','onetime_data'=>'longtext','facebook_error'=>'longtext','secret'=>'varchar(80)','session_key'=>'varchar(80)','facebook_id'=>'varchar(40)','name'=>'varchar(250)','status'=>'varchar(2048)','updated'=>'int(20)','url'=>'varchar(250)','pic'=>'varchar(250)','pages'=>'longtext','auths_needed'=>'int(1)','blog_id'=>'bigint(20)'); 
     497 
     498    $wordbooker_column_def[WORDBOOKER_USERSTATUS]=array ('user_ID'=>'bigint(20) unsigned','name'=>'varchar(250)','status'=>'varchar(2048)','updated'=>'int(20)','url'=>'varchar(250)','pic'=>'varchar(250)','blog_id'=>'bigint(20)','facebook_id'=>'varchar(40)'); 
     499 
     500    $wordbooker_column_def[WORDBOOKER_POSTCOMMENTS]=array ('fb_post_id'=>'varchar(40)','user_id'=>'bigint(20)','comment_timestamp'=>'int(20)','wp_post_id'=>'int(11)','blog_id'=>'bigint(20)','wp_comment_id'=>'int(20)','fb_comment_id'=>'varchar(40)','in_out'=>'varchar(20)'); 
     501 
     502    $wordbooker_column_def[WORDBOOKER_PROCESS_QUEUE]=array ('entry_type'=>'varchar(20)','blog_id'=>'int(11)','post_id'=>'int(11)','priority'=>'int(11)','status'=>'varchar(20)'); 
     503 
     504    $wordbooker_column_def[WORDBOOKER_FB_FRIENDS]=array ('user_id'=>'int(11)','blog_id'=>'bigint(20)','facebook_id'=>'varchar(20)','name'=>'varchar(200)'); 
     505 
     506    $wordbooker_column_def[WORDBOOKER_FB_FRIEND_LISTS]=array ('user_id'=>'int(11)','flid'=>'varchar(80)','owner'=>'varchar(80)','name'=>'varchar(240)'); 
     507    foreach ($table_array as $table) { 
     508        $working_table=$wordbooker_columns[$table]; 
     509        $working_table_def=$wordbooker_column_def[$table]; 
     510        foreach ($working_table as $chardata){ 
     511            $sql="SELECT column_name,column_type FROM information_schema.COLUMNS WHERE table_name='".$table."' and table_schema='".DB_NAME."' and column_name='".$chardata."'"; 
     512            $rows =  $wpdb->get_row($sql,ARRAY_N); 
     513        if ($chardata==$rows[0]) { 
     514            $col_status=" present";$correct_sql='zed';       
     515            if ($working_table_def[$chardata]==$rows[1]) {$col_def_status=" matches";$correct_def_sql='zed';}  
     516            else {$col_def_status=" mismatches"; $correct_def_sql="alter table ".$table." change ".$chardata." ".$chardata." ".$working_table_def[$chardata];} 
     517        } else { 
     518            $col_status=" missing"; $correct_sql="alter table ".$table." add ".$chardata." ".$working_table_def[$chardata]; 
     519        } 
     520        if ($correct_sql!='zed') {$sql_run[]=$correct_sql;} 
     521        if ($correct_def_sql!='zed') {$sql_run[]=$correct_def_sql;} 
     522    } 
     523} 
     524    if (is_array($sql_run)) { 
     525        echo "Schema differences found - fixing up <br />"; 
     526        foreach($sql_run as $sql_fix) { 
     527            #echo "Executing : ".$sql_fix."<br />"; 
     528            $result=@mysql_query($sql_fix); 
     529        } 
     530        echo "<br />"; 
     531    } 
    469532} 
    470533 
     
    875938    global $user_ID, $wp_version,$blog_id; 
    876939    wordbooker_upgrade(); 
     940    wordbooker_db_crosscheck(); 
    877941    wordbooker_trim_postlogs(); 
    878942    wordbooker_trim_errorlogs(); 
     
    929993            wordbooker_debugger("Access token already updated today"," ",-1,99) ;  
    930994            } else { 
     995            wordbooker_debugger("Access token was ",unserialize($user_row->access_token),-1,99) ; 
    931996            try { 
    932997                $ret_code=wordbooker_get_access_token(unserialize($user_row->access_token)); 
     
    9371002                wordbooker_debugger("Access token refresh failed   ".$error_msg,$error_code,-1,99) ; 
    9381003            }    
    939         #   var_dump($user_ID); 
     1004        #   wordbooker_debugger("Return code is ",$ret_code,-1,99) ; 
    9401005            $x=split('&',$ret_code); 
    9411006            $x=split('=',$x[0]); 
    9421007            $access_token=$x[1]; 
     1008            if (strlen($access_token) < 15) {$access_token=unserialize($user_row->access_token);} 
    9431009            if (strlen($access_token) > 15) { 
    9441010                $sql= "Update " . WORDBOOKER_USERDATA . " set access_token = '" . serialize($access_token) . "', updated=".$today." where user_id=".$userid; 
    9451011                $result = $wpdb->query($sql); 
    946                 wordbooker_debugger("Access token was ",unserialize($user_row->access_token),-1,99) ; 
     1012            #   wordbooker_debugger("Access token was ",unserialize($user_row->access_token),-1,99) ; 
    9471013                wordbooker_debugger("Access token is now ",$access_token,-1,99) ; 
    9481014                wordbooker_debugger("Access token updated"," ",-1,99) ; 
    9491015            } 
     1016            else {wordbooker_debugger("Access token wasn't updated as it was too short",print_r($ret_code,true),-1,99) ; } 
    9501017        } 
    9511018    } 
     
    12241291    echo "</b>"; 
    12251292 
    1226 $wordbooker_columns[WORDBOOKER_ERRORLOGS]=array('timestamp','user_ID','method','error_code','error_msg','post_id','blog_id','sequence_id','diag_level'); 
    1227  
    1228 $wordbooker_columns[WORDBOOKER_POSTLOGS]=array('post_id','blog_id','timestamp'); 
    1229  
    1230 $wordbooker_columns[WORDBOOKER_USERDATA]=array('user_ID','uid','expires','access_token','sig','use_facebook','onetime_data','facebook_error','secret','session_key','facebook_id','name','status','updated','url','pic','pages','auths_needed','blog_id'); 
    1231  
    1232 $wordbooker_columns[WORDBOOKER_USERSTATUS]=array('user_ID','name','status','updated','url','pic','blog_id','facebook_id'); 
    1233  
    1234 $wordbooker_columns[WORDBOOKER_POSTCOMMENTS]=array('fb_post_id','user_id','comment_timestamp','wp_post_id','blog_id','wp_comment_id','fb_comment_id','in_out'); 
    1235  
    1236 $wordbooker_columns[WORDBOOKER_PROCESS_QUEUE]=array('entry_type','blog_id','post_id','priority','status'); 
    1237  
    1238 $wordbooker_columns[WORDBOOKER_FB_FRIENDS]=array('user_id','blog_id','facebook_id','name'); 
    1239  
    1240 $wordbooker_columns[WORDBOOKER_FB_FRIEND_LISTS]=array('user_id','flid','owner','name'); 
    1241  
    1242  
    1243 $wordbooker_column_def[WORDBOOKER_ERRORLOGS]=array ('timestamp'=>'timestamp','user_ID'=>'bigint(20) unsigned','method'=>'longtext','error_code'=>'int(11)','error_msg'=>'longtext','post_id'=>'bigint(20)','blog_id'=>'bigint(20)','sequence_id'=>'bigint(20)','diag_level'=>'int(4)'); 
    1244  
    1245 $wordbooker_column_def[WORDBOOKER_POSTLOGS]=array ('post_id'=>'bigint(20)','blog_id'=>'bigint(20)','timestamp'=>'timestamp'); 
    1246  
    1247 $wordbooker_column_def[WORDBOOKER_USERDATA]=array ('user_ID'=>'bigint(20) unsigned','uid'=>'varchar(80)','expires'=>'varchar(80)','access_token'=>'varchar(255)','sig'=>'varchar(80)','use_facebook'=>'tinyint(1)','onetime_data'=>'longtext','facebook_error'=>'longtext','secret'=>'varchar(80)','session_key'=>'varchar(80)','facebook_id'=>'varchar(40)','name'=>'varchar(250)','status'=>'varchar(2048)','updated'=>'int(20)','url'=>'varchar(250)','pic'=>'varchar(250)','pages'=>'longtext','auths_needed'=>'int(1)','blog_id'=>'bigint(20)'); 
    1248  
    1249 $wordbooker_column_def[WORDBOOKER_USERSTATUS]=array ('user_ID'=>'bigint(20) unsigned','name'=>'varchar(250)','status'=>'varchar(2048)','updated'=>'int(20)','url'=>'varchar(250)','pic'=>'varchar(250)','blog_id'=>'bigint(20)','facebook_id'=>'varchar(40)'); 
    1250  
    1251 $wordbooker_column_def[WORDBOOKER_POSTCOMMENTS]=array ('fb_post_id'=>'varchar(40)','user_id'=>'bigint(20)','comment_timestamp'=>'int(20)','wp_post_id'=>'int(11)','blog_id'=>'bigint(20)','wp_comment_id'=>'int(20)','fb_comment_id'=>'varchar(40)','in_out'=>'varchar(20)'); 
    1252  
    1253 $wordbooker_column_def[WORDBOOKER_PROCESS_QUEUE]=array ('entry_type'=>'varchar(20)','blog_id'=>'int(11)','post_id'=>'int(11)','priority'=>'int(11)','status'=>'varchar(20)'); 
    1254  
    1255 $wordbooker_column_def[WORDBOOKER_FB_FRIENDS]=array ('user_id'=>'int(11)','blog_id'=>'bigint(20)','facebook_id'=>'varchar(20)','name'=>'varchar(200)'); 
    1256  
    1257 $wordbooker_column_def[WORDBOOKER_FB_FRIEND_LISTS]=array ('user_id'=>'int(11)','flid'=>'varchar(80)','owner'=>'varchar(80)','name'=>'varchar(240)'); 
    1258     foreach ($table_array as $table) { 
    1259         $working_table=$wordbooker_columns[$table]; 
    1260         $working_table_def=$wordbooker_column_def[$table]; 
    1261         foreach ($working_table as $chardata){ 
    1262             $sql="SELECT column_name,column_type FROM information_schema.COLUMNS WHERE table_name='".$table."' and table_schema='".DB_NAME."' and column_name='".$chardata."'"; 
    1263     $rows =  $wpdb->get_row($sql,ARRAY_N); 
    1264     #var_dump($rows); 
    1265         if ($chardata==$rows[0]) { 
    1266             $col_status=" present";$correct_sql='zed';       
    1267             if ($working_table_def[$chardata]==$rows[1]) {$col_def_status=" matches";$correct_def_sql='zed';}  
    1268             else {$col_def_status=" mismatches"; $correct_def_sql="alter table ".$table." change ".$chardata." ".$chardata." ".$working_table_def[$chardata];} 
    1269         } else { 
    1270             $col_status=" missing"; $correct_sql="alter table ".$table." add ".$chardata." ".$working_table_def[$chardata]; 
    1271         } 
    1272     #   echo "<li>". $chardata ." is ".$col_status." - ".$correct_sql."</li>"; 
    1273     #   echo "<li>". $chardata ." type ".$col_def_status." - ".$correct_def_sql."</li>"; 
    1274     #       echo "'".$chardata->column_name."',"; 
    1275         #echo "'".$chardata->column_name."'=>'".$chardata->column_type."',"; 
    1276         if ($correct_sql!='zed') {$sql_run[]=$correct_sql;} 
    1277         if ($correct_def_sql!='zed') {$sql_run[]=$correct_def_sql;} 
    1278     } 
    1279 } 
    1280     #var_dump($sql_run); 
    1281     if (is_array($sql_run)) { 
    1282         echo "Schema differences found - fixing up <br />"; 
    1283         foreach($sql_run as $sql_fix) { 
    1284             echo "Executing : ".$sql_fix."<br />"; 
    1285             $result=@mysql_query($sql_fix); 
    1286         } 
    1287         echo "<br />"; 
    1288     } 
    12891293    if (ADVANCED_DEBUG) { phpinfo(INFO_MODULES);} 
    12901294?> 
     
    13221326function wordbooker_return_images($post_content,$flag) { 
    13231327    global $wordbooker_post_options,$wpdb,$post; 
     1328    if(is_null($post->ID)) {return;} 
    13241329    $wordbooker_settings =wordbooker_options();  
    13251330    # Grab the content of the post once its been filtered for display - this converts app tags into HTML so we can grab gallery images etc. 
     
    13311336    ); 
    13321337    $postcontent2=""; 
     1338    #var_dump($post->ID); 
    13331339    $attachments = get_posts( $args ); 
     1340    #var_dump($attachments); 
    13341341    if ( $attachments ) { 
    13351342        foreach ( $attachments as $attachment ) { 
    1336             if ($flag==1) {wordbooker_debugger("Adding image",wp_get_attachment_url($attachment->ID),$post->ID,80) ;} 
    1337             $post_content2 .= ' <img src="' . wp_get_attachment_url($attachment->ID) . '"> '; 
     1343            if ($attachment->post_type=='attachment') {wordbooker_debugger("Adding image",wp_get_attachment_url($attachment->ID),$post->ID,80) ; 
     1344            $post_content2 .= ' <img src="' . wp_get_attachment_url($attachment->ID) . '"> ';} 
    13381345        } 
    13391346    } 
     
    15551562        // Share This 
    15561563        wordbooker_debugger("Share Link being used"," ",$post_id,80) ; 
    1557         $action_links = array('name' => __('Share', 'wordbooker'),'link' => 'http://www.facebook.com/share.php?u='.urlencode($post_data['post_link_share'])); 
     1564        $action_links = array('name' => __('Share', 'wordbooker'),'link' => 'https://www.facebook.com/share.php?u='.urlencode($post_data['post_link_share'])); 
    15581565        $wordbooker_fb_post['actions']=json_encode($action_links); 
    15591566    } 
     
    19381945    if (isset($wordbooker_settings['wordbooker_time_button'])) { 
    19391946        if (isset($wordbooker_settings['wordbooker_iframe'])) { 
    1940              $share_code='<!-- Wordbooker created FB tags --> <iframe src="http://www.facebook.com/plugins/add_to_timeline.php?show-faces=true&amp;mode=button&amp;appId=277399175632726" style="border:none; overflow:hidden;"></iframe>'; 
     1947             $share_code='<!-- Wordbooker created FB tags --> <iframe src="https://www.facebook.com/plugins/add_to_timeline.php?show-faces=true&amp;mode=button&amp;appId=277399175632726" style="border:none; overflow:hidden;"></iframe>'; 
    19411948        } 
    19421949        else { 
     
    19821989    if (isset($wordbooker_settings['wordbooker_time_button'])) { 
    19831990        if (isset($wordbooker_settings['wordbooker_iframe'])) { 
    1984              $share_code='<!-- Wordbooker created FB tags --> <iframe src="http://www.facebook.com/plugins/add_to_timeline.php?show-faces=true&amp;mode=button&amp;appId=277399175632726" frameborder="0" style="border:none; overflow:hidden;" ></iframe>'; 
     1991             $share_code='<!-- Wordbooker created FB tags --> <iframe src="https://www.facebook.com/plugins/add_to_timeline.php?show-faces=true&amp;mode=button&amp;appId=277399175632726" frameborder="0" style="border:none; overflow:hidden;" ></iframe>'; 
    19851992        } 
    19861993        else { 
     
    20192026            $wplang=wordbooker_get_language(); 
    20202027            if ($wordbooker_settings['wordbooker_fblike_faces']=='true') {$px=80;} 
    2021             $like_code='<!-- Wordbooker created FB tags --> <iframe src="http://www.facebook.com/plugins/send.php?locale='.$wplang.'&amp;href='.$post_link.'&amp;layout='.$wordbooker_settings['wordbooker_fblike_button'].'&amp;show_faces='.$wordbooker_settings['wordbooker_fblike_faces'].'&amp;width='.$wordbooker_settings["wordbooker_like_width"].'&amp;action='.$wordbooker_settings['wordbooker_fblike_action'].'&amp;colorscheme='.$wordbooker_settings['wordbooker_fblike_colorscheme'].'&amp;font='.$wordbooker_settings['wordbooker_fblike_font'].'&amp;height='.$px.'px" style="border:none; overflow:hidden; width:'.$wordbooker_settings["wordbooker_like_width"].'px; height:'.$px.'px;" ></iframe>'; 
     2028            $like_code='<!-- Wordbooker created FB tags --> <iframe src="https://www.facebook.com/plugins/send.php?locale='.$wplang.'&amp;href='.$post_link.'&amp;layout='.$wordbooker_settings['wordbooker_fblike_button'].'&amp;show_faces='.$wordbooker_settings['wordbooker_fblike_faces'].'&amp;width='.$wordbooker_settings["wordbooker_like_width"].'&amp;action='.$wordbooker_settings['wordbooker_fblike_action'].'&amp;colorscheme='.$wordbooker_settings['wordbooker_fblike_colorscheme'].'&amp;font='.$wordbooker_settings['wordbooker_fblike_font'].'&amp;height='.$px.'px" style="border:none; overflow:hidden; width:'.$wordbooker_settings["wordbooker_like_width"].'px; height:'.$px.'px;" ></iframe>'; 
    20222029 
    20232030        } 
     
    20542061            $wplang=wordbooker_get_language(); 
    20552062            if ($wordbooker_settings['wordbooker_fblike_faces']=='true') {$px=80;} 
    2056             $like_code='<!-- Wordbooker created FB tags --> <iframe src="http://www.facebook.com/plugins/send.php?locale='.$wplang.'&amp;href='.$post_link.'&amp;layout='.$wordbooker_settings['wordbooker_fblike_button'].'&amp;show_faces='.$wordbooker_settings['wordbooker_fblike_faces'].'&amp;width='.$wordbooker_settings["wordbooker_like_width"].'&amp;action='.$wordbooker_settings['wordbooker_fblike_action'].'&amp;colorscheme='.$wordbooker_settings['wordbooker_fblike_colorscheme'].'&amp;font='.$wordbooker_settings['wordbooker_fblike_font'].'&amp;height='.$px.'px" style="border:none; overflow:hidden; width:'.$wordbooker_settings["wordbooker_like_width"].'px; height:'.$px.'px;" ></iframe>'; 
     2063            $like_code='<!-- Wordbooker created FB tags --> <iframe src="https://www.facebook.com/plugins/send.php?locale='.$wplang.'&amp;href='.$post_link.'&amp;layout='.$wordbooker_settings['wordbooker_fblike_button'].'&amp;show_faces='.$wordbooker_settings['wordbooker_fblike_faces'].'&amp;width='.$wordbooker_settings["wordbooker_like_width"].'&amp;action='.$wordbooker_settings['wordbooker_fblike_action'].'&amp;colorscheme='.$wordbooker_settings['wordbooker_fblike_colorscheme'].'&amp;font='.$wordbooker_settings['wordbooker_fblike_font'].'&amp;height='.$px.'px" style="border:none; overflow:hidden; width:'.$wordbooker_settings["wordbooker_like_width"].'px; height:'.$px.'px;" ></iframe>'; 
    20572064 
    20582065        } 
     
    20892096            $wplang=wordbooker_get_language(); 
    20902097            if ($wordbooker_settings['wordbooker_fblike_faces']=='true') {$px=95;} 
    2091             $like_code='<!-- Wordbooker created FB tags --> <iframe src="http://www.facebook.com/plugins/like.php?locale='.$wplang.'&amp;href='.$post_link.'&amp;layout='.$wordbooker_settings['wordbooker_fblike_button'].'&amp;show_faces='.$wordbooker_settings['wordbooker_fblike_faces'].'&amp;width='.$wordbooker_settings["wordbooker_like_width"].'&amp;action='.$wordbooker_settings['wordbooker_fblike_action'].'&amp;colorscheme='.$wordbooker_settings['wordbooker_fblike_colorscheme'].'&amp;font='.$wordbooker_settings['wordbooker_fblike_font'].'&amp;height='.$px.'px" style="border:none; overflow:hidden; width:'.$wordbooker_settings["wordbooker_like_width"].'px; height:'.$px.'px;" ></iframe>'; 
     2098            $like_code='<!-- Wordbooker created FB tags --> <iframe src="https://www.facebook.com/plugins/like.php?locale='.$wplang.'&amp;href='.$post_link.'&amp;layout='.$wordbooker_settings['wordbooker_fblike_button'].'&amp;show_faces='.$wordbooker_settings['wordbooker_fblike_faces'].'&amp;width='.$wordbooker_settings["wordbooker_like_width"].'&amp;action='.$wordbooker_settings['wordbooker_fblike_action'].'&amp;colorscheme='.$wordbooker_settings['wordbooker_fblike_colorscheme'].'&amp;font='.$wordbooker_settings['wordbooker_fblike_font'].'&amp;height='.$px.'px" style="border:none; overflow:hidden; width:'.$wordbooker_settings["wordbooker_like_width"].'px; height:'.$px.'px;" ></iframe>'; 
    20922099 
    20932100        } 
     
    21302137            if ($wplang=="WPLANG" ) {$wplang="en_US";} 
    21312138            if ($wordbooker_settings['wordbooker_fblike_faces']=='true') {$px=95;} 
    2132             $like_code='<!-- Wordbooker created FB tags --> <iframe src="http://www.facebook.com/plugins/like.php?locale='.$wplang.'&amp;href='.$post_link.'&amp;layout='.$wordbooker_settings['wordbooker_fblike_button'].'&amp;show_faces='.$wordbooker_settings['wordbooker_fblike_faces'].'&amp;width='.$wordbooker_settings["wordbooker_like_width"].'&amp;action='.$wordbooker_settings['wordbooker_fblike_action'].'&amp;colorscheme='.$wordbooker_settings['wordbooker_fblike_colorscheme'].'&amp;font='.$wordbooker_settings['wordbooker_fblike_font'].'&amp;height='.$px.'px" style="border:none; overflow:hidden; width:'.$wordbooker_settings["wordbooker_like_width"].'px; height:'.$px.'px;" ></iframe>'; 
     2139            $like_code='<!-- Wordbooker created FB tags --> <iframe src="https://www.facebook.com/plugins/like.php?locale='.$wplang.'&amp;href='.$post_link.'&amp;layout='.$wordbooker_settings['wordbooker_fblike_button'].'&amp;show_faces='.$wordbooker_settings['wordbooker_fblike_faces'].'&amp;width='.$wordbooker_settings["wordbooker_like_width"].'&amp;action='.$wordbooker_settings['wordbooker_fblike_action'].'&amp;colorscheme='.$wordbooker_settings['wordbooker_fblike_colorscheme'].'&amp;font='.$wordbooker_settings['wordbooker_fblike_font'].'&amp;height='.$px.'px" style="border:none; overflow:hidden; width:'.$wordbooker_settings["wordbooker_like_width"].'px; height:'.$px.'px;" ></iframe>'; 
    21332140 
    21342141        } 
     
    22722279        $midamble=trim(preg_replace("/(.*?)((,|\s)*)$/m", "$1", $midamble)); 
    22732280        $midamble=substr_replace($midamble, " and ", strrpos($midamble, ","), strlen(","));  
    2274         echo " ".$preamble.$midamble.$postamble.'</p><div style="text-align: center;"><a href="'.$loginUrl2.'" > <img src="http://static.ak.facebook.com/images/devsite/facebook_login.gif"  alt="Facebook Login Button" /></a><br /></div>';        
     2281        echo " ".$preamble.$midamble.$postamble.'</p><div style="text-align: center;"><a href="'.$loginUrl2.'" > <img src="https://static.ak.facebook.com/images/devsite/facebook_login.gif"  alt="Facebook Login Button" /></a><br /></div>';       
    22752282    } 
    22762283    echo "and then save your settings<br />"; 
Note: See TracChangeset for help on using the changeset viewer.