Changeset 412626
- Timestamp:
- 07/20/2011 03:14:45 PM (15 years ago)
- Location:
- fanpage-connect/trunk
- Files:
-
- 4 edited
-
fanpage-connect-meta.php (modified) (10 diffs)
-
fanpage-connect-options.php (modified) (1 diff)
-
fanpage-connect.php (modified) (23 diffs)
-
readme.txt (modified) (9 diffs)
Legend:
- Unmodified
- Added
- Removed
-
fanpage-connect/trunk/fanpage-connect-meta.php
r410279 r412626 3 3 <?php if($this->plugin_activated): ?> 4 4 5 <input type="hidden" id="_fbfp_cookie" name="_fbfp_cookie" value="true">6 7 5 <label>Make this page a FanPage?</label> 8 <select id="_fbfp_isfanpage" name="_fbfp _isfanpage">9 <?php if($ isfanpage== "true"): ?>6 <select id="_fbfp_isfanpage" name="_fbfp[isfanpage]"> 7 <?php if($meta['isfanpage'] == "true"): ?> 10 8 <option value="false">No</option> 11 9 <option value="true" selected="selected">Yes</option> … … 19 17 </p> 20 18 21 <?php if($ isfanpage== "true"): ?>19 <?php if($meta['isfanpage'] == "true"): ?> 22 20 <div id="fpc_other_meta"> 23 21 <?php else: ?> … … 27 25 <div class="fpc-menu-header" id="hdr-app-settings">Facebook Application Settings</div> 28 26 <div class="fpc-menu" id="fpc-app-settings"> 29 <label for="_fbfp _appid">Facebook Application ID:</label>27 <label for="_fbfp[appid]">Facebook Application ID:</label> 30 28 <p> 31 <input type="text" id="_fbfp _appid" name="_fbfp_appid" value="<?php echo $fbappid; ?>">29 <input type="text" id="_fbfp[appid]" name="_fbfp[appid]" value="<?php echo $meta['appid']; ?>"> 32 30 <div class="desc"> 33 31 Enter the Application ID of your Facebook Application. Learn how to create your Facebook application … … 36 34 </p> 37 35 38 <label for="_fbfp _appsecret">Facebook Application Secret:</label>36 <label for="_fbfp[appsecret]">Facebook Application Secret:</label> 39 37 <p> 40 <input type="text" id="_fbfp _appsecret" name="_fbfp_appsecret" value="<?php echo $fbappsecret; ?>">38 <input type="text" id="_fbfp[appsecret]" name="_fbfp[appsecret]" value="<?php echo $meta['appsecret']; ?>"> 41 39 <div class="desc">Enter the Application Secret of your Facebook Application.</div> 42 40 </p> … … 45 43 <div class="fpc-menu-header" id="hdr-menu-settings">Menu Settings</div> 46 44 <div class="fpc-menu" id="fpc-menu-settings"> 47 <label for="_fbfp_use_menu">Use Menu In Page?</label> 48 <select id="_fbfp_use_menu" name="_fbfp_use_menu"> 49 <?php if($pg_use_menu == "true") { ?> 45 <label for="_fbfp[use_menu]">Use Menu In Page?</label> 46 <select id="_fbfp[use_menu]" name="_fbfp[use_menu]"> 47 <?php if($meta['use_menu'] == "true") { ?> 48 <option value="defer">Defer to Global</option> 50 49 <option value="false">No</option> 51 50 <option value="true" selected="selected">Yes</option> 51 <?php } elseif($meta['use_menu'] == "false") { ?> 52 <option value="defer">Defer to Global</option> 53 <option value="false" selected="selected">No</option> 54 <option value="true">Yes</option> 52 55 <?php } else { ?> 53 <option value="false" selected="selected">No</option> 56 <option value="defer" selected="selected">Defer to Global</option> 57 <option value="false">No</option> 54 58 <option value="true">Yes</option> 55 59 <?php } ?> … … 61 65 </p> 62 66 63 <label for="_fbfp_show_menu">Display Menu</label> 64 <select id="_fbfp_show_menu" name="_fbfp_show_menu"> 65 <?php if($pg_show_menu == "liked" || $pg_show_menu == '' || is_null($pg_show_menu)) { ?> 67 <label for="_fbfp[show_menu]">Display Menu:</label> 68 <select id="_fbfp[show_menu]" name="_fbfp[show_menu]"> 69 <?php if($meta['show_menu'] == "liked") { ?> 70 <option value="defer">Defer to Global</option> 66 71 <option value="always">Always</option> 67 72 <option value="liked" selected="selected">Only When "Liked"</option> 73 <?php } elseif($meta['show_menu'] == "always") { ?> 74 <option value="defer">Defer to Global</option> 75 <option value="always" selected="selected">Always</option> 76 <option value="liked">Only When "Liked"</option> 68 77 <?php } else { ?> 78 <option value="defer">Defer to Global</option> 69 79 <option value="always" selected="selected">Always</option> 70 80 <option value="liked">Only When "Liked"</option> … … 80 90 <div class="fpc-menu-header" id="hdr-css-settings">CSS Settings</div> 81 91 <div class="fpc-menu" id="fpc-css-settings"> 82 <label for="_fbfp _csslink">Custom CSS link:</label>92 <label for="_fbfp[csslink]">Custom CSS link:</label> 83 93 <p> 84 <input type="text" id="_fbfp _csslink" name="_fbfp_csslink" value="<?php echo $fbcsslink; ?>">94 <input type="text" id="_fbfp[csslink]" name="_fbfp[csslink]" value="<?php echo $meta['csslink']; ?>"> 85 95 <div class="desc">Enter the URL of the CSS file you'd like to use on your fanpage.</div> 86 96 </p> 87 97 88 <label for="_fbfp _css">Custom CSS:</label>98 <label for="_fbfp[css]">Custom CSS:</label> 89 99 <p> 90 <textarea id="_fbfp _css" name="_fbfp_css"><?php echo $fbcss; ?></textarea>100 <textarea id="_fbfp[css]" name="_fbfp[css]"><?php echo $meta['css']; ?></textarea> 91 101 <div class="desc">Copy and paste any CSS you'd like to use on your fanpage. This will be loaded after any other CSS file</div> 92 102 </p> … … 95 105 <div class="fpc-menu-header" id="hdr-hdrftr-settings">Header/Footer Content</div> 96 106 <div class="fpc-menu" id="fpc-hdrftr-settings"> 97 <label for="_fbfp _header">Custom Header Content:</label>107 <label for="_fbfp[header]">Custom Header Content:</label> 98 108 <p> 99 <textarea id="_fbfp _header" name="_fbfp_header"><?php echo $fbheadercontent; ?></textarea>109 <textarea id="_fbfp[header]" name="_fbfp[header]"><?php echo $meta['header']; ?></textarea> 100 110 <div class="desc">Paste any custom header content here. It'll be displayed in the <div id="header"> div.</div> 101 111 </p> 102 112 103 <label for="_fbfp _footer">Custom Footer Content:</label>113 <label for="_fbfp[footer]">Custom Footer Content:</label> 104 114 <p> 105 <textarea id="_fbfp _footer" name="_fbfp_footer"><?php echo $fbfootercontent; ?></textarea>115 <textarea id="_fbfp[footer]" name="_fbfp[footer]"><?php echo $meta['footer']; ?></textarea> 106 116 <div class="desc">Paste any custom footer content here. It'll be displayed in the <div id="footer"> div.</div> 107 117 </p> … … 111 121 <div class="fpc-menu" id="fpc-misc-settings"> 112 122 113 <label for="_fbfp _show_comments">Display Comments</label>114 <select id="_fbfp _show_comments" name="_fbfp_show_comments">115 <?php if($ pg_show_comments == "liked" || $pg_show_comments == '' || is_null($pg_show_comments)) { ?>123 <label for="_fbfp[show_comments]">Display Comments:</label> 124 <select id="_fbfp[show_comments]" name="_fbfp[show_comments]"> 125 <?php if($meta['show_comments'] == "liked" || $meta['show_comments'] == '' || is_null($meta['show_comments'])) { ?> 116 126 <option value="always">Always</option> 117 127 <option value="liked" selected="selected">Only When "Liked"</option> … … 127 137 </p> 128 138 129 <label for="_fbfp_template">Custom Template:</label> 130 <p> 131 <?php echo $this->fpc_get_templates($fbtemplate); ?> 132 </p> 139 <label for="_fbfp[template]">Custom Template:</label> 140 <?php echo $this->fpc_get_templates($meta['template']); ?> 133 141 134 142 </div> -
fanpage-connect/trunk/fanpage-connect-options.php
r410279 r412626 132 132 <td> 133 133 <select id="fpogtype" name="fpogtype"> 134 <option value=" Chose a type">Chose a type</option>134 <option value="">Chose a type</option> 135 135 <option value="activity">activity</option> 136 136 <option value="actor">actor</option> -
fanpage-connect/trunk/fanpage-connect.php
r410279 r412626 3 3 Plugin Name: Fanpage Connect FREE 4 4 Plugin URI: http://www.fanpageconnect.com 5 Version: v1.3. 16 Author: <a href="http://www.fanpageconnect.com">Pat Friedl, Chris Friedl, Bryan Batson</a>5 Version: v1.3.2 6 Author: Pat Friedl, Chris Friedl, Bryan Batson 7 7 Description: Fanpage Connect is the WordPress plugin that allows you to create an administer your Facebook fan pages directly from WordPress. 8 8 … … 35 35 var $fbappid; 36 36 var $fbappsecret; 37 var $fbcookie;38 var $fbautofit;39 37 var $fbcsslink; 40 38 var $fbcss; … … 60 58 61 59 // other variables 62 var $use_menu;63 var $show_menu;64 60 var $link_luv; 65 61 var $fb_error; … … 81 77 82 78 if (!defined('FPC_PLUGIN_VERSION')) 83 define('FPC_PLUGIN_VERSION','1.3. 1');79 define('FPC_PLUGIN_VERSION','1.3.2'); 84 80 85 81 global $post; … … 87 83 // pre-empt all other content 88 84 add_action('wp',array(&$this, 'dofbpage'),1); 89 90 // get post and find google fonts91 add_action('save_post', array(&$this, 'fpc_setup_google_fonts'));92 85 93 86 // add admin menu … … 129 122 $this->g_fpogimg = $options['fpogimg']; 130 123 $this->g_fpogname = $options['fpogname']; 124 131 125 $this->domain = $this->get_domain(); 132 126 133 if( $this->g_use_menu == '' || is_null($this->g_use_menu)) { $this->g_use_menu = false; }134 if( $this->g_show_menu == '' || is_null($this->g_show_menu)) { $this->g_show_menu = 'liked'; }135 if( $this->link_luv == '' || is_null($this->link_luv)) { $this->link_luv = 1; }127 if(empty($this->g_use_menu)) { $this->g_use_menu = false; } 128 if(empty($this->g_show_menu)) { $this->g_show_menu = 'liked'; } 129 if(empty($this->link_luv)) { $this->link_luv = 1; } 136 130 137 131 } // end function FanpageConnect … … 144 138 global $post; 145 139 146 $this->isfanpage = $this->get_value(get_post_meta($post->ID, '_fbfp_isfanpage', true),false); 140 $this->convert_old_meta($post->ID); 141 $page_meta = get_post_meta($post->ID, '_fbfp', true); 142 $this->isfanpage = $page_meta['isfanpage']; 147 143 $pos = strpos($_SERVER['HTTP_HOST'].$_SERVER['PHP_SELF'],'wp-admin/edit.php',0); 148 $parmPrefix = (strpos($this->g_fp_url,'?') === false)? '?' : '&';149 $link_luv_url = 'http://www.fanpageconnect.com';150 144 151 145 if ((is_page() || is_object($post)) && $this->isfanpage == 'true' && $pos === false) { 152 146 153 // change - get meta as an array, forget forcing values - next version! 154 $this->fbappid = $this->get_value(get_post_meta($post->ID, '_fbfp_appid', true),''); 155 $this->fbappsecret = $this->get_value(get_post_meta($post->ID, '_fbfp_appsecret', true),''); 156 $this->fbcookie = $this->get_value(get_post_meta($post->ID, '_fbfp_cookie', true),true); 157 $this->fbcsslink = $this->get_value(get_post_meta($post->ID, '_fbfp_csslink', true),''); 158 $this->fbcss = $this->get_value(get_post_meta($post->ID, '_fbfp_css', true),''); 159 $this->fbtemplate = $this->get_value(get_post_meta($post->ID, '_fbfp_template', true),''); 160 $this->fbheadercontent = $this->get_value(get_post_meta($post->ID, '_fbfp_header', true),''); 161 $this->fbfootercontent = $this->get_value(get_post_meta($post->ID, '_fbfp_footer', true),''); 162 $this->use_menu = $this->get_value(get_post_meta($post->ID, '_fbfp_use_menu',true),false); 163 $this->show_menu = $this->get_value(get_post_meta($post->ID, '_fbfp_show_menu',true),'liked'); 164 $this->show_comments = $this->get_value(get_post_meta($post->ID, '_fbfp_show_comments',true),'liked'); 165 $this->google_fonts = $this->get_value(get_post_meta($post->ID, '_fbfp_goole_fonts', true),''); 147 $parmPrefix = (strpos($this->g_fp_url,'?') === false)? '?' : '&'; 148 $link_luv_url = 'http://www.fanpageconnect.com'; 149 150 // free variables 151 $this->fbappid = $page_meta['appid']; 152 $this->fbappsecret = $page_meta['appsecret']; 153 $this->fbcsslink = $page_meta['csslink']; 154 $this->fbcss = $page_meta['css']; 155 $this->fbtemplate = $page_meta['template']; 156 $this->fbheadercontent = $page_meta['header']; 157 $this->fbfootercontent = $page_meta['footer']; 158 $this->show_comments = $page_meta['show_comments']; 159 $this->google_fonts = $page_meta['google_fonts']; 160 161 $this->get_overrides($page_meta); 166 162 167 163 // send a header for IE … … 176 172 'appId' => $this->fbappid, 177 173 'secret' => $this->fbappsecret, 178 'cookie' => $this->fbcookie174 'cookie' => TRUE 179 175 )); 180 176 … … 245 241 <meta property="fb:admins" content="<?php echo $this->fbappid; ?>"> 246 242 <title><?php bloginfo('name'); ?> - <?php is_home() ? bloginfo('description') : wp_title(''); ?></title> 247 <?php if( $this->g_fp_url != '' && $this->fbappid != ''){ ?><script type="text/javascript">if(parent.frames.length <= 0){window.location = "<?php echo $this->g_fp_url.$parmPrefix.'sk=app_'.$this->fbappid; ?>";}</script><?php } ?>243 <?php if(!empty($this->g_fp_url) && !empty($this->fbappid)){ ?><script type="text/javascript">if(parent.frames.length <= 0){window.location = "<?php echo $this->g_fp_url.$parmPrefix.'sk=app_'.$this->fbappid; ?>";}</script><?php } ?> 248 244 <?php wp_head(); ?> 249 245 <link rel="stylesheet" href="<?php echo FPC_PLUGIN_URL; ?>/css/wp.css" type="text/css" media="screen" /> 250 246 <link rel="stylesheet" href="<?php echo FPC_PLUGIN_URL; ?>/css/default.css" type="text/css" media="screen" /> 251 <?php if( $this->google_fonts != ''){ ?><link rel="stylesheet" href="http://fonts.googleapis.com/css?family=<?php echo $this->google_fonts; ?>" type="text/css"><?php } ?>252 <?php if( $this->fbtemplate != ''){ ?><link rel="stylesheet" href="<?php echo FPC_PLUGIN_URL; ?>/templates/<?php echo $this->fbtemplate;?>/default.css" type="text/css" media="screen" /><?php } ?>253 <?php if( $this->fbcsslink != ''){?><link rel="stylesheet" href="<?php echo $this->fbcsslink; ?>" type="text/css" media="screen" /><?php } ?>254 <?php if( $this->fbcss != ''){?><style type="text/css"><?php echo $this->fbcss; ?></style><?php } ?>247 <?php if(!empty($this->google_fonts)){ ?><link rel="stylesheet" href="http://fonts.googleapis.com/css?family=<?php echo $this->google_fonts; ?>" type="text/css"><?php } ?> 248 <?php if(!empty($this->fbtemplate)){ ?><link rel="stylesheet" href="<?php echo FPC_PLUGIN_URL; ?>/templates/<?php echo $this->fbtemplate;?>/default.css" type="text/css" media="screen" /><?php } ?> 249 <?php if(!empty($this->fbcsslink)){?><link rel="stylesheet" href="<?php echo $this->fbcsslink; ?>" type="text/css" media="screen" /><?php } ?> 250 <?php if(!empty($this->fbcss)){?><style type="text/css"><?php echo $this->fbcss; ?></style><?php } ?> 255 251 <?php if($this->g_autofit == 'true'){ ?> 256 252 <style type="text/css"> … … 273 269 <div id="fpc-header"> 274 270 <?php echo do_shortcode(shortcode_unautop($this->fbheadercontent)); ?> 275 <?php if( $this->g_menu_name != "" && $this->use_menu == 'true') { ?>276 <?php if(($this-> show_menu == 'liked' && $this->page_liked) || $this->show_menu == 'always'){ ?>271 <?php if(!empty($this->g_menu_name) && $this->g_use_menu == 'true') { ?> 272 <?php if(($this->g_show_menu == 'liked' && $this->page_liked) || $this->g_show_menu == 'always'){ ?> 277 273 <div id="fpc-menu"> 278 274 <?php wp_nav_menu(array('menu' => $this->g_menu_name,'container_class' => 'menu-header')); ?> … … 367 363 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 368 364 */ 369 370 365 /* 371 366 display content if page not liked … … 412 407 } // end fpc_font 413 408 414 // process post and add google fonts 409 /* 410 process post and add google fonts 411 */ 415 412 function fpc_setup_google_fonts($postID) { 413 $fonts_to_include = ''; 416 414 if (defined('DOING_AUTOSAVE') && DOING_AUTOSAVE) { 417 415 return $postID; … … 419 417 $the_post = get_post($postID); 420 418 if($the_post){ 421 $fonts_to_include = '';422 419 $the_content = $the_post->post_content; 423 420 $pattern = '/\\[font[^\\"\\\'\\]]+face=["\\\']([^"\']+)["\\\']/i'; … … 426 423 $fonts_to_include = str_replace(" ","+",join("|", array_unique($matches[1]))); 427 424 } 428 if($fonts_to_include != ''){ 429 update_post_meta($postID, "_fbfp_goole_fonts",$fonts_to_include); 430 } else { 431 delete_post_meta($postID, "_fbfp_goole_fonts"); 432 } 433 } 434 } 425 } 426 } 427 return $fonts_to_include; 435 428 } // end fpc_setup_google_fonts 436 429 /* … … 441 434 442 435 /* 443 meta content values - if empty, return a set value 444 */ 445 function get_value($a,$b) { 446 $a = trim($a); 447 if($a == "") { 448 return $b; 449 } else { 450 return $a; 451 } 452 } // end get_value 436 use page overrides, if any on menus, etc 437 */ 438 function get_overrides($m) 439 { 440 $this->g_use_menu = (!empty($m['use_menu']) && $m['use_menu'] != 'defer')? $m['use_menu'] : $this->g_use_menu; 441 $this->g_show_menu = (!empty($m['show_menu']) && $m['show_menu'] != 'defer')? $m['show_menu'] : $this->g_show_menu; 442 } 443 444 /* 445 convert old individual meta data into the newer array 446 */ 447 function convert_old_meta($id) 448 { 449 $old_meta_test = get_post_meta($id, '_fbfp_isfanpage', true); 450 if($old_meta_test != ''){ 451 $new_meta = array(); 452 453 // free meta 454 $new_meta['isfanpage'] = get_post_meta($id, '_fbfp_isfanpage', true); 455 $new_meta['appid'] = get_post_meta($id, '_fbfp_appid', true); 456 $new_meta['appsecret'] = get_post_meta($id, '_fbfp_appsecret', true); 457 $new_meta['csslink'] = get_post_meta($id, '_fbfp_csslink', true); 458 $new_meta['css'] = get_post_meta($id, '_fbfp_css', true); 459 $new_meta['template'] = get_post_meta($id, '_fbfp_template', true); 460 $new_meta['header'] = get_post_meta($id, '_fbfp_header', true); 461 $new_meta['footer'] = get_post_meta($id, '_fbfp_footer', true); 462 $new_meta['use_menu'] = get_post_meta($id, '_fbfp_use_menu',true); 463 $new_meta['show_menu'] = get_post_meta($id, '_fbfp_show_menu',true); 464 $new_meta['show_comments'] = get_post_meta($id, '_fbfp_show_comments',true); 465 $new_meta['google_font'] = get_post_meta($id, '_fbfp_goole_fonts', true); 466 467 update_post_meta($id, '_fbfp', $new_meta); 468 469 // nuke the old meta 470 delete_post_meta($id, '_fbfp_isfanpage'); 471 delete_post_meta($id, '_fbfp_autofit'); 472 delete_post_meta($id, '_fbfp_debug'); 473 delete_post_meta($id, '_fbfp_appid'); 474 delete_post_meta($id, '_fbfp_appsecret'); 475 delete_post_meta($id, '_fbfp_cookie'); 476 delete_post_meta($id, '_fbfp_csslink'); 477 delete_post_meta($id, '_fbfp_css'); 478 delete_post_meta($id, '_fbfp_template'); 479 delete_post_meta($id, '_fbfp_header'); 480 delete_post_meta($id, '_fbfp_footer'); 481 delete_post_meta($id, '_fbfp_use_menu'); 482 delete_post_meta($id, '_fbfp_show_menu'); 483 delete_post_meta($id, '_fbfp_show_comments'); 484 delete_post_meta($id, '_fbfp_goole_fonts'); 485 } 486 } 453 487 454 488 /* … … 474 508 function fpc_show_box() { 475 509 global $post; 510 // convert old meta 511 $this->convert_old_meta($post->ID); 476 512 // get meta data for the form 477 $isfanpage = get_post_meta($post->ID, '_fbfp_isfanpage', true); 478 $fbappid = get_post_meta($post->ID, '_fbfp_appid', true); 479 $fbappsecret = get_post_meta($post->ID, '_fbfp_appsecret', true); 480 $fbcookie = get_post_meta($post->ID, '_fbfp_cookie', true); 481 $fbcsslink = get_post_meta($post->ID, '_fbfp_csslink', true); 482 $fbcss = get_post_meta($post->ID, '_fbfp_css', true); 483 $fbtemplate = get_post_meta($post->ID, '_fbfp_template', true); 484 $fbheadercontent = get_post_meta($post->ID, '_fbfp_header', true); 485 $fbfootercontent = get_post_meta($post->ID, '_fbfp_footer', true); 486 $pg_use_menu = get_post_meta($post->ID, '_fbfp_use_menu', true); 487 $pg_show_menu = get_post_meta($post->ID, '_fbfp_show_menu', true); 488 $pg_show_comments = get_post_meta($post->ID, '_fbfp_show_comments', true); 489 490 if($pg_use_menu == '' || is_null($pg_use_menu)) { $pg_use_menu = $this->g_use_menu; } 491 if($pg_show_menu == '' || is_null($pg_show_menu)) { $pg_show_menu = $this->g_show_menu; } 513 $meta = get_post_meta($post->ID, '_fbfp', true); 514 // show the page 492 515 include(FPC_PLUGIN_DIR . '/fanpage-connect-meta.php'); 493 516 echo '<input type="hidden" id="fpc_nonce" name="fpc_nonce" value="' . wp_create_nonce(basename(__FILE__)) . '" />'; … … 509 532 if($has_dirs) 510 533 { 511 $out .= '<select id="_fbfp _template" name="_fbfp_template">';534 $out .= '<select id="_fbfp[template]" name="_fbfp[template]">'; 512 535 if($t == ''){ 513 536 $out .= '<option value="" selected="selected"></option>'; … … 546 569 return $post_id; 547 570 } 548 549 571 // check autosave 550 572 if (defined('DOING_AUTOSAVE') && DOING_AUTOSAVE) { 551 573 return $post_id; 552 574 } 553 554 575 // check user permissions 555 576 if ('page' == $_POST['post_type']) { … … 560 581 return $post_id; 561 582 } 562 563 // save the data - need some cleanup here - make the options an array... 564 // get the OLD meta 565 $isfanpage = get_post_meta($post_id, '_fbfp_isfanpage', true); 566 $fbappid = get_post_meta($post_id, '_fbfp_appid', true); 567 $fbappsecret = get_post_meta($post_id, '_fbfp_appsecret', true); 568 $fbcookie = get_post_meta($post_id, '_fbfp_cookie', true); 569 $fbcsslink = get_post_meta($post_id, '_fbfp_csslink', true); 570 $fbcss = get_post_meta($post_id, '_fbfp_css', true); 571 $fbtemplate = get_post_meta($post_id, '_fbfp_template', true); 572 $fbheadercontent = get_post_meta($post_id, '_fbfp_header', true); 573 $fbfootercontent = get_post_meta($post_id, '_fbfp_footer', true); 574 $pg_use_menu = get_post_meta($post_id, '_fbfp_use_menu', true); 575 $pg_show_menu = get_post_meta($post_id, '_fbfp_show_menu', true); 576 $pg_show_comments = get_post_meta($post_id, '_fbfp_show_comments', true); 577 578 // get NEW meta 579 $new_isfanpage = $_POST['_fbfp_isfanpage']; 580 $new_fbappid = trim($_POST['_fbfp_appid']); 581 $new_fbappsecret = trim($_POST['_fbfp_appsecret']); 582 $new_fbcookie = $_POST['_fbfp_cookie']; 583 $new_fbcsslink = trim($_POST['_fbfp_csslink']); 584 $new_fbcss = trim($_POST['_fbfp_css']); 585 $new_fbtemplate = $_POST['_fbfp_template']; 586 $new_fbheadercontent = trim($_POST['_fbfp_header']); 587 $new_fbfootercontent = trim($_POST['_fbfp_footer']); 588 $new_pg_use_menu = trim($_POST['_fbfp_use_menu']); 589 $new_pg_show_menu = $_POST['_fbfp_show_menu']; 590 $new_pg_show_comments = $_POST['_fbfp_show_comments']; 591 592 $this->fpc_meta_update($post_id,$isfanpage, $new_isfanpage, '_fbfp_isfanpage'); 593 $this->fpc_meta_update($post_id,$fbappid, $new_fbappid, '_fbfp_appid'); 594 $this->fpc_meta_update($post_id,$fbappsecret, $new_fbappsecret, '_fbfp_appsecret'); 595 $this->fpc_meta_update($post_id,$fbcookie, $new_fbcookie, '_fbfp_cookie'); 596 $this->fpc_meta_update($post_id,$fbcsslink, $new_fbcsslink, '_fbfp_csslink'); 597 $this->fpc_meta_update($post_id,$fbcss, $new_fbcss, '_fbfp_css'); 598 $this->fpc_meta_update($post_id,$fbtemplate, $new_fbtemplate, '_fbfp_template'); 599 $this->fpc_meta_update($post_id,$fbheadercontent, $new_fbheadercontent, '_fbfp_header'); 600 $this->fpc_meta_update($post_id,$fbfootercontent, $new_fbfootercontent, '_fbfp_footer'); 601 $this->fpc_meta_update($post_id,$pg_use_menu, $new_pg_use_menu, '_fbfp_use_menu'); 602 $this->fpc_meta_update($post_id,$pg_show_menu, $new_pg_show_menu, '_fbfp_show_menu'); 603 $this->fpc_meta_update($post_id,$pg_show_comments, $new_pg_show_comments, '_fbfp_show_comments'); 604 583 // get old and new meta 584 $old_meta = get_post_meta($post_id, '_fbfp', true); 585 $new_meta = array(); 586 // assign the new meta 587 if ($_POST['_fbfp']) { 588 foreach ($_POST['_fbfp'] as $key => $value) { 589 $new_meta[$key] = trim($value); 590 } 591 } 592 // check for google fonts 593 $new_meta['google_fonts'] = $this->fpc_setup_google_fonts($post_id); 594 595 // save, update or delete the meta 596 if ($new_meta && $new_meta != $old_meta) { 597 update_post_meta($post_id, '_fbfp', $new_meta); 598 } elseif ('' == $new_meta && $old_meta) { 599 delete_post_meta($post_id, '_fbfp'); 600 } 605 601 return $post_id; 606 602 } // end fpc_meta_save 607 608 /*609 update the meta data610 */611 function fpc_meta_update($post_id,$old,$new,$n) {612 if($new && $new != $old) {613 update_post_meta($post_id, $n, $new);614 } elseif ($new == '' && $old) {615 delete_post_meta($post_id, $n, $old);616 }617 } // end fpc_meta_update618 603 619 604 /* … … 644 629 // get saved options 645 630 $saved = get_option($this->FanpageConnect_DB_option); 646 647 631 // assign options 648 632 if(!empty($saved)) … … 653 637 } 654 638 } 655 656 639 //update options if necessary 657 640 if($saved != $options) … … 659 642 update_option($this->FanpageConnect_DB_option,$options); 660 643 } 661 662 644 // return the options 663 645 return $options; … … 689 671 $options['fpogimg'] = $_POST['fpogimg']; 690 672 $options['fpogname'] = $_POST['fpogname']; 691 692 673 693 674 update_option($this->FanpageConnect_DB_option, $options); -
fanpage-connect/trunk/readme.txt
r410362 r412626 6 6 Requires at least: 3.0 7 7 Tested up to: 3.2.1 8 Stable tag: 1.3. 18 Stable tag: 1.3.2 9 9 10 10 Fanpage Connect is the WordPress plugin that allows you to create an administer your Facebook fan pages directly from WordPress. … … 16 16 Now you can power your Facebook Fan Page with your WordPress blog. In ONE click. 17 17 18 http://vimeo.com/26673379 19 18 20 Leverage the world’s most powerful blog engine and the social behemoth that is Facebook to maximize your business or brand’s exposure! 19 21 … … 23 25 24 26 Keep your website looking like your website and your fan page looking like your fan page. Fanpage Connect works with any theme seamlessly and installs on your WordPress site in just a few clicks. 27 28 == Features == 29 * No coding required - if you can edit a WordPress page, you can create Facebook Fan Pages 30 * Turn any WordPress page into a Facebook Fan Page in minutes! 31 * Use WordPress Custom Menus in your fan pages. 32 * Use the included templates to change the look of your fan page or add your own. 33 * Create high converting fan pages by easily creating a "Fan Gate" to get your visitors to "like" the page to see more content. 34 * Create even better looking fan pages with over 150 Google Web Fonts! 35 * Include Facebook Comments by just enabling comments in our page 36 * Add a high converting "Fan Gate" shortcodes with an easy "pick n click" interface in the editor 37 * Add Facebook Open Graph tags for easy Facebook integration 25 38 26 39 == Upgrade to Fanpage Connect Pro == … … 33 46 * Add your ClickBank ID to turn the "Link Luv" into a money making affiliate link 34 47 * Filter Removal for Header, content and Footer. Allows you to keep plugins from altering your content 35 * Redirect to a different URL after being "Liked" - even more fan gate control48 * Redirect to a different URL after being "Liked" - even more Fan Gate control 36 49 * Opt-In form box and shortcode to easily add opt-in forms, videos or other custom content 37 50 * Hide Selections of Content for N days - good for one time offers, coupon codes after "like", etc … … 43 56 * Shortcode for the high conversion Multi-friend Inviter! 44 57 * Shortcode for Facebook Activity Feed 58 * Shortcode for Google Plus 1 button 45 59 * Full point n' click interface in the visual editor - no need to type your shortcodes 46 60 * Widgetized areas in the content and footer … … 50 64 * Unlimited pages and NO monthly fees like those other guys! 51 65 52 For more information visit: <a href="http://www.fanpageconnect.com/pro" target="_blank">http://www.FanpageConnect.com/pro</a> 53 54 == Features == 55 * No coding required - if you can edit a WordPress page, you can create Facebook Fan Pages 56 * Turn any WordPress page into a Facebook Fan Page in minutes! 57 * Use WordPress custom Menus in your fan pages. 58 * Use the included templates to change the look of your fan page or add your own. 59 * Create high converting fan pages by easily creating a "fan gate" to get your visitors to "like" the page to see more content. 60 * Create even better looking fan pages with over 150 Google Web Fonts! 61 * Include Facebook Comments by just enabling comments in our page 62 * Add "fan gate" shortcodes with an easy "pick n click" interface in the editor 63 * Add Facebook Open Graph tags for easy Facebook integration 66 For more information visit: <a href="http://www.fanpageconnect.com/pro" target="_blank">www.FanpageConnect.com/pro</a> 64 67 65 68 == Installation == … … 81 84 82 85 = Is This Plugin Supported? = 83 Absolutely! Visit <a href="http://www.fanpageconnect.com" target="_blank"> http://www.fanpageconnect.com</a> for support and tutorial videos, or visit our fan page at <a href="http://fb.me/FanpageConnect" target="_blank">http://fb.me/FanpageConnect</a>86 Absolutely! Visit <a href="http://www.fanpageconnect.com" target="_blank">www.fanpageconnect.com</a> for support and tutorial videos, or visit our fan page at <a href="http://www.facebook.com/FanpageConnect" target="_blank">http://fb.me/FanpageConnect</a> 84 87 85 88 = Will this plugin work with my theme? = … … 102 105 103 106 = I installed the plugin, but my site doesn’t look any different in Facebook! = 104 We’ve got some cool, step by step videos on our fan page, so pop on over to <a href="http://fb.me/FanpageConenct" target="_blank">http://fb.me/FanpageConenct</a> to get the 411 on creating rockin gfan pages!107 We’ve got some cool, step by step videos on our fan page, so pop on over to <a href="http://fb.me/FanpageConenct" target="_blank">http://fb.me/FanpageConenct</a> to get the 411 on creating rockin’ fan pages! 105 108 106 109 == Screenshots == … … 112 115 == Upgrade Notice == 113 116 114 = 1.3. 1=117 = 1.3.2 = 115 118 More updates. Please upgrade! 116 119 117 120 == Changelog == 121 = 1.3.2 = 122 * Optimized page meta into a single array 123 * Streamlined/cleaned up miscecllaneous code 124 * Added "Defer to Global" in page menu settings 125 * Perfected page level override logic 126 118 127 = 1.3.1 = 119 128 * Added global Open Graph settings for fan pages
Note: See TracChangeset
for help on using the changeset viewer.