|
需要安装一个我写的织梦插件,因为直接模拟织梦后台POST存在N多问题,插件为绿色,安装很简单.
1.下载并上传 locoy_soft.php 文件到自己网站的 CMS/plus 目录下.[总不能传到别人网站上吧 -_-p ]
2.下载火车头的发布模块.
3.修改 locoy_soft.php 和 发布模块里的 pass 参数,确保一致即可.[强烈建议更换掉原有的123456]
4.模块必须使用的标签如下:
[标签:分类] [标签:时间] [标签:标题] [标签:作者] [标签:来源] [标签:缩略图] [标签:格式] [标签:环境] [标签:大小] [标签:地址] [标签:内容]
5.相关文件下载
http://blog.yabobo.com/rss/locoy-dedesoft/
用火车头的下载模块来搞被采集网站的缩略图.比织梦自己的要好用.
值得强调的是,数据格式和字符串长度一定对好.
有问题跟贴.1-2天看一次.
-
- <?php
- //本文件用来接收火车头post的数据.
- //作者:色鸟
- //QQ:164066948
- //在线帮助
- //http://blog.yabobo.com/rss/locoy-dedesoft/
- //获取CMS配置信息
- require_once('../include/config_base.php');
- require_once('../dede/inc/inc_archives_functions.php');
- //链接密码.随便设置一下,最基本的防御.
- $pass = '123456';
- $pass1 = $_POST['pass'];
- if($pass!=$pass1){
- echo '连接密码错误';
- exit();
- }
- //获得所有参数,必须和非必须的全在这里了,
- //有特殊需求的可以自行对应着修改.
- $typeid = $_POST['typeid'];
- $typeid2 = $_POST['typeid2'];
- $sortrank = $_POST['time'];
- $iscommend = $_POST['iscommend'];
- $ismake = $_POST['ismake'];
- $channelid = $_POST['channelid'];
- $arcrank = $_POST['arcrank'];
- $money = $_POST['money'];
- $title = $_POST['title'];
- $shorttitle = $_POST['shorttitle'];
- $color = $_POST['color'];
- $writer = $_POST['writer'];
- $source = $_POST['source'];
- $litpic = $_POST['litpic'];
- $pubdate = $_POST['time'];
- $senddate = $_POST['time'];
- $arcatt = $_POST['arcatt'];
- $adminID = $_POST['adminID'];
- $description = $_POST['description'];
- $keywords = $_POST['keywords'];
- $filetype = $_POST['filetype'];
- $language = $_POST['language'];
- $softtype = $_POST['softtype'];
- $accredit = $_POST['accredit'];
- $os = $_POST['os'];
- $softrank = $_POST['softrank'];
- $officialUrl = $_POST['officialUrl'];
- $officialDemo = $_POST['officialDemo'];
- $softsize = $_POST['softsize'];
- $urls = $_POST['urls'];
- $body = $_POST['body'];
- //自动处理一些数据
- if($description=="" && $cfg_auot_description>0){
- $description = stripslashes(cn_substr(html2text($body),$cfg_auot_description));
- $description = addslashes($description);
- }
- if(empty($typeid2)){ $typeid2 = '0';}
- if(empty($iscommend)){ $iscommend = '0';}
- if(empty($ismake)){ $ismake = '1';}
- if(empty($arcrank)){ $arcrank = '0';}
- if(empty($money)){ $money = '0';}
- if(empty($arcatt)){ $arcatt = '0';}
- if(empty($adminID)){ $adminID = '1';}
- if(empty($filetype)){ $filetype = '.exe';}
- if(empty($language)){ $language = '简体中文';}
- if(empty($softtype)){ $softtype = '国产软件';}
- if(empty($accredit)){ $accredit = '共享软件';}
- if(empty($os)){ $os = 'Win2003,WinXP,Win2000,Win9X';}
- if(empty($softrank)){ $softrank = '3';}
- //我的处理函数
-
- //加入主档案表
- //----------------------------------
- $inQuery = "INSERT INTO #@__archives(
- typeid,typeid2,sortrank,iscommend,ismake,channel,
- arcrank,click,money,title,shorttitle,color,writer,source,litpic,
- pubdate,senddate,arcatt,adminID,memberID,description,keywords)
- VALUES ('$typeid','$typeid2','$sortrank','$iscommend','$ismake','$channelid',
- '$arcrank','0','$money','$title','$shorttitle','$color','$writer','$source','$litpic',
- '$pubdate','$senddate','$arcatt','$adminID','0','$description','$keywords');";
- echo $inQuery.'<br>';
- $dsql = new DedeSql();
- $dsql->SetQuery($inQuery);
- if(!$dsql->ExecuteNoneQuery()){
- $dsql->Close();
- echo '把数据保存到数据库archives表时出错,请检查!';
- exit();
- }
- //软件链接列表
- $urls = "{dede:link text='本地下载'}".$urls."{/dede:link}";
- $urls = addslashes($urls);
- //加入附加表
- //----------------------------------
- $arcID = $dsql->GetLastID();
- $inQuery = "
- INSERT INTO #@__addonsoft(aid,typeid,filetype,language,softtype,accredit,
- os,softrank,officialUrl,officialDemo,softsize,softlinks,introduce)
- VALUES ('$arcID','$typeid','$filetype','$language','$softtype','$accredit',
- '$os','$softrank','$officialUrl','$officialDemo','$softsize','$urls','$body');
- ";
- echo $inQuery.'<br>';
- $dsql->SetQuery($inQuery);
- if(!$dsql->ExecuteNoneQuery()){
- $dsql->SetQuery("Delete From #@__archives where ID='$arcID'");
- $dsql->ExecuteNoneQuery();
- $dsql->Close();
- echo '把数据保存到数据库附加表 addonsoft 时出错,请检查原因!';
- exit();
- }
- $dsql->Close();
- //生成HTML
- //---------------------------------
- $artUrl = MakeArt($arcID,true);
- //---------------------------------
- //返回成功信息
- //----------------------------------
- echo '发布成功!';
- ?>
复制代码
[ 本帖最后由 695321 于 2007-10-9 13:04 编辑 ] |
|