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

Add css
Fix translations
Finish like box integration

File:
1 edited

Legend:

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