Changeset 8295
- Timestamp:
- Dec 24, 2010, 6:00:49 PM (10 years ago)
- Location:
- extensions/FacebookPlug/Plugin
- Files:
-
- 1 added
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
extensions/FacebookPlug/Plugin/admin.config.php
r8282 r8295 38 38 // Data 39 39 $base_url = get_admin_plugin_menu_link(__FILE__); 40 $ url_type = array('page', 'image');41 $ url_type_l10n = array_map('l10n', $url_type);40 $picture_url_type = array('page', 'image'); 41 $picture_url_type_l10n = array_map('l10n', $picture_url_type); 42 42 $layout = array('standard', 'button_count', 'box_count'); 43 43 $layout_l10n = array_map('l10n', $layout); … … 67 67 // Like button 68 68 $conf['fbp']['social_plugin_like_button']['enabled'] = empty($_POST['FBP_SOCIAL_PLUGIN_LIKE_BUTTON_ENABLED']) ? false : true; 69 $conf['fbp']['social_plugin_like_button']['url_type'] = $url_type[$_POST['FBP_SOCIAL_PLUGIN_LIKE_BUTTON_URL_TYPE']];70 69 $conf['fbp']['social_plugin_like_button']['layout'] = $layout[$_POST['FBP_SOCIAL_PLUGIN_LIKE_BUTTON_LAYOUT']]; 71 70 $conf['fbp']['social_plugin_like_button']['show_faces'] = empty($_POST['FBP_SOCIAL_PLUGIN_LIKE_BUTTON_SHOW_FACES']) ? false : true; … … 75 74 $conf['fbp']['social_plugin_facepile']['enabled'] = empty($_POST['FBP_SOCIAL_PLUGIN_FACEPILE_ENABLED']) ? false : true; 76 75 $conf['fbp']['social_plugin_facepile']['max_rows'] = intval($_POST['FBP_SOCIAL_PLUGIN_FACEPILE_MAX_ROWS']); 76 // Comments 77 $conf['fbp']['social_plugin_comments']['enabled'] = empty($_POST['FBP_SOCIAL_PLUGIN_COMMENTS_ENABLED']) ? false : true; 78 $conf['fbp']['social_plugin_comments']['numposts'] = intval($_POST['FBP_SOCIAL_PLUGIN_COMMENTS_NUMPOSTS']); 79 $conf['fbp']['social_plugin_comments']['title'] = $_POST['FBP_SOCIAL_PLUGIN_COMMENTS_TITLE']; 80 $conf['fbp']['social_plugin_comments']['simple'] = empty($_POST['FBP_SOCIAL_PLUGIN_COMMENTS_SIMPLE']) ? false : true; 81 $conf['fbp']['social_plugin_comments']['reverse'] = empty($_POST['FBP_SOCIAL_PLUGIN_COMMENTS_REVERSE']) ? false : true; 82 $conf['fbp']['social_plugin_comments']['publish_feed'] = empty($_POST['FBP_SOCIAL_PLUGIN_COMMENTS_PUBLISH_FEED']) ? false : true; 77 83 // Like box 78 84 $conf['fbp']['social_plugin_like_box']['enabled'] = empty($_POST['FBP_SOCIAL_PLUGIN_LIKE_BOX_ENABLED']) ? false : true; … … 88 94 { 89 95 $conf['fbp']['async_script'] = empty($_POST['FBP_ASYNC_SCRIPT']) ? false : true; 96 $conf['fbp']['picture_url_type'] = $picture_url_type[$_POST['FBP_PICTURE_URL_TYPE']]; 90 97 $conf['fbp']['allow_fb_access_private_page'] = empty($_POST['FBP_ALLOW_FB_ACCESS_PRIVATE_PAGE']) ? false : true; 91 98 break; … … 122 129 'FB_PAGE' => 'http://developers.facebook.com/docs/reference/plugins/like/', 123 130 'ENABLED' => ($conf['fbp']['social_plugin_like_button']['enabled'] ? 'checked="checked"' : ''), 124 'URL_TYPE_OPTIONS' => $url_type_l10n,125 'URL_TYPE_OPTIONS_SELECTED' => array_search($conf['fbp']['social_plugin_like_button']['url_type'], $url_type),126 131 'LAYOUT_OPTIONS' => $layout_l10n, 127 132 'LAYOUT_OPTIONS_SELECTED' => array_search($conf['fbp']['social_plugin_like_button']['layout'], $layout), … … 137 142 'ENABLED' => ($conf['fbp']['social_plugin_facepile']['enabled'] ? 'checked="checked"' : ''), 138 143 'MAX_ROWS' => $conf['fbp']['social_plugin_facepile']['max_rows'], 144 ), 145 'comments' => array 146 ( 147 'FB_PAGE' => 'http://developers.facebook.com/docs/reference/plugins/comments/', 148 'ENABLED' => ($conf['fbp']['social_plugin_comments']['enabled'] ? 'checked="checked"' : ''), 149 'NUMPOSTS' => $conf['fbp']['social_plugin_comments']['numposts'], 150 'TITLE' => $conf['fbp']['social_plugin_comments']['title'], 151 'SIMPLE' => ($conf['fbp']['social_plugin_comments']['simple'] ? 'checked="checked"' : ''), 152 'REVERSE' => ($conf['fbp']['social_plugin_comments']['reverse'] ? 'checked="checked"' : ''), 153 'PUBLISH_FEED' => ($conf['fbp']['social_plugin_comments']['publish_feed'] ? 'checked="checked"' : ''), 139 154 ), 140 155 'like_box' => array … … 158 173 array( 159 174 'FBP_ASYNC_SCRIPT'=> ($conf['fbp']['async_script'] ? 'checked="checked"' : ''), 175 'FBP_PICTURE_URL_TYPE_OPTIONS' => $picture_url_type_l10n, 176 'FBP_PICTURE_URL_TYPE_OPTIONS_SELECTED' => array_search($conf['fbp']['picture_url_type'], $picture_url_type), 160 177 'FBP_ALLOW_FB_ACCESS_PRIVATE_PAGE'=> ($conf['fbp']['allow_fb_access_private_page'] ? 'checked="checked"' : ''), 161 178 )); -
extensions/FacebookPlug/Plugin/include/conf.inc.php
r8282 r8295 30 30 array 31 31 ( 32 'async_script' => false, 33 'picture_url_type' => 'page', 32 34 'allow_fb_access_private_page' => true, 33 'async_script' => false,34 35 'social_plugin_like_button' => array(), 36 'social_plugin_facepile' => array(), 37 'social_plugin_comments' => array(), 35 38 'social_plugin_like_box' => array(), 36 'social_plugin_facepile' => array(),37 39 ), 38 40 unserialize($conf['fbp'])); … … 43 45 ( 44 46 'enabled' => true, 45 'url_type' => 'page',46 47 'layout' => 'standard', 47 48 'show_faces' => true, … … 51 52 ), 52 53 $conf['fbp']['social_plugin_like_button']); 54 55 $conf['fbp']['social_plugin_facepile'] = array_merge( 56 // default values 57 array 58 ( 59 'enabled' => true, 60 'max_rows' => 1, 61 'width' => null, 62 ), 63 $conf['fbp']['social_plugin_facepile']); 64 65 $conf['fbp']['social_plugin_comments'] = array_merge( 66 // default values 67 array 68 ( 69 'enabled' => false, 70 'numposts' => 5, 71 'css' => null, 72 'title' => null, 73 'simple' => true, 74 'reverse' => false, 75 'publish_feed' => true, 76 'width' => null, 77 ), 78 $conf['fbp']['social_plugin_comments']); 53 79 54 80 $conf['fbp']['social_plugin_like_box'] = array_merge( … … 66 92 $conf['fbp']['social_plugin_like_box']); 67 93 68 $conf['fbp']['social_plugin_facepile'] = array_merge(69 // default values70 array71 (72 'enabled' => true,73 //'url_type' => 'page',74 'max_rows' => 1,75 'width' => null,76 ),77 $conf['fbp']['social_plugin_facepile']);78 79 // Same value of like button80 $conf['fbp']['social_plugin_facepile']['url_type'] = $conf['fbp']['social_plugin_like_button']['url_type'];81 82 94 //~ print_r($conf['fbp']); 83 95 -
extensions/FacebookPlug/Plugin/include/picture.inc.php
r8282 r8295 34 34 { 35 35 $tpl = 'social.plugin.facepile'; 36 $type = $conf['fbp']['social_plugin_facepile']['url_type'];37 36 } 38 37 else if ($conf['fbp']['social_plugin_like_button']['enabled']) 39 38 { 40 39 $tpl = 'social.plugin.like.button'; 41 $type = $conf['fbp']['social_plugin_like_button']['url_type']; 40 } 41 else if ($conf['fbp']['social_plugin_comments']['enabled']) 42 { 43 $tpl = 'social.plugin.comments'; 42 44 } 43 45 else … … 50 52 // Always use full url for FB social plugin 51 53 set_make_full_url(); 52 if ($ type== 'image')54 if ($conf['fbp']['picture_url_type'] == 'image') 53 55 { 54 56 $fbp_url_picture = get_element_url($current_picture); … … 60 62 unset_make_full_url(); 61 63 $template->assign('fbp_url_picture', $fbp_url_picture); 64 $template->assign('fbp_urlencode_picture', urlencode($fbp_url_picture)); 62 65 63 66 // XFBML implementation … … 72 75 global $conf; 73 76 74 if ($conf['fbp']['social_plugin_like_button']['enabled'] )77 if ($conf['fbp']['social_plugin_like_button']['enabled'] or $conf['fbp']['social_plugin_comments']['enabled']) 75 78 { 76 79 if ($conf['fbp']['allow_fb_access_private_page']) … … 93 96 } 94 97 95 if ($conf['fbp']['social_plugin_like_button']['enabled'] or $conf['fbp']['social_plugin_facepile']['enabled'] )98 if ($conf['fbp']['social_plugin_like_button']['enabled'] or $conf['fbp']['social_plugin_facepile']['enabled'] or $conf['fbp']['social_plugin_comments']['enabled']) 96 99 { 97 100 //~ add_event_handler('loc_begin_picture', 'fbp_loc_begin_picture'); -
extensions/FacebookPlug/Plugin/language/en_UK/plugin.lang.php
r8282 r8295 40 40 $lang['Like button'] = 'Like button'; 41 41 $lang['Enabled'] = 'Enabled'; 42 $lang[' URL type'] = 'URL type';42 $lang['Picture URL type'] = 'Picture URL type'; 43 43 $lang['Layout style'] = 'Layout style'; 44 44 $lang['Show faces'] = 'Show faces'; … … 53 53 $lang['Data updated with success'] = 'Data updated with success'; 54 54 $lang['Data updated with error'] = 'Data updated with error'; 55 56 55 $lang['Facepile'] = 'Facepile'; 57 56 $lang['on slideshow pages'] = 'on slideshow pages'; 58 57 $lang['Num rows'] = 'Num rows'; 59 $lang[''] = ''; 60 $lang[''] = ''; 61 $lang[''] = ''; 62 $lang[''] = ''; 63 $lang[''] = ''; 64 $lang[''] = ''; 65 $lang[''] = ''; 66 $lang[''] = ''; 67 $lang[''] = ''; 68 $lang[''] = ''; 69 $lang[''] = ''; 70 $lang[''] = ''; 71 $lang[''] = ''; 72 $lang[''] = ''; 73 $lang[''] = ''; 74 $lang[''] = ''; 58 $lang['Comments'] = 'Comments'; 59 $lang['Num posts'] = 'Num posts'; 60 $lang['Title'] = 'Title'; 61 $lang['Simple'] = 'Simple'; 62 $lang['Reverse'] = 'Reverse'; 63 $lang['Publish feed'] = 'Publish feed'; 64 //~ $lang[''] = ''; 75 65 76 66 ?> -
extensions/FacebookPlug/Plugin/language/fr_FR/plugin.lang.php
r8282 r8295 40 40 $lang['Like button'] = 'Bouton "J\'aime"'; 41 41 $lang['Enabled'] = 'Activé'; 42 $lang[' URL type'] = 'Type d\'URL';42 $lang['Picture URL type'] = 'Type d\'URL pour les images'; 43 43 $lang['Layout style'] = 'Style d\'affichage'; 44 44 $lang['Show faces'] = 'Voir les faces'; … … 56 56 $lang['on slideshow pages'] = 'sur les diaporamas'; 57 57 $lang['Num rows'] = 'Nombre de lignes'; 58 $lang['Comments'] = 'Commentaires'; 59 $lang['Num posts'] = 'Nombre de commentaires affichés'; 60 $lang['Title'] = 'Titre'; 61 $lang['Simple'] = 'Simple'; 62 $lang['Reverse'] = 'Ordre inversé'; 63 $lang['Publish feed'] = 'Publier les commentaires'; 58 64 59 65 ?> -
extensions/FacebookPlug/Plugin/tpl/admin.config.tpl
r8282 r8295 20 20 <li> 21 21 <label> 22 <span class="property">{'URL type'|@translate}</span>23 <select name="FBP_SOCIAL_PLUGIN_LIKE_BUTTON_URL_TYPE" size="1">24 {html_options options=$social_plugin.like_button.URL_TYPE_OPTIONS selected=$social_plugin.like_button.URL_TYPE_OPTIONS_SELECTED}25 </select>26 </label>27 </li>28 <li>29 <label>30 22 <span class="property">{'Layout style'|@translate}</span> 31 23 <select name="FBP_SOCIAL_PLUGIN_LIKE_BUTTON_LAYOUT" size="1"> … … 83 75 <fieldset> 84 76 <ul> 77 <h3><a href="{$social_plugin.comments.FB_PAGE}" onclick="window.open(this.href); return false;">{'Comments'|@translate}</a> {'on picture pages'|@translate}</h3> 78 <li> 79 <label> 80 <span class="property">{'Enabled'|@translate}</span> 81 <input type="checkbox" name="FBP_SOCIAL_PLUGIN_COMMENTS_ENABLED" {$social_plugin.comments.ENABLED} /> 82 </label> 83 </li> 84 85 <div id='comments'> 86 <li> 87 <label> 88 <span class="property">{'Num posts'|@translate}</span> 89 <input type="text" size="3" maxlength="4" name="FBP_SOCIAL_PLUGIN_COMMENTS_NUMPOSTS" value="{$social_plugin.comments.NUMPOSTS}" /> 90 </label> 91 </li> 92 <li> 93 <label> 94 <span class="property">{'Title'|@translate}</span> 95 <input type="text" size="39" name="FBP_SOCIAL_PLUGIN_COMMENTS_TITLE" value="{$social_plugin.comments.TITLE}" /> 96 </label> 97 </li> 98 <li> 99 <label> 100 <span class="property">{'Simple'|@translate}</span> 101 <input type="checkbox" name="FBP_SOCIAL_PLUGIN_COMMENTS_SIMPLE" {$social_plugin.comments.SIMPLE} /> 102 </label> 103 </li> 104 <li> 105 <label> 106 <span class="property">{'Reverse'|@translate}</span> 107 <input type="checkbox" name="FBP_SOCIAL_PLUGIN_COMMENTS_REVERSE" {$social_plugin.comments.REVERSE} /> 108 </label> 109 </li> 110 <li> 111 <label> 112 <span class="property">{'Publish feed'|@translate}</span> 113 <input type="checkbox" name="FBP_SOCIAL_PLUGIN_COMMENTS_PUBLISH_FEED" {$social_plugin.comments.PUBLISH_FEED} /> 114 </label> 115 </li> 116 </div> 117 </ul> 118 </fieldset> 119 120 <fieldset> 121 <ul> 85 122 <h3><a href="{$social_plugin.like_box.FB_PAGE}" onclick="window.open(this.href); return false;">{'Like box'|@translate}</a> {'on main pages'|@translate}</h3> 86 123 <li> … … 139 176 </li> 140 177 *} 178 <li> 179 <label> 180 <span class="property">{'Picture URL type'|@translate}</span> 181 <select name="FBP_PICTURE_URL_TYPE" size="1"> 182 {html_options options=$advanced.FBP_PICTURE_URL_TYPE_OPTIONS selected=$advanced.FBP_PICTURE_URL_TYPE_OPTIONS_SELECTED} 183 </select> 184 </label> 185 </li> 141 186 <li> 142 187 <label> … … 188 233 init_checkbox("FBP_SOCIAL_PLUGIN_LIKE_BUTTON_ENABLED", "like_button"); 189 234 init_checkbox("FBP_SOCIAL_PLUGIN_FACEPILE_ENABLED", "facepile"); 235 init_checkbox("FBP_SOCIAL_PLUGIN_COMMENTS_ENABLED", "comments"); 190 236 init_checkbox("FBP_SOCIAL_PLUGIN_LIKE_BOX_ENABLED", "like_box"); 191 237 }); -
extensions/FacebookPlug/Plugin/tpl/init.fb.tpl
r8283 r8295 1 <!-- By FacebookPlug a Piwigo Plugin --> 1 2 {if $fbp.async_script} 2 3 <div id="fb-root"></div> … … 12 13 (function() {ldelim} 13 14 var e = document.createElement(script); 14 e.src = document.location.protocol + //connect.facebook.net/{$LANGUAGE}/all.js ;15 e.src = document.location.protocol + //connect.facebook.net/{$LANGUAGE}/all.js#appId={$FACEBOOK_APP_ID}&xfbml=1; 15 16 e.async = true; 16 17 document.getElementById(fb-root).appendChild(e); … … 19 20 {else} 20 21 <div id="fb-root"></div> 21 <script src="http://connect.facebook.net/{$LANGUAGE}/all.js# xfbml=1"></script>22 <script src="http://connect.facebook.net/{$LANGUAGE}/all.js#appId={$FACEBOOK_APP_ID}&xfbml=1"></script> 22 23 <script> 23 24 FB.init({ldelim}
Note: See TracChangeset
for help on using the changeset viewer.