wordpress生成QQ分享、微博分享示例代码

作者: 站长 上传时间: 浏览: N/A 下载: N/A 格式: N/A 评分: N/A


function get_share_url($type, $title, $summary)
{
global $set;
if ($set['seo']['description'] != null) {
$description = $set['seo']['description'];
} else {
$description = get_bloginfo('description');
}
$url = urlencode(get_bloginfo('url'));
if ($type == 'qq') {
return 'https://connect.qq.com/widget/shareqq/index.html?url=' . $url . '&title=' . urlencode($title) . '&source=' . urlencode(get_bloginfo('name')) . '&desc=' . urlencode($description) . '&pics=&summary=' . urlencode($summary);
} else if ($type == 'weibo') {
return 'https://service.weibo.com/share/share.php?url=' . $url . '&title=' . urlencode($summary) . '&pic=&appkey=&searchPic=true';
} else if ($type = 'qzone') {
return 'http://sns.qzone.qq.com/cgi-bin/qzshare/cgi_qzshare_onekey?url=' . $url . '&title=' . urlencode($title) . '&pics=&summary=' . urlencode($summary);
}
}

Leave a Comment