【发布时间】:2020-06-28 01:32:28
【问题描述】:
我在分享时对 facebook 分享器有疑问,生成文件路径并在 facebook 上分享准备好在用户时间轴上显示的本机 gif。 我当然在使用
.qa_html ($ this-> content ['description']).
这是最终 .gif 文件的目的地
.qa_html ($ shareurl). 是出版物的网址,是我希望用户在点击左下角 Facebook 上的网站按钮以及下图中的网站按钮时被重定向到的网址。
有人能告诉我如何通过在用户的时间轴上显示原生 gif 并根据此信息显示发布地址,从而将分享更改为 facebook 吗?
我的元变量
$this->output('<meta content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0" name="viewport" />');
$this->head_links();
if ($this->template == 'question' && strpos(qa_get_state(), 'edit')===false ) {
$pagetitle=strlen($this->request) ? strip_tags($this->content['title']) : '';
$headtitle=(strlen($pagetitle) ? ($pagetitle.'') : '');
$this->output('<meta property="og:url" content="'.qa_html( $this->content['canonical'] ).'" />');
$this->output('<meta property="og:type" content="article" />');
$this->output('<meta property="og:title" content="'.qa_html( $headtitle ).'" />');
$this->output('<meta property="og:description" content="Click To Watch" />');
$this->output('<meta property="og:image" content="'.qa_html( $this->content['description'] ).'"/>');
$this->output('<meta name="twitter:card" content="summary_large_image">');
$this->output('<meta name="twitter:title" content="'.qa_html( $headtitle ).'">');
$this->output('<meta name="twitter:description" content="'.qa_html( $headtitle ).'">');
$this->output('<meta name="twitter:image" content="'.qa_html( $this->content['description'] ).'">');
$this->output('<meta itemprop="description" content="click to watch">');
$this->output('<meta itemprop="image" content="'.qa_html( $this->content['description'] ).'">');
$this->output('<link rel="image_src" type="image/jpeg" href="'.qa_html( $this->content['description'] ).'" />');
}
我正在尝试进行调整,以便当用户单击 facebook 内 gif 中出现的左下角按钮时,他将被重定向到发布页面。 pinterest 函数使用以下参数,效果很好。
$this->output('<a class="share-badge pinshare" href="//www.pinterest.com/pin/create/button/?url='.qa_html( $shareurl ).'&media='.qa_html( $this->content['description'] ).'&description="
我的问题是如何使 pinterest 代码适应 facebook 共享代码,以便它适用于 facebook 共享,当用户点击网站地址时,在用户的时间轴上显示本机 gif 将被重定向到相关出版物。就像在 pinterest 上一样
PS:.qa_html ($ this-> content ['description']).是文件的最终地址
ps:pinterest 工作正常 有人可以帮我解决这个问题吗?提前致谢。欢迎任何帮助。
完整代码主题 https://pastebin.com/mXNfewVW
facebook 分享者和社交功能代码:(代码已更改)
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">');
$this->output('<a title="Share on Facebook" href="https://www.facebook.com/sharer/sharer.php?u='.qa_html( $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->output('<i class="fab fa-facebook"></i></a>');
$this->output('<a class="share-badge twitter" href="http://twitter.com/share?text='.qa_html( $headtitle ).'&url='.qa_html( $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"></i></a>');
$this->output('<a class="share-badge pinshare" href="//www.pinterest.com/pin/create/button/?url='.qa_html( $shareurl ).'&media='.qa_html( $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"></i></a>');
$this->output('</div>');
}
【问题讨论】: