ss7的模型没有采集功能,如何实现?
那位有研究过没有,能不能详细地诉说一下
包括可能新增加的字段,采集规则里面可能也需要增加很多新的识别字段的办法,然后如何写入数据库!
目前没有这个功能。
你原来说的在入库的地方去修改,但是我找了半天也没发现在那里入的库
在admin_robotmessages.php里面好象有入库的地方,但修改了一下好象不对,请指教
$query = $_SGLOBAL['db']->query('SELECT i.* FROM '.tname('robotitems').' i WHERE i.robotid=\''.$_POST['robotid'].'\' AND i.isimport=0 ORDER BY i.robottime');
}
$itemarr = $theitemidarr = array();
while ($item = $_SGLOBAL['db']->fetch_array($query)) {
$robotitemid = $theitemidarr[] = $item['itemid'];
$item = saddslashes($item);
$hashstr = smd5($_SGLOBAL['supe_uid'].'/'.rand(1000, 9999).$_SGLOBAL['timestamp'].$item['itemid']);
$setsqlarr = array(
'catid' => $_POST['catid'],
'uid' => $item['uid'],
'username' => $item['username'],
'type' => 'news',
'subject' => $item['subject'],
'dateline' => $item['dateline'],
'lastpost' => $item['dateline'],
'hash' => $hashstr,
'haveattach' => ($item['haveattach']==1?1:0)
);
$itemid = inserttable('spaceitems', $setsqlarr, 1);
$robotid = $item['robotid'];
$itemidarr[$item['itemid']] = $itemid;
$itemarr[$item['itemid']] = $item;
if($item['haveattach']) {
$_SGLOBAL['db']->query("UPDATE ".tname('attachments')." SET itemid='$itemid', catid='$_POST[catid]', uid='$item[uid]', hash='$hashstr' WHERE hash='R{$robotid}I{$robotitemid}'");
//更新图文资讯
$attvalue = $_SGLOBAL['db']->fetch_array($_SGLOBAL['db']->query("SELECT aid FROM ".tname('attachments')." WHERE itemid='$itemid' AND isimage='1' LIMIT 0 ,1"));
$_SGLOBAL['db']->query("UPDATE ".tname('spaceitems')." SET picid='$attvalue[aid]' WHERE itemid='$itemid'");
}
}
//内容
if(empty($theitemidarr)) showmessage('robotmessage_op_success', $theurl);
$itemids = implode('\',\'', $theitemidarr);
$query = $_SGLOBAL['db']->query('SELECT ii.* FROM '.tname('robotmessages').' ii WHERE ii.itemid IN (\''.$itemids.'\') ORDER BY ii.msgid');
while ($msg = $_SGLOBAL['db']->fetch_array($query)) {
$msg = saddslashes($msg);
if(empty($itemidarr[$msg['itemid']])) continue;
$setsqlarr = array(
'itemid' => $itemidarr[$msg['itemid']],
'message' => $msg['message'],
'newsauthor' => $itemarr[$msg['itemid']]['author'],
'newsfrom' => $itemarr[$msg['itemid']]['itemfrom']
);
inserttable('spacenews', $setsqlarr);
}
inserttable()函数好象就是,但我把inserttable('spacenews', $setsqlarr);
修改成inserttable('modelmessage', $setsqlarr);
好象无用
咨讯的帖子主要保存在supe_spacenews和supe_spaceitems2个表里面
那模型的帖子就应该在supe_modelmessage和supe_modelitems里面了吧?
望详解 |