下面是我写的,但是发现网站的版块主题列表页没有我这个接口的主题,请问少了些什么,而且这里会有一问题,经常出现错误,说是post表里发现重复值。
//发表主题
function Add_thread($fid,$uid,$author,$subject,$message){
$timenow=time();
DB::query("INSERT INTO ".DB::table('forum_thread')." (fid, posttableid, readperm, price, typeid, sortid, author, authorid, subject, dateline, lastpost, lastposter, displayorder, digest, special, attachment, moderated, status, isgroup, replycredit, closed)
VALUES ('$fid', '0', '0', '0', '0', '0', '$author', '$uid', '$subject', '$timenow', '$timenow', '$author', '0', '0', '0', '0', '0', '244', '0', '0', '0')");
$tid = DB::insert_id();
if($tid>0)
{
$usesig=1;
$first=1;
$tid=Add_thread_post($fid,$tid,$first,$uid,$author,$subject,$timenow,$message,$usesig);
}
return $tid;
}
//发表帖子
function Add_thread_post($fid,$tid,$first,$uid,$author,$subject,$timenow,$message,$usesig=0){
$timenow=time();
$first=($first==1)?1:0;
$pid=DB::result_first("SELECT max(pid) FROM ".DB::table('forum_post'));
$pid=$pid+1;
DB::query("INSERT INTO ".DB::table('forum_post')." (pid,fid,tid,first,author,authorid,subject,dateline,message,useip,invisible,anonymous,usesig,htmlon,bbcodeoff,smileyoff,parseurloff,attachment,rate,ratetimes,status,tags,comment,replycredit)
VALUES ('$pid','$fid','$tid','$first','$author','$uid', '$subject','$timenow','$message','10.0.0.150','0','0','$usesig','0','-1','-1','0','0','0','0','0','','0','0')");
DB::query("update ".DB::table('forum_thread')." set replies=replies+1,lastpost=$uid,lastposter='$author' where tid=$tid");
$pid = DB::insert_id();
return $pid;
}
另外还有一个问题,就是手机版的帖子里面的缩略图地址有在数据库里记录么。我要怎么找出这个缩略图地址。
|