帝国cms7.0实现微博群发功能插件教程

帝国cms7.0实现微博群发功能插件教程,第1张

帝国cms7.0实现微博群发功能插件教程(支持28个微博平台支持定时发布)

本文的重点是,大家详细介绍了帝国cms7.0完成微博中群发功能的插件,非常好用,有需要的盆友可以参考一下。

本文简单详细介绍了帝国cms7.0在微博中完成群发的一个插件。该插件可应用于28个微博服务平台,并可定期发布。 *** 作步骤如下:

一、使用说明书:

1.这个号是微博的wordpress插件修改的。要能够完成群发消息微博的角色,必要条件是你已经在各类微博申请注册。能够定期完成发布。
定期发布时选择“发布微博”空。

2.升级后,不容易批量发送消息。微博,如果论文修改,选择1发布微博,选择0不发布,如果论文定期发布,选择空。

3.如果插件在UTF-8号码下使用,则必须更改代码。如果简单复制应用程序只适用于GBK版本号。

二。 *** 作步骤:

1.先在帝国CMS后台管理新建一个字段名。注意:初始值是三个值:0不发布;1用于发布;空未批准。

字段:“微博”
字段名标志:“发布微博”
初始值:
0:默认
1
(/[K0/]也是回车键)

2.将下列涵洞编号填入userfun.php。


复制代码编码以下:<?php
//---------------------------微博发布涵数
functionsend_to_wbto($id){
global$empire,$dbtbpre,$public_r,$navinfor;
$rr=$empire->fetch1("select*from{$dbtbpre}ecms_news_data_1,{$dbtbpre}ecms_newswhere{$dbtbpre}ecms_news_data_1.id='".$id."'and{$dbtbpre}ecms_news_data_1.id={$dbtbpre}ecms_news.idlimit1");
$title=$rr[title];
$content=esub(strip_tags($rr[smalltext]),200);
$url=$rr[titleurl];
$title1=$title.'//'.$content.$rr[titleurl];
preg_match_all('/<img[^>]src=['"](http[^'"])['"].*>/isU',$rr[newstext],$image);//搭配图像文件格式
$p_sum=count($image[1]);
if($p_sum>0){
$p=$image[1][0];
}
if(!$p){
$p=$rr[titlepic];
}
$username='xxxxx';
$password='xxxxx';
$image_url=$p;
$title1=iconv('GB2312','UTF-8',$title1);//将字符串数组的编号从GB2312转到UTF-8,如果是UTF-8段编码能够注解掉
$fields=array();
$fields['source']='wordpress';
$fields['content']=urlencode($title1);//
$ch=curl_init();
if($image_url){
$fields['imgurl']=$image_url;
curl_setopt($ch,CURLOPT_URL,"http://wbto.cn/api/upload.json");
}else{
curl_setopt($ch,CURLOPT_URL,"http://wbto.cn/api/update.json");
}
curl_setopt($ch,CURLOPT_USERPWD,"$username:$password");
curl_setopt($ch,CURLOPT_FAILONERROR,TRUE);
curl_setopt($ch,CURLOPT_RETURNTRANSFER,TRUE);
curl_setopt($ch,CURLOPT_TIMEOUT,10);
curl_setopt($ch,CURLOPT_POST,TRUE);
curl_setopt($ch,CURLOPT_POSTFIELDS,$fields);
$result=curl_exec($ch);
curl_close($ch);
}
?>
复制以下代码:<?PHP
///-
$RR=$empire->;fetch1("select*from{$dbtbpre}ecms_news_data_1,{$dbtbpre}ecms_newswhere{$dbtbpre}ecms_news_data_1.id='"。$id。以及{$dbtbpre}ecms_news_data_1.id={$dbtbpre}ecms_news.idlimit1");
$title=$RR[title];
$content=esub(strip_tags($RR[smalltext]),200);
$URL=$RR[titleURL];
$title1=$title。'//'.$内容。$RR[titleURL];
preg_match_all('/<;img[^>;]src=['"](http[^'"])['"]。*>/isU',$rr[newstext],$image);//带有图像文件格式
$p_sum=count($image[1]);
if($p_sum>;0){
$p=$image[1][0];
}
if(!$p){
$p=$RR[titlepic];
}
$username='xxxxx';
$password='xxxxx';
$image_URL=$p;
$title1=iconv('GB2312','UTF-8',$title1);//将字符串数组的个数从GB2312变成UTF-8。如果是UTF-8段编码,可以注释掉
$fields=array();
$fields['source']='WordPress';
$fields['content']=urlencode($title1);//
$ch=curl_init();
if($image_URL){
$fields['imgurl']=$image_URL;
curl_setopt($ch,CURLOPT_URL,"http://wbto.cn/API/upload.JSON");
}else{
curl_setopt($ch,CURLOPT_URL,"http://wbto.cn/API/update.JSON");
}
curl_setopt($ch,CURLOPT_USERPWD,"$username:$password");
curl_setopt($ch,CURLOPT_FAILONERROR,TRUE);
curl_setopt($ch,CURLOPT_RETURNTRANSFER,TRUE);
curl_setopt($ch,CURLOPT_TIMEOUT,10);
curl_setopt($ch,CURLOPT_POST,TRUE);
curl_setopt($ch,CURLOPT_POSTFIELDS,$fields);
$result=curl_exec($ch);
curl_close($ch);
}
?>

3.构建一个公共自变量“weibo_se”


复制以下代码:<?PHP
$RRR2=$empire->;fetch1("select*from{$dbtbpre}ecms_newswhereid='"。$navinfor['id']。极限1”);
$SQL=$empire->;query1("UPDATE{$dbtbpre}ecms_newssetWeibo='0'其中id='"。$navinfor['id']。'");
if(function_exists('send_to_wbto'){
if($RRR2['Weibo']=='1'||$RRR2['Weibo']=''){
send_to_wbto($navinfor['id']);
}
}
?>

4、[!-temp.weibo_se-]并放入内容模板中。

欢迎分享,转载请注明来源:内存溢出

原文地址:https://54852.com/zz/772782.html

(0)
打赏 微信扫一扫微信扫一扫 支付宝扫一扫支付宝扫一扫
上一篇 2022-05-03
下一篇2022-05-03

发表评论

登录后才能评论

评论列表(0条)

    保存