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

Add facepile

File:
1 edited

Legend:

Unmodified
Added
Removed
  • 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');
Note: See TracChangeset for help on using the changeset viewer.