Php 在facebook共享上显示gif
您好,我如何获取图像路径,以便在不打开网站的情况下,以gif格式直接显示在facebook上 我们可以使用这个解决方案 使用此代码:Php 在facebook共享上显示gif,php,facebook,Php,Facebook,您好,我如何获取图像路径,以便在不打开网站的情况下,以gif格式直接显示在facebook上 我们可以使用这个解决方案 使用此代码: $this->output('<a class="share-badge facebook" title="Share on Facebook" href="https://www.facebook.com/sharer/sharer.php?u='.$this->content['description']. '" " target="_bla
$this->output('<a class="share-badge facebook" title="Share on Facebook" href="https://www.facebook.com/sharer/sharer.php?u='.$this->content['description']. '" " target="_blank" rel="nofollow" onclick="javascript:window.open(this.href, \'_blank\', \'menubar=no,toolbar=no,resizable=no,scrollbars=no,height=400,width=600\');return false;">');
$this->输出('
完整代码
这是可行的,但当我点击facebook上的共享按钮时,我无法使其自动运行
有人能帮我吗
我相信这是我在socialshare功能中必须适应的代码部分
更新
我得到了正确的url,但我不能得到它以.gif结尾。我得到了这个facebook错误
FB错误停止介质必须是阵列
代码如下所示
代码
$this->输出('
if($this->template=='news'| |($this->template=='question'&&strpos(qa_get_state(),'edit')!==false)){
$this->output(“”);
$this->output('tinymce.init({
选择器:\''extra,\'q'u extra\',
图片上传url:\'.$actual\u link./king include/newsupload.php\',
图片上传基本路径:\'.$actual\u link./king include/\',
图像\u上载\u凭据:false,
主题:\'inlite\',
插件:\'image table link paste textpattern autolink\',
插入工具栏:\'quickimage quicktable\',
选择工具栏:\'bold italic \'quicklink h2 h3 blockquote\',
是的,
粘贴数据图像:false,
相对URL:false,
删除\u脚本\u主机:false
});');
}
$this->output(“”);
函数socialshare()
{
$pagetitle=strlen($this->request)?带标签(@$this->content['title']):“”;
$headtitle=(strlen($pagetitle)?($pagetitle):“”);
$shareurl=qa_path_html(qa_请求($this->content['q_view']['raw']['postid'],$this->content['q_view']['raw']['title']),null,qa_opt('site_url');
$this->output(“”);
$this->output(“”);
$this->output(“”);
如果(strlen(@$this->content['description'])){
$this->output(“”);
}
$this->output(“”);
}
$this->output('<a class="share-badge facebook" title="Share on Facebook" href="https://www.facebook.com/sharer/sharer.php?u='.$shareurl.'&media='.$this->content['description']. '&description=" " target="_blank" rel="nofollow" onclick="javascript:window.open(this.href, \'_blank\', \'menubar=no,toolbar=no,resizable=no,scrollbars=no,height=400,width=600\');return false;">');
if ( $this->template == 'news' || ($this->template=='question' && strpos(qa_get_state(),'edit')!==false) ) {
$this->output('<script src="'.$this->rooturl.'tinymce/tinymce.min.js"></script>');
$this->output('<script type="text/javascript">tinymce.init({
selector: \'#extra, #q_extra\',
images_upload_url: \''.$actual_link.'/king-include/newsupload.php\',
images_upload_base_path: \''.$actual_link.'/king-include/\',
images_upload_credentials: false,
theme: \'inlite\',
plugins: \'image table link paste textpattern autolink\',
insert_toolbar: \'quickimage quicktable\',
selection_toolbar: \'bold italic | quicklink h2 h3 blockquote\',
inline: true,
paste_data_images: false,
relative_urls: false,
remove_script_host: false
});</script>');
}
$this->output('</BODY>');
function socialshare()
{
$pagetitle=strlen($this->request) ? strip_tags(@$this->content['title']) : '';
$headtitle=(strlen($pagetitle) ? ($pagetitle) : '');
$shareurl= qa_path_html(qa_q_request($this->content['q_view']['raw']['postid'], $this->content['q_view']['raw']['title']), null, qa_opt('site_url'));
$this->output('<div class="share-overlay twitter-ready fb-ready">');
$this->output('<a class="share-badge facebook" title="Share on Facebook" href="https://www.facebook.com/sharer/sharer.php?u='.$shareurl.'" target="_blank" rel="nofollow" onclick="javascript:window.open(this.href, \'_blank\', \'menubar=no,toolbar=no,resizable=no,scrollbars=no,height=400,width=600\');return false;">');
$this->output('<i class="fab fa-facebook fa-lg"></i>');
$this->output('</a>');
$this->output('<a class="share-badge twitter" href="http://twitter.com/share?text='.$headtitle.'&url='.$shareurl.'" title="Share on Twitter" rel="nofollow" target="_blank" onclick="avascript:window.open(this.href, \'_blank\', \'menubar=no,toolbar=no,resizable=no,scrollbars=no,height=400,width=600\');return false;"><i class="fab fa-twitter-square"></i></a>');
if (strlen(@$this->content['description'])) {
$this->output('<a class="share-badge pinshare" href="//www.pinterest.com/pin/create/button/?url='.$shareurl.'&media='.$this->content['description'].'&description=" title="Pin It" target="_blank" onclick="javascript:window.open(this.href, \'\', \'menubar=no,toolbar=no,resizable=no,scrollbars=no,height=400,width=600\');return false;"><i class="fab fa-pinterest-square"></i></a>');
}
$this->output('</div>');
}