Changeset 8282


Ignore:
Timestamp:
Dec 24, 2010, 1:46:18 PM (10 years ago)
Author:
rub
Message:

Add facepile

Location:
extensions/FacebookPlug/Plugin
Files:
1 added
7 edited

Legend:

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

    r8275 r8282  
    5050$tabsheet = new tabsheet();
    5151$tabsheet->add('social_plugin',
    52                l10n('Social plugin'),
     52               l10n('Social plugins'),
    5353               add_url_params($base_url, array('tab' => 'social_plugin')));
    5454$tabsheet->add('advanced',
     
    7272      $conf['fbp']['social_plugin_like_button']['action'] = $action[$_POST['FBP_SOCIAL_PLUGIN_LIKE_BUTTON_ACTION']];
    7373      $conf['fbp']['social_plugin_like_button']['colorscheme'] = $colorscheme[$_POST['FBP_SOCIAL_PLUGIN_LIKE_BUTTON_COLORSCHEME']];
     74      // Facepile
     75      $conf['fbp']['social_plugin_facepile']['enabled'] = empty($_POST['FBP_SOCIAL_PLUGIN_FACEPILE_ENABLED']) ? false : true;
     76      $conf['fbp']['social_plugin_facepile']['max_rows'] = intval($_POST['FBP_SOCIAL_PLUGIN_FACEPILE_MAX_ROWS']);
    7477      // Like box
    7578      $conf['fbp']['social_plugin_like_box']['enabled'] = empty($_POST['FBP_SOCIAL_PLUGIN_LIKE_BOX_ENABLED']) ? false : true;
     
    8689      $conf['fbp']['async_script'] = empty($_POST['FBP_ASYNC_SCRIPT']) ? false : true;
    8790      $conf['fbp']['allow_fb_access_private_page'] = empty($_POST['FBP_ALLOW_FB_ACCESS_PRIVATE_PAGE']) ? false : true;
    88     //~ if (isset($_POST['fbp_day_number']))
    89     //~ {
    90       //~ $conf['fbp']['day_number'] = $_POST['fbp_day_number'];
    91     //~ }
    9291      break;
    9392    }
     
    121120        'like_button' => array
    122121          (
    123             'FB_PAGE' => 'http://developers.facebook.com/docs/reference/plugins/like',
     122            'FB_PAGE' => 'http://developers.facebook.com/docs/reference/plugins/like/',
    124123            'ENABLED' => ($conf['fbp']['social_plugin_like_button']['enabled'] ? 'checked="checked"' : ''),
    125124            'URL_TYPE_OPTIONS' => $url_type_l10n,
     
    133132            'COLORSCHEME_OPTIONS_SELECTED' => array_search($conf['fbp']['social_plugin_like_button']['colorscheme'], $colorscheme),
    134133          ),
     134       'facepile' => array
     135          (
     136            'FB_PAGE' => 'http://developers.facebook.com/docs/reference/plugins/facepile/',
     137            'ENABLED' => ($conf['fbp']['social_plugin_facepile']['enabled'] ? 'checked="checked"' : ''),
     138            'MAX_ROWS' => $conf['fbp']['social_plugin_facepile']['max_rows'],
     139          ),
    135140       'like_box' => array
    136141          (
    137             'FB_PAGE' => 'http://developers.facebook.com/docs/reference/plugins/like-box',
     142            'FB_PAGE' => 'http://developers.facebook.com/docs/reference/plugins/like-box/',
    138143            'ENABLED' => ($conf['fbp']['social_plugin_like_box']['enabled'] ? 'checked="checked"' : ''),
    139144            'URL' => $conf['fbp']['social_plugin_like_box']['url'],
  • extensions/FacebookPlug/Plugin/include/conf.inc.php

    r8275 r8282  
    2626global $conf;
    2727
    28 /*$conf['fbp'] = array_merge(
    29   // default values
    30   array
    31   (
    32     'allow_fb_access_private_page' => true,
    33     'async_script' => false,
    34     'social_plugin_like_button' => array
    35       (
    36         'enabled' => true,
    37         'url_type' => 'page',
    38         'layout' => 'standard',
    39         'show_faces' => true,
    40         'action' => 'like',
    41         'colorscheme' => 'dark',
    42       ),
    43     'social_plugin_like_box' => array
    44       (
    45         'enabled' => false,
    46         'url' => 'http://www.facebook.com/Piwigo',
    47         'url_type' => 'page',
    48         'colorscheme' => 'dark',
    49         'show_faces' => true,
    50         'stream' => true,
    51         'header' => true,
    52       ),
    53   ),
    54   unserialize($conf['fbp'])
    55   );*/
    56 
    5728$conf['fbp'] = array_merge(
    5829  // default values
     
    6334    'social_plugin_like_button' => array(),
    6435    'social_plugin_like_box' => array(),
     36    'social_plugin_facepile' => array(),
    6537  ),
    6638  unserialize($conf['fbp']));
     
    7648    'action' => 'like',
    7749    'colorscheme' => 'dark',
    78     'width' => '',
     50    'width' => null,
    7951  ),
    8052  $conf['fbp']['social_plugin_like_button']);
     
    9062    'stream' => true,
    9163    'header' => true,
    92     'width' => '210',
     64    'width' => 210,
    9365  ),
    9466  $conf['fbp']['social_plugin_like_box']);
     67
     68$conf['fbp']['social_plugin_facepile'] = array_merge(
     69  // default values
     70  array
     71  (
     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 button
     80$conf['fbp']['social_plugin_facepile']['url_type'] = $conf['fbp']['social_plugin_like_button']['url_type'];
    9581
    9682//~ print_r($conf['fbp']);
  • extensions/FacebookPlug/Plugin/include/picture.inc.php

    r8275 r8282  
    2727include_once(FBP_DIR.'/include/header.inc.php');
    2828
    29 /*function fbp_header($content, &$smarty)
    30 {
    31   global $conf;
    32 
    33   // replace tag html
    34   $search = '<html ';
    35   $replacement = '<html xmlns:fb="http://www.facebook.com/2008/fbml" ';
    36 
    37   //~ $content = preg_replace('#'.$search.'#', $replacement, $content);
    38   return preg_replace('#'.$search.'#', $replacement, $content);
    39   //~ $fbp_content = file_get_contents(FBP_DIR.'/tpl/init.fb.tpl');
    40 
    41   $search = '<div id="the_page">';
    42   return preg_replace('#'.$search.'#', $fbp_content.$search, $content);
    43 }*/
    44 
    45 /*function fbp_loc_begin_picture()
    46 {
    47   global $template, $user, $page, $conf, $picture;
    48 
    49   // set prefilter
    50   $template->set_prefilter('header', 'fbp_header');
    51 
    52   $template->assign('FACEBOOK_APP_ID', FACEBOOK_APP_ID);
    53   // define language
    54   $template->assign('LANGUAGE', $user['language']);
    55   $template->assign('fbp', $conf['fbp']);
    56   $template->smarty->register_modifier('boolean_to_string', 'boolean_to_string');
    57 
    58   $template->set_filename('init.fb', FBP_DIR.'/tpl/init.fb.tpl');
    59   $template->append('head_elements', $template->parse('init.fb', true));
    60 }*/
    61 
    6229function fbp_render_element_content($content, $current_picture)
    6330{
    6431  global $template, $user, $page, $conf, $picture;
    6532
    66   if ($page['slideshow'])
     33  if ($page['slideshow'] and $conf['fbp']['social_plugin_facepile']['enabled'])
    6734  {
    68     // nothing to do on slideshow other media aren't usable
     35    $tpl = 'social.plugin.facepile';
     36    $type = $conf['fbp']['social_plugin_facepile']['url_type'];
     37  }
     38  else if ($conf['fbp']['social_plugin_like_button']['enabled'])
     39  {
     40    $tpl = 'social.plugin.like.button';
     41    $type = $conf['fbp']['social_plugin_like_button']['url_type'];
     42  }
     43  else
     44  {
     45    // nothing to do
    6946    return $content;
    7047  }
     
    7350  // Always use full url for FB social plugin
    7451  set_make_full_url();
    75   if ($conf['fbp']['social_plugin_like_button']['url_type'] == 'image')
     52  if ($type == 'image')
    7653  {
    7754    $fbp_url_picture = get_element_url($current_picture);
     
    8562
    8663  // XFBML implementation
    87   //~ $content .= '
    88 //~ <div id="fb-xfbml">';
    89   if ($conf['fbp']['social_plugin_like_button']['enabled'])
    90   {
    91     //~ $content .= '
    92 //~ <div id="fb-xfbml">
    93 //~ <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>
    94 //~ </div>';
    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   }
     64  $template->set_filename($tpl, FBP_DIR.'/tpl/'.$tpl.'.tpl');
     65  $content .= $template->parse($tpl, true);
    9866
    9967  return $content;
     
    12593}
    12694
    127 if ($conf['fbp']['social_plugin_like_button']['enabled'])
     95if ($conf['fbp']['social_plugin_like_button']['enabled'] or $conf['fbp']['social_plugin_facepile']['enabled'])
    12896{
    12997  //~ add_event_handler('loc_begin_picture', 'fbp_loc_begin_picture');
  • extensions/FacebookPlug/Plugin/language/en_UK/plugin.lang.php

    r8275 r8282  
    1818// | USA.                                                                  |
    1919// +-----------------------------------------------------------------------+
     20
    2021if (!defined('PHPWG_ROOT_PATH'))
    2122{
     
    3334$lang['light'] = 'light';
    3435$lang['dark'] = 'dark';
    35 $lang['Social plugin'] = 'Social plugin';
     36$lang['Social plugins'] = 'Social plugins';
    3637$lang['Advanced'] = 'Advanced';
    3738$lang['Asynchronous Facebook access'] = 'Asynchronous Facebook access';
     
    5354$lang['Data updated with error'] = 'Data updated with error';
    5455
     56$lang['Facepile'] = 'Facepile';
     57$lang['on slideshow pages'] = 'on slideshow pages';
     58$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[''] = '';
     75
    5576?>
  • extensions/FacebookPlug/Plugin/language/fr_FR/plugin.lang.php

    r8275 r8282  
    1818// | USA.                                                                  |
    1919// +-----------------------------------------------------------------------+
     20
    2021if (!defined('PHPWG_ROOT_PATH'))
    2122{
     
    3334$lang['light'] = 'clair';
    3435$lang['dark'] = 'foncé';
    35 $lang['Social plugin'] = 'Plugin social';
     36$lang['Social plugins'] = 'Modules sociaux';
    3637$lang['Advanced'] = 'Avancé';
    3738$lang['Asynchronous Facebook access'] = 'Accès asynchrone à Facebook';
     
    5253$lang['Data updated with success'] = 'Données mises à jour avec succès';
    5354$lang['Data updated with error'] = 'Données mises à jour avec erreur';
    54 //~ $lang[''] = '';
     55$lang['Facepile'] = 'Facepile';
     56$lang['on slideshow pages'] = 'sur les diaporamas';
     57$lang['Num rows'] = 'Nombre de lignes';
    5558
    5659?>
  • extensions/FacebookPlug/Plugin/tpl/admin.config.tpl

    r8275 r8282  
    5656        </label>
    5757      </li>
    58 {*      <li>
    59         <span class="property">
    60           <label for="fbp_day_number">{'fbp_day_number'|@translate}</label>
    61         </span>
    62         <input type="text" size="3" maxlength="4" name="fbp_day_number" id="fbp_day_number" value="{$fbp_DAY_NUMBER}" />
    63       </li>*}
     58    </div>
     59  </ul>
     60</fieldset>
     61
     62<fieldset>
     63  <ul>
     64    <h3><a href="{$social_plugin.facepile.FB_PAGE}" onclick="window.open(this.href); return false;">{'Facepile'|@translate}</a> {'on slideshow pages'|@translate}</h3>
     65    <li>
     66      <label>
     67        <span class="property">{'Enabled'|@translate}</span>
     68        <input type="checkbox" name="FBP_SOCIAL_PLUGIN_FACEPILE_ENABLED" {$social_plugin.facepile.ENABLED} />
     69      </label>
     70    </li>
     71
     72    <div id='facepile'>
     73      <li>
     74        <label>
     75          <span class="property">{'Num rows'|@translate}</span>
     76          <input type="text" size="3" maxlength="4" name="FBP_SOCIAL_PLUGIN_FACEPILE_MAX_ROWS" value="{$social_plugin.facepile.MAX_ROWS}" />
     77        </label>
     78      </li>
    6479    </div>
    6580  </ul>
     
    8095        <label>
    8196          <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}" />
     97          <input type="text" size="39" name="FBP_SOCIAL_PLUGIN_LIKE_BOX_URL" value="{$social_plugin.like_box.URL}" />
    8398        </label>
    8499      </li>
     
    172187      //Init all main checkbox
    173188      init_checkbox("FBP_SOCIAL_PLUGIN_LIKE_BUTTON_ENABLED", "like_button");
     189      init_checkbox("FBP_SOCIAL_PLUGIN_FACEPILE_ENABLED", "facepile");
    174190      init_checkbox("FBP_SOCIAL_PLUGIN_LIKE_BOX_ENABLED", "like_box");
    175191    });
  • extensions/FacebookPlug/Plugin/tpl/social.plugin.like.button.tpl

    r8275 r8282  
    11<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>
     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}" 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.