这个帝国CMS火车头采集器对接接口是我的站长站在一个大神分享的源码里面找的,测试是可以正常对接采集的,分享一下,以后备用。
<?php /********密码验证***********/ $password='www.wdzzz.com'; //这个密码是登陆验证用的.您需要在模块里设置和这里一样的密码....注意一定需要修改. if($password!=$_GET['pw']) exit('验证密码错误'); //安全检测,密码不符则退出 /****以下代码非专业人员不建议修改***************/ define('EmpireCMSAdmin','1'); require("../class/connect.php"); require("../class/db_sql.php"); require("../class/functions.php"); require LoadLang("pub/fun.php"); require("../class/delpath.php"); require("../class/copypath.php"); require("../class/t_functions.php"); require("../data/dbcache/class.php"); require("../data/dbcache/MemberLevel.php"); //获取分类列表 foreach($class_r as $kv) { $cates[]=array('cname'=>$kv['classname'],'cid'=>$kv['classid'],'pid'=>$kv['bclassid']); } if(empty($_POST)) { //这里刷新列表 echo "<select name='list'>"; echo maketree($cates,0,''); echo '</select>'; exit(); } $link=db_connect(); $empire=new mysqlquery(); //验证用户 $loginin=$_POST['username']; $lur=$empire->fetch1("select * from {$dbtbpre}enewsuser where `username`='$loginin'"); if(!$lur) exit('不存在的用户名'.$loginin); $logininid=$lur['userid']; $loginrnd=$lur['rnd']; $loginlevel=$lur['groupid']; $loginadminstyleid=$lur['adminstyleid']; $incftp=0; if($public_r['phpmode']) { include("../class/ftp.php"); $incftp=1; } require("../class/hinfofun.php"); $_POST[morepic]=str_replace('<img src=','',$_POST[morepic]); //替换字符 $_POST[morepic]=str_replace(' />','',$_POST[morepic]); //替换字符 $_POST[morepic]=str_replace('>','',$_POST[morepic]); //替换字符 $morepic = explode("|||",$_POST['morepic']); $i = 0; foreach ($morepic as $shuzu=>$str){ $i = $i + 1; $_POST['msmallpic'][] = $str; $_POST['mbigpic'][] = $str; $_POST['mpicname'][] = $_POST['title']; $_POST['mpicid'][] = $i; } $navtheid=(int)$_POST['filepass']; AddNews($_POST,$logininid,$loginin); db_close(); $empire=null; /***生成目录的一个遍历算法***/ function maketree($ar,$id,$pre) { $ids=''; foreach($ar as $k=>$v){ $pid=$v['pid']; $cname=$v['cname']; $cid=$v['cid']; if($pid==$id) { $ids.="<option value='$cid'>{$pre}{$cname}</option>"; foreach($ar as $kk=>$vv) { $pp=$vv['pid']; if($pp==$cid) { $ids.=maketree($ar,$cid,$pre." "); break; } } } } return $ids; } ?>