Changeset 8254
- Timestamp:
- Dec 23, 2010, 3:57:51 PM (14 years ago)
- Location:
- extensions/FacebookPlug/Plugin
- Files:
-
- 3 added
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
extensions/FacebookPlug/Plugin/include/conf.inc.php
r8250 r8254 44 44 ( 45 45 'enabled' => false, 46 'url' => 'http://www.facebook.com/Piwigo', 46 47 'url_type' => 'page', 47 48 'colorscheme' => 'dark', -
extensions/FacebookPlug/Plugin/include/picture.inc.php
r8250 r8254 32 32 $replacement = '<html xmlns:fb="http://www.facebook.com/2008/fbml" '; 33 33 34 $content = preg_replace('#'.$search.'#', $replacement, $content); 35 36 // Piwigo init 37 if ($conf['fbp']['async_script']) 38 { 39 // async method 40 $fbp_content = ' 41 <div id="fb-root"></div> 42 <script> 43 {literal} 44 window.fbAsyncInit = function() { 45 FB.init({ 46 appId : \''.FACEBOOK_APP_ID.'\', 47 status : true, // check login status 48 cookie : true, // enable cookies to allow the server to access the session 49 xfbml : true // parse XFBML 50 }); 51 }; 52 (function() { 53 var e = document.createElement(\'script\'); 54 {/literal} 55 e.src = document.location.protocol + \'//connect.facebook.net/{$LANGUAGE}/all.js\'; 56 {literal} 57 e.async = true; 58 document.getElementById(\'fb-root\').appendChild(e); 59 }()); 60 {/literal} 61 </script> 62 '; 63 } 64 else 65 { 66 // sync method 67 $fbp_content = ' 68 <div id="fb-root"></div> 69 <script src="http://connect.facebook.net/en_US/all.js"></script> 70 <script> 71 FB.init({ldelim} 72 appId : \''.FACEBOOK_APP_ID.'\', 73 status : true, // check login status 74 cookie : true, // enable cookies to allow the server to access the session 75 xfbml : true // parse XFBML 76 {rdelim}); 77 </script> 78 <script src="http://connect.facebook.net/{$LANGUAGE}/all.js#xfbml=1"></script> 79 '; 80 } 34 //~ $content = preg_replace('#'.$search.'#', $replacement, $content); 35 return preg_replace('#'.$search.'#', $replacement, $content); 36 //~ $fbp_content = file_get_contents(FBP_DIR.'/tpl/init.fb.tpl'); 81 37 82 38 $search = '<div id="the_page">'; … … 90 46 // set prefilter 91 47 $template->set_prefilter('header', 'fbp_header'); 92 }93 48 94 function fbp_bool2str($value) 95 { 96 return ($value ? 'true' : 'false'); 49 $template->assign('FACEBOOK_APP_ID', FACEBOOK_APP_ID); 50 // define language 51 $template->assign('LANGUAGE', $user['language']); 52 $template->assign('fbp', $conf['fbp']); 53 $template->smarty->register_modifier('boolean_to_string', 'boolean_to_string'); 54 55 $template->set_filename('init.fb', FBP_DIR.'/tpl/init.fb.tpl'); 56 $template->append('head_elements', $template->parse('init.fb', true)); 97 57 } 98 58 … … 109 69 if ($conf['fbp']['social_plugin_like_button']['enabled'] or $conf['fbp']['social_plugin_like_box']['enabled']) 110 70 { 111 // define language112 $template->assign('LANGUAGE', $user['language']);113 71 // define picture FB link 114 72 // Always use full url for FB social plugin … … 123 81 } 124 82 unset_make_full_url(); 125 //~ $template->assign('FBP_URL_PICTURE', $fbp_url_picture);83 $template->assign('fbp_url_picture', $fbp_url_picture); 126 84 //~ $template->assign('FBP_SOCIAL_PLUGIN_LIKE_BUTTON', $conf['fbp']['social_plugin_like_button']); 127 85 //~ $template->assign('FBP_SOCIAL_PLUGIN_LIKE_BOX', $conf['fbp']['social_plugin_like_box']); … … 136 94 if ($conf['fbp']['social_plugin_like_button']['enabled']) 137 95 { 138 $content .= ' 139 <div id="fb-xfbml"> 140 <fb:like href="'.$fbp_url_picture.'" layout="'.$conf['fbp']['social_plugin_like_button']['layout'].'" show_faces="'.fbp_bool2str($conf['fbp']['social_plugin_like_button']['show_faces']).'" width="'.@$current_picture['scaled_width'].'" action="'.$conf['fbp']['social_plugin_like_button']['action'].'" colorscheme="'.$conf['fbp']['social_plugin_like_button']['colorscheme'].'"></fb:like> 141 </div>'; 96 //~ $content .= ' 97 //~ <div id="fb-xfbml"> 98 //~ <fb:like href="'.$fbp_url_picture.'" layout="'.$conf['fbp']['social_plugin_like_button']['layout'].'" show_faces="'.boolean_to_string($conf['fbp']['social_plugin_like_button']['show_faces']).'" width="'.@$current_picture['scaled_width'].'" action="'.$conf['fbp']['social_plugin_like_button']['action'].'" colorscheme="'.$conf['fbp']['social_plugin_like_button']['colorscheme'].'"></fb:like> 99 //~ </div>'; 100 $template->set_filename('social.plugin.like.button', FBP_DIR.'/tpl/social.plugin.like.button.tpl'); 101 $content .= $template->parse('social.plugin.like.button', true); 142 102 } 143 103 if ($conf['fbp']['social_plugin_like_box']['enabled']) 144 104 { 145 $content .= ' 146 <div id="fb-xfbml"> 147 <fb:like-box href="'.$fbp_url_picture.'" width="'.@$current_picture['scaled_width'].'" show_faces="'.fbp_bool2str($conf['fbp']['social_plugin_like_box']['show_faces']).'" stream="'.fbp_bool2str($conf['fbp']['social_plugin_like_box']['stream']).'" header="'.fbp_bool2str($conf['fbp']['social_plugin_like_box']['header']).'"></fb:like-box> 148 </div>'; 105 //~ $content .= ' 106 //~ <div id="fb-xfbml"> 107 //~ <fb:like-box href="'.$fbp_url_picture.'" width="'.@$current_picture['scaled_width'].'" show_faces="'.boolean_to_string($conf['fbp']['social_plugin_like_box']['show_faces']).'" stream="'.boolean_to_string($conf['fbp']['social_plugin_like_box']['stream']).'" header="'.boolean_to_string($conf['fbp']['social_plugin_like_box']['header']).'"></fb:like-box> 108 //~ </div>'; 109 $template->set_filename('social.plugin.like.box', FBP_DIR.'/tpl/social.plugin.like.box.tpl'); 110 $content .= $template->parse('social.plugin.like.box', true); 149 111 } 150 112 -
extensions/FacebookPlug/Plugin/tpl/admin.config.tpl
r8250 r8254 119 119 <fieldset> 120 120 <ul> 121 <li>121 {* <li> 122 122 <label> 123 123 <span class="property">{'Asynchronous Facebook access'|@translate}</span> … … 125 125 </label> 126 126 </li> 127 127 *} 128 128 <li> 129 129 <label>
Note: See TracChangeset
for help on using the changeset viewer.