Ignore:
Timestamp:
Dec 23, 2010, 10:39:59 AM (13 years ago)
Author:
rub
Message:

Use sync implementation by default (bug with RockMelt)
Use render_element_content to add XFBML

File:
1 edited

Legend:

Unmodified
Added
Removed
  • extensions/FacebookPlug/Plugin/include/picture.inc.php

    r8243 r8248  
    8484}
    8585
    86 function fbp_add_social($content, &$smarty)
    87 {
    88   global $conf;
    89   $fbp_content .= '<div id="fb-xfbml">';
    90 
    91   // iframe implementation
    92 /*  $fbp_content = '
    93 <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>
    94 ';*/
    95 
    96   // XFBML implementation
    97   /*$fbp_content .= '
    98 <fb:like href="{$SRC_IMG}" show_faces="true" width="{$WIDTH_IMG}"></fb:like>
    99 ';*/
    100   $fbp_content .= '
    101 <fb:like href="{$FBP_URL_PICTURE}" layout="{$FBP_SOCIAL_PLUGIN_LIKE_BUTTON.layout}" show_faces="{if $FBP_SOCIAL_PLUGIN_LIKE_BUTTON.show_faces}true{else}false{/if}" width="{$WIDTH_IMG}" action="{$FBP_SOCIAL_PLUGIN_LIKE_BUTTON.action}" colorscheme="{$FBP_SOCIAL_PLUGIN_LIKE_BUTTON.colorscheme}"></fb:like>
    102 ';
    103 
    104   $fbp_content .= '</div>';
    105 
    106   return $content.$fbp_content;
    107 }
    108 
    10986function fbp_loc_begin_picture()
    11087{
     
    11390  // set prefilter
    11491  $template->set_prefilter('header', 'fbp_header');
    115   //~ $template->set_prefilter('header', 'fbp_add_fb_init');
    116   if ($conf['fbp']['social_plugin_like_button']['enabled'])
    117   {
    118     $template->set_prefilter('default_content', 'fbp_add_social');
    119   }
    12092}
    12193
     
    12597  global $template, $user, $page, $conf, $picture;
    12698
     99  if ($page['slideshow'])
     100  {
     101    // nothing to do on slideshow other media aren't usable
     102    return $content;
     103  }
     104
    127105  if ($conf['fbp']['social_plugin_like_button']['enabled'])
    128106  {
     107     // iframe implementation
     108    /*  $$content = '
     109    <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>
     110    ';*/
     111    // XFBML implementation
     112    $content .= '
     113<div id="fb-xfbml">
     114<fb:like href="{$FBP_URL_PICTURE}" layout="{$FBP_SOCIAL_PLUGIN_LIKE_BUTTON.layout}" show_faces="{if $FBP_SOCIAL_PLUGIN_LIKE_BUTTON.show_faces}true{else}false{/if}" width="{$WIDTH_IMG}" action="{$FBP_SOCIAL_PLUGIN_LIKE_BUTTON.action}" colorscheme="{$FBP_SOCIAL_PLUGIN_LIKE_BUTTON.colorscheme}"></fb:like>
     115</div>';
     116    $content2 = '
     117<fb:like href="{$FBP_URL_PICTURE}" layout="{$FBP_SOCIAL_PLUGIN_LIKE_BUTTON.layout}" show_faces="{if $FBP_SOCIAL_PLUGIN_LIKE_BUTTON.show_faces}true{else}false{/if}" width="{$WIDTH_IMG}" action="{$FBP_SOCIAL_PLUGIN_LIKE_BUTTON.action}" colorscheme="{$FBP_SOCIAL_PLUGIN_LIKE_BUTTON.colorscheme}"></fb:like>
     118';
     119
    129120    //~ $template->set_prefilter('default_content', 'fbp_add_social');
    130121    // Always use full url for FB social plugin
     
    146137    $template->assign('FBP_SOCIAL_PLUGIN_LIKE_BUTTON', $conf['fbp']['social_plugin_like_button']);
    147138  }
     139
    148140  return $content;
    149141}
     
    177169{
    178170  add_event_handler('loc_begin_picture', 'fbp_loc_begin_picture');
    179   add_event_handler('render_element_content', 'fbp_render_element_content', null, 2);
     171  add_event_handler('render_element_content', 'fbp_render_element_content', EVENT_HANDLER_PRIORITY_NEUTRAL+1 /*in order to have picture content*/, 2);
    180172  //~ add_event_handler('loc_end_picture', 'fbp_loc_end_picture');
    181173  add_event_handler('loc_end_section_init', 'ftp_loc_end_section_init');
Note: See TracChangeset for help on using the changeset viewer.