Changeset 8275


Ignore:
Timestamp:
Dec 24, 2010, 1:01:39 AM (13 years ago)
Author:
rub
Message:

Add css
Fix translations
Finish like box integration

Location:
extensions/FacebookPlug/Plugin
Files:
5 added
11 edited

Legend:

Unmodified
Added
Removed
  • extensions/FacebookPlug/Plugin/admin.config.php

    r8250 r8275  
    7474      // Like box
    7575      $conf['fbp']['social_plugin_like_box']['enabled'] = empty($_POST['FBP_SOCIAL_PLUGIN_LIKE_BOX_ENABLED']) ? false : true;
    76       $conf['fbp']['social_plugin_like_box']['url_type'] = $url_type[$_POST['FBP_SOCIAL_PLUGIN_LIKE_BOX_URL_TYPE']];
     76      $conf['fbp']['social_plugin_like_box']['url'] = $_POST['FBP_SOCIAL_PLUGIN_LIKE_BOX_URL'];
    7777      $conf['fbp']['social_plugin_like_box']['colorscheme'] = $colorscheme[$_POST['FBP_SOCIAL_PLUGIN_LIKE_BOX_COLORSCHEME']];
    7878      $conf['fbp']['social_plugin_like_box']['show_faces'] = empty($_POST['FBP_SOCIAL_PLUGIN_LIKE_BOX_SHOW_FACES']) ? false : true;
     
    101101  param = \'fbp\'
    102102;';
    103   pwg_query($query);
     103  if (pwg_query($query))
     104  {
     105    array_push($page['infos'], l10n('Data updated with success'));
     106  }
     107  else
     108  {
     109    array_push($page['errors'], l10n('Data updated with error'));
     110  }
    104111}
    105112
     
    130137            'FB_PAGE' => 'http://developers.facebook.com/docs/reference/plugins/like-box',
    131138            'ENABLED' => ($conf['fbp']['social_plugin_like_box']['enabled'] ? 'checked="checked"' : ''),
    132             'URL_TYPE_OPTIONS' => $url_type_l10n,
    133             'URL_TYPE_OPTIONS_SELECTED' => array_search($conf['fbp']['social_plugin_like_box']['url_type'], $url_type),
     139            'URL' => $conf['fbp']['social_plugin_like_box']['url'],
    134140            'COLORSCHEME_OPTIONS' => $colorscheme_l10n,
    135141            'COLORSCHEME_OPTIONS_SELECTED' => array_search($conf['fbp']['social_plugin_like_box']['colorscheme'], $colorscheme),
  • extensions/FacebookPlug/Plugin/include/admin.inc.php

    r8241 r8275  
    2424}
    2525
    26 
    2726function fbp_get_admin_plugin_menu_links($menu)
    2827{
  • extensions/FacebookPlug/Plugin/include/conf.inc.php

    r8254 r8275  
    2626global $conf;
    2727
    28 $conf['fbp'] = array_merge(
     28/*$conf['fbp'] = array_merge(
    2929  // default values
    3030  array
     
    5353  ),
    5454  unserialize($conf['fbp'])
    55   );
     55  );*/
     56
     57$conf['fbp'] = array_merge(
     58  // default values
     59  array
     60  (
     61    'allow_fb_access_private_page' => true,
     62    'async_script' => false,
     63    'social_plugin_like_button' => array(),
     64    'social_plugin_like_box' => array(),
     65  ),
     66  unserialize($conf['fbp']));
     67
     68$conf['fbp']['social_plugin_like_button'] = array_merge(
     69  // default values
     70  array
     71  (
     72    'enabled' => true,
     73    'url_type' => 'page',
     74    'layout' => 'standard',
     75    'show_faces' => true,
     76    'action' => 'like',
     77    'colorscheme' => 'dark',
     78    'width' => '',
     79  ),
     80  $conf['fbp']['social_plugin_like_button']);
     81
     82$conf['fbp']['social_plugin_like_box'] = array_merge(
     83  // default values
     84  array
     85  (
     86    'enabled' => false,
     87    'url' => 'http://www.facebook.com/Piwigo',
     88    'colorscheme' => 'dark',
     89    'show_faces' => true,
     90    'stream' => true,
     91    'header' => true,
     92    'width' => '210',
     93  ),
     94  $conf['fbp']['social_plugin_like_box']);
    5695
    5796//~ print_r($conf['fbp']);
  • extensions/FacebookPlug/Plugin/include/constants.inc.php

    r8241 r8275  
    2626define('FACEBOOK_APP_ID', '111499825588662');
    2727define('FBP_DIR', dirname(dirname(__FILE__)));
     28define('FBP_PATH' , PHPWG_PLUGINS_PATH.basename(FBP_DIR));
    2829define('FBP_IP_FB', '66.220.');
    2930
  • extensions/FacebookPlug/Plugin/include/picture.inc.php

    r8254 r8275  
    2424}
    2525
    26 function fbp_header($content, &$smarty)
     26include_once(FBP_DIR.'/include/common.inc.php');
     27include_once(FBP_DIR.'/include/header.inc.php');
     28
     29/*function fbp_header($content, &$smarty)
    2730{
    2831  global $conf;
     
    3841  $search = '<div id="the_page">';
    3942  return preg_replace('#'.$search.'#', $fbp_content.$search, $content);
    40 }
     43}*/
    4144
    42 function fbp_loc_begin_picture()
     45/*function fbp_loc_begin_picture()
    4346{
    4447  global $template, $user, $page, $conf, $picture;
     
    5558  $template->set_filename('init.fb', FBP_DIR.'/tpl/init.fb.tpl');
    5659  $template->append('head_elements', $template->parse('init.fb', true));
    57 }
     60}*/
    5861
    5962function fbp_render_element_content($content, $current_picture)
     
    6770  }
    6871
    69   if ($conf['fbp']['social_plugin_like_button']['enabled'] or $conf['fbp']['social_plugin_like_box']['enabled'])
     72  // define picture FB link
     73  // Always use full url for FB social plugin
     74  set_make_full_url();
     75  if ($conf['fbp']['social_plugin_like_button']['url_type'] == 'image')
    7076  {
    71     // define picture FB link
    72     // Always use full url for FB social plugin
    73     set_make_full_url();
    74     if ($conf['fbp']['social_plugin_like_button']['url_type'] == 'image')
    75     {
    76       $fbp_url_picture = get_element_url($current_picture);
    77     }
    78     else
    79     {
    80       $fbp_url_picture = make_picture_url(array('image_id' => $page['image_id']));
    81     }
    82     unset_make_full_url();
    83     $template->assign('fbp_url_picture', $fbp_url_picture);
    84     //~ $template->assign('FBP_SOCIAL_PLUGIN_LIKE_BUTTON', $conf['fbp']['social_plugin_like_button']);
    85     //~ $template->assign('FBP_SOCIAL_PLUGIN_LIKE_BOX', $conf['fbp']['social_plugin_like_box']);
     77    $fbp_url_picture = get_element_url($current_picture);
     78  }
     79  else
     80  {
     81    $fbp_url_picture = make_picture_url(array('image_id' => $page['image_id']));
     82  }
     83  unset_make_full_url();
     84  $template->assign('fbp_url_picture', $fbp_url_picture);
    8685
    87      // iframe implementation
    88     /*  $$content = '
    89     <iframe src="http://www.facebook.com/plugins/like.php?href={$SRC_IMG}&amp;layout=standard&amp;show_faces=true&amp;width={$WIDTH_IMG}&amp;action=like&amp;colorscheme=light&amp;height=80" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:{$WIDTH_IMG}px; height:80px;" allowTransparency="true"></iframe>
    90     ';*/
    91     // XFBML implementation
     86  // XFBML implementation
     87  //~ $content .= '
     88//~ <div id="fb-xfbml">';
     89  if ($conf['fbp']['social_plugin_like_button']['enabled'])
     90  {
    9291    //~ $content .= '
    93 //~ <div id="fb-xfbml">';
    94     if ($conf['fbp']['social_plugin_like_button']['enabled'])
    95     {
    96       //~ $content .= '
    9792//~ <div id="fb-xfbml">
    9893//~ <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>
    9994//~ </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);
    102     }
    103     if ($conf['fbp']['social_plugin_like_box']['enabled'])
    104     {
    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);
    111     }
    112 
    113     //~ $content .= '
    114 //~ </div>';
    115 }
     95    $template->set_filename('social.plugin.like.button', FBP_DIR.'/tpl/social.plugin.like.button.tpl');
     96    $content .= $template->parse('social.plugin.like.button', true);
     97  }
    11698
    11799  return $content;
     
    122104  global $conf;
    123105
    124   if ($conf['fbp']['social_plugin_like_button']['enabled'] or $conf['fbp']['social_plugin_like_box']['enabled'])
     106  if ($conf['fbp']['social_plugin_like_button']['enabled'])
    125107  {
    126108    if ($conf['fbp']['allow_fb_access_private_page'])
     
    143125}
    144126
    145 if ($conf['fbp']['social_plugin_like_button']['enabled'] or $conf['fbp']['social_plugin_like_box']['enabled'])
     127if ($conf['fbp']['social_plugin_like_button']['enabled'])
    146128{
    147   add_event_handler('loc_begin_picture', 'fbp_loc_begin_picture');
     129  //~ add_event_handler('loc_begin_picture', 'fbp_loc_begin_picture');
    148130  add_event_handler('render_element_content', 'fbp_render_element_content', EVENT_HANDLER_PRIORITY_NEUTRAL+1 /*in order to have picture content*/, 2);
    149131  //~ add_event_handler('loc_end_picture', 'fbp_loc_end_picture');
  • extensions/FacebookPlug/Plugin/language/en_UK/plugin.lang.php

    r8250 r8275  
    2323}
    2424
     25// English
    2526$lang['page'] = 'page';
    2627$lang['image'] = 'image';
     
    4041$lang['URL type'] = 'URL type';
    4142$lang['Layout style'] = 'Layout style';
    42 $lang['Show faces'] = 'Voir les faces';
    43 $lang['Verb to display'] = 'Texte à afficher';
    44 $lang['Color scheme'] = 'Jeu de couleurs';
     43$lang['Show faces'] = 'Show faces';
     44$lang['Verb to display'] = 'Verb to display';
     45$lang['Color scheme'] = 'Color scheme';
    4546$lang['Like box'] = 'Like box';
    4647$lang['Show stream'] = 'Show stream';
    4748$lang['Show header'] = 'Show header';
     49$lang['Facebook Page URL'] = 'Facebook Page URL';
     50$lang['on picture pages'] = 'on picture pages';
     51$lang['on main pages'] = 'on main pages';
     52$lang['Data updated with success'] = 'Data updated with success';
     53$lang['Data updated with error'] = 'Data updated with error';
    4854
    4955?>
  • extensions/FacebookPlug/Plugin/language/fr_FR/plugin.lang.php

    r8250 r8275  
    2323}
    2424
     25// Français
    2526$lang['page'] = 'page';
    2627$lang['image'] = 'image';
     
    3536$lang['Advanced'] = 'Avancé';
    3637$lang['Asynchronous Facebook access'] = 'Accès asynchrone à Facebook';
    37 $lang['Allow Facebook to see private page (recommended)'] = 'Permettre à Facebook de voir les pages privées (recommendé)';
     38$lang['Allow Facebook to see private page (recommended)'] = 'Permettre à Facebook de voir les pages privées (recommandé)';
    3839$lang['Like button'] = 'Bouton "J\'aime"';
    3940$lang['Enabled'] = 'Activé';
    4041$lang['URL type'] = 'Type d\'URL';
    4142$lang['Layout style'] = 'Style d\'affichage';
    42 $lang['Show faces'] = 'Show face';
    43 $lang['Verb to display'] = 'Verb to display';
    44 $lang['Color scheme'] = 'Color scheme';
     43$lang['Show faces'] = 'Voir les faces';
     44$lang['Verb to display'] = 'Texte à afficher';
     45$lang['Color scheme'] = 'Jeu de couleurs';
    4546$lang['Like box'] = 'Boite "J\'aime"';
    4647$lang['Show stream'] = 'Voir le flux';
    4748$lang['Show header'] = 'Voir l\'entête';
    48 //~ $lang[''] = '';
    49 //~ $lang[''] = '';
     49$lang['Facebook Page URL'] = 'URL de la page Facebook';
     50$lang['on picture pages'] = 'sur les pages d\'images';
     51$lang['on main pages'] = 'sur les pages principales';
     52$lang['Data updated with success'] = 'Données mises à jour avec succès';
     53$lang['Data updated with error'] = 'Données mises à jour avec erreur';
    5054//~ $lang[''] = '';
    5155
  • extensions/FacebookPlug/Plugin/main.inc.php

    r8241 r8275  
    3838  include_once(FBP_DIR.'/include/picture.inc.php');
    3939}
     40else if (script_basename() == 'index')
     41{
     42  include_once(dirname(__FILE__).'/include/common.inc.php');
     43  include_once(FBP_DIR.'/include/index.inc.php');
     44}
    4045else
    4146if (script_basename() == 'admin')
  • extensions/FacebookPlug/Plugin/tpl/admin.config.tpl

    r8254 r8275  
    99<fieldset>
    1010  <ul>
    11     <h3><a href="{$social_plugin.like_button.FB_PAGE}" onclick="window.open(this.href); return false;">{'Like button'|@translate}</a></h3>
     11    <h3><a href="{$social_plugin.like_button.FB_PAGE}" onclick="window.open(this.href); return false;">{'Like button'|@translate}</a> {'on picture pages'|@translate}</h3>
    1212    <li>
    1313      <label>
     
    6868<fieldset>
    6969  <ul>
    70     <h3><a href="{$social_plugin.like_box.FB_PAGE}" onclick="window.open(this.href); return false;">{'Like box'|@translate}</a></h3>
     70    <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>
    7171    <li>
    7272      <label>
     
    7979      <li>
    8080        <label>
    81           <span class="property">{'URL type'|@translate}</span>
    82           <select name="FBP_SOCIAL_PLUGIN_LIKE_BOX_URL_TYPE" size="1">
    83             {html_options options=$social_plugin.like_box.URL_TYPE_OPTIONS selected=$social_plugin.like_box.URL_TYPE_OPTIONS_SELECTED}
    84           </select>
     81          <span class="property">{'Facebook Page URL'|@translate}</span>
     82          <input type="text" size="79" name="FBP_SOCIAL_PLUGIN_LIKE_BOX_URL" value="{$social_plugin.like_box.URL}" />
    8583        </label>
    8684      </li>
  • extensions/FacebookPlug/Plugin/tpl/social.plugin.like.box.tpl

    r8254 r8275  
    1 <div id="fb-xfbml-like-box">
    2 <fb:like-box href="{$fbp.social_plugin_like_box.url}" {*width="???"*} show_faces="{$fbp.social_plugin_like_box.show_faces|@boolean_to_string}" stream="{$fbp.social_plugin_like_box.stream|@boolean_to_string}" header="{$fbp.social_plugin_like_box.header|@boolean_to_string}"></fb:like-box>
    3 </div>
     1<dd>
     2  <ul>
     3    <div id="fb-xfbml-like-box">
     4    <fb:like-box href="{$fbp.social_plugin_like_box.url}" width="{$fbp.social_plugin_like_box.width}" show_faces="{$fbp.social_plugin_like_box.show_faces|@boolean_to_string}" stream="{$fbp.social_plugin_like_box.stream|@boolean_to_string}" header="{$fbp.social_plugin_like_box.header|@boolean_to_string}" colorscheme="{$fbp.social_plugin_like_box.colorscheme}"></fb:like-box>
     5    </div>
     6  </ul>
     7</dd>
  • extensions/FacebookPlug/Plugin/tpl/social.plugin.like.button.tpl

    r8254 r8275  
    1 <div id="fb-xfbml-like">
    2 <fb:like href="{$fbp_url_picture}" layout="{$fbp.social_plugin_like_button.layout}" show_faces="{$fbp.social_plugin_like_button.show_faces|@boolean_to_string}" {*width="{$WIDTH_IMG}"*} action="{$fbp.social_plugin_like_button.action}" colorscheme="{$fbp.social_plugin_like_button.colorscheme}"></fb:like>
     1<div id="fb-xfbml-like-button">
     2<fb:like href="{$fbp_url_picture}" width="{$fbp.social_plugin_like_button.width}" layout="{$fbp.social_plugin_like_button.layout}" show_faces="{$fbp.social_plugin_like_button.show_faces|@boolean_to_string}" {*width="{$WIDTH_IMG}"*} action="{$fbp.social_plugin_like_button.action}" colorscheme="{$fbp.social_plugin_like_button.colorscheme}"></fb:like>
    33</div>
Note: See TracChangeset for help on using the changeset viewer.