我在共享时对 facebook 共享器有疑问,生成文件路径并在 facebook 上共享准备在用户时间线上显示的本机 gif。当然我正在使用
.qa_html ($ this-> content ['description']).
Run Code Online (Sandbox Code Playgroud)
这是最终 .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'] ).'" />');
}
Run Code Online (Sandbox Code Playgroud)
我正在尝试进行调整,以便当用户单击 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="
Run Code Online (Sandbox Code Playgroud)
我的问题是如何使 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>');
}
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
147 次 |
| 最近记录: |