[分享]论坛回收站实现方法
作者:cmscn 日期:2005-04-11
[分享]论坛回收站暂有问题,先别装
http://www.joekoe.com/forum_view.asp?forum_id=7&view_id=51814
1、在数据库库表bbs_topic中加入字段form_id
设置如下图
Access:
SQL
2、下载文件forum_recycle.asp并解压后放在网站根目录下
[file=attachments/month_200509/21_151917_63u92004122910193598.rar]Click to Download[/file]
3、修改forum_isaction.asp
删除: call upload_del(index_url,ftid)
找到,
call joekoe_cms.exec("delete from bbs_data where reply_id="&ftid,0)
call joekoe_cms.exec("delete from bbs_vote where reply_id="&ftid,0)
call joekoe_cms.exec("delete from bbs_topic where id="&ftid,0)
替换成
以下为代码内容:
call joekoe_cms.exec("update bbs_data set forum_id=999999999 where reply_id="&ftid,0)
call joekoe_cms.exec("update bbs_topic set forum_id=999999999,form_id="&forumid&",istop=0 where id="&ftid,0)
4、修改forum_view.asp,红色部分为添加的
dim vdim,fir_topic,counter,re_counter,fir_istop,fir_isgood,fir_islock,fir_isvote,temp1,rnum,word,remark,ip,u_qq,u_email,u_url,u_popedom
dim nummer,nums,rssum,page,viewpage,thepages,pageurl,nnum,replyid,fm_15,is_recycle
is_recycle=false
pageurl="?forum_id=&view_id=&"
nummer=dim_num(1)
replyid=0
fm_15=format_mid_num(15)
ftit="浏览主题"
sql="select top 1 forum_id,topic,counter,re_counter,islock,istop,isgood,isvote,vote_num,form_id from bbs_topic where id="&viewid
set rs=joekoe_cms.exec(sql,1)
if rs.eof then
rs.close
call format_redirect("forum_list.asp?forum_id="&forumid)
end if
forumid=rs(0)
fir_topic=joekoe_cms.code_html(rs(1),1,0)
counter=rs(2)
re_counter=rs(3)
fir_islock=rs(4)
fir_istop=rs(5)
fir_isgood=rs(6)
fir_isvote=rs(7)
fir_vote_num=rs(8)
if trim(request.querystring("recycle"))="yes" then
forumid=rs(9)
is_recycle=true
end if
rs.close
call forum_first()
call web_head(0,0,h_var3,0,0)
call forum_load(1,0,1,1)
if is_recycle=true then
if login_mode<>"admin" then call format_redirect("forum_list.asp?forum_id="&forumid)
end if
if is_recycle=true then pageurl=pageurl&"recycle=yes&"
response.write joekoe_cms.js_put("style/data_ads_txt_forum.js",0)
response.write joekoe_cms.js_put("style/ads_txt_function.js",0)
5、forum_write.asp修改,红色部分为添加的
sql="insert into bbs_topic (forum_id,username,userid,topic,tcolor,tbb,icon,counter,tim,re_username,re_counter,re_tim,istop,islock,isgood,isvote,vote_num,form_id) " & _
"values ("&forumid&",'"&login_username&"',"&login_id&",'"&topic&"','"&tcolor&"',"&tbb&",'"&icon&"',0,'"&joekoe_cms.now_time&"','"&login_username&"',0,'"&joekoe_cms.now_time&"',"&nistop&","&nislock&","&nisgood&","&is_vote&",0,0)"
6、找个自己认为合适的地方加个回收站的链接指向forum_recycle.asp
定义 forum_id<>999999999
评论: 7 | 引用: 0 | 查看次数: 619
发表评论