Changeset 8275 for extensions/FacebookPlug/Plugin/include/picture.inc.php
- Timestamp:
- Dec 24, 2010, 1:01:39 AM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
extensions/FacebookPlug/Plugin/include/picture.inc.php
r8254 r8275 24 24 } 25 25 26 function fbp_header($content, &$smarty) 26 include_once(FBP_DIR.'/include/common.inc.php'); 27 include_once(FBP_DIR.'/include/header.inc.php'); 28 29 /*function fbp_header($content, &$smarty) 27 30 { 28 31 global $conf; … … 38 41 $search = '<div id="the_page">'; 39 42 return preg_replace('#'.$search.'#', $fbp_content.$search, $content); 40 } 43 }*/ 41 44 42 function fbp_loc_begin_picture()45 /*function fbp_loc_begin_picture() 43 46 { 44 47 global $template, $user, $page, $conf, $picture; … … 55 58 $template->set_filename('init.fb', FBP_DIR.'/tpl/init.fb.tpl'); 56 59 $template->append('head_elements', $template->parse('init.fb', true)); 57 } 60 }*/ 58 61 59 62 function fbp_render_element_content($content, $current_picture) … … 67 70 } 68 71 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') 70 76 { 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); 86 85 87 // iframeimplementation88 /* $$content= '89 <iframe src="http://www.facebook.com/plugins/like.php?href={$SRC_IMG}&layout=standard&show_faces=true&width={$WIDTH_IMG}&action=like&colorscheme=light&height=80" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:{$WIDTH_IMG}px; height:80px;" allowTransparency="true"></iframe> 90 ';*/91 // XFBML implementation86 // XFBML implementation 87 //~ $content .= ' 88 //~ <div id="fb-xfbml">'; 89 if ($conf['fbp']['social_plugin_like_button']['enabled']) 90 { 92 91 //~ $content .= ' 93 //~ <div id="fb-xfbml">';94 if ($conf['fbp']['social_plugin_like_button']['enabled'])95 {96 //~ $content .= '97 92 //~ <div id="fb-xfbml"> 98 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> 99 94 //~ </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 } 116 98 117 99 return $content; … … 122 104 global $conf; 123 105 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']) 125 107 { 126 108 if ($conf['fbp']['allow_fb_access_private_page']) … … 143 125 } 144 126 145 if ($conf['fbp']['social_plugin_like_button']['enabled'] or $conf['fbp']['social_plugin_like_box']['enabled'])127 if ($conf['fbp']['social_plugin_like_button']['enabled']) 146 128 { 147 add_event_handler('loc_begin_picture', 'fbp_loc_begin_picture');129 //~ add_event_handler('loc_begin_picture', 'fbp_loc_begin_picture'); 148 130 add_event_handler('render_element_content', 'fbp_render_element_content', EVENT_HANDLER_PRIORITY_NEUTRAL+1 /*in order to have picture content*/, 2); 149 131 //~ add_event_handler('loc_end_picture', 'fbp_loc_end_picture');
Note: See TracChangeset
for help on using the changeset viewer.