BVB Source Codes

Pcook CMS bubble guest v3.0 SDCMS version Show sdcms_class.asp Source code

Return Download Pcook CMS bubble guest v3.0 SDCMS version: download sdcms_class.asp Source code - Download Pcook CMS bubble guest v3.0 SDCMS version Source code - Type:.asp
  1. <!--#include file="sdcms_check.asp"-->
  2. <%
  3. set sdcms=new Sdcms_Admin
  4. sdcms.Check_admin
  5. sdcms.Check_lever 5
  6. set sdcms=nothing
  7. select case action
  8. case "add":title="添加分类"
  9. case "edit":title="修改分类"
  10. case "batch":title="批量设置"
  11. case else:title="分类管理"
  12. end select
  13. sd_table="sd_class"
  14. followid=trim(request("followid"))
  15. ordnum=trim(request("ordnum"))
  16. sdcms_head
  17. Function clear_bad(t0)
  18. clear_bad=Replace(t0,"""","")
  19. End Function
  20. %>
  21. <div class="sdcms_notice"><span>管理操作:</span><a href="?action=add">添加分类</a> ┊ <a href="?">分类管理</a> ┊ <a href="?action=batch">批量设置</a></div>
  22. <br>
  23. <ul id="sdcms_sub_title">
  24.         <li class="sub"><%=title%></li>
  25. </ul>
  26. <div id="sdcms_right_b">
  27. <%
  28. select case action
  29. case "add":add
  30. case "edit":edit
  31. case "batch":batch
  32. case "batchsave":batchsave
  33. case "save":save
  34. case "make_c_list":make_c_list
  35. case "up":up
  36. case "down":down
  37. case "del":del
  38. case else:main
  39. end select
  40. sub main
  41. %>
  42.   <table border="0" align="center" cellpadding="3" cellspacing="1" class="table_b">
  43.     <tr>
  44.       <td width="30" class="title_bg">ID</td>
  45.       <td class="title_bg">名称</td>
  46.       <td class="title_bg">排序</td>
  47.       <td class="title_bg">管理</td>
  48.     </tr>
  49. <%sdsort(0)%>
  50.   </table>
  51. <%
  52. end sub
  53. sub add
  54. check_info
  55. %>
  56.   <table width="98%" border="0" align="center" cellpadding="3" cellspacing="1">
  57.   <form name="add" method="post" action="?action=save&act=add" onSubmit='return checkadd()'>
  58.     <tr>
  59.       <td width="12%" align="center" class="tdbg">分类名称:      </td>
  60.       <td class="tdbg"><input name='title' class="input" type='text' id='title' size='30' maxlength='50'></td>
  61.     </tr>
  62.         <tr>
  63.       <td align="center" class="tdbg">生成目录:      </td>
  64.       <td class="tdbg"><input type='text' name='classname' class="input" maxlength='50' style='ime-mode:disabled' onselectstart='return false'  onpaste='return false'> <span>只能是字母或字母和数字的组合,不能重复,不可更改</span></td>
  65.     </tr>
  66.     <tr class="tdbg">
  67.       <td align="center">类别选择:</td>
  68.       <td>        <select name="classid" >
  69.           <option value='0' >作为一级分类</option>
  70. <%ssort(0)%>
  71.         </select></td>
  72.     </tr>
  73.         <tr class="tdbg">
  74.       <td align="center">首页模板:</td>
  75.       <td>   <select name='indexshow'><option value='0'>不启用频道首页</option>
  76.                 <%set temprs=conn.execute("select id,title from sd_temp where classid=0 order by id desc")
  77.                 while not temprs.eof
  78.                 echo "<option value='"&temprs(0)&"'>"&temprs(1)&"</option>"
  79.                 temprs.movenext
  80.                 wend%></select>
  81.           </td>
  82.     </tr>
  83.     <tr class="tdbg">
  84.       <td align="center">列表模板:</td>
  85.       <td>   <select name='listshow'>
  86.           <option value='-1'>默认文字式</option>
  87.           <option value='0'>默认图片式</option>
  88.           <%set temprs=conn.execute("select id,title from sd_temp where classid=1 order by id desc")
  89. while not temprs.eof
  90. echo "<option value='"&temprs(0)&"'>"&temprs(1)&"</option>"
  91. temprs.movenext
  92. wend%></select>
  93.           </td>
  94.     </tr>
  95.         <tr class="tdbg">
  96.       <td align="center">页面模板:</td>
  97.       <td>   <select name='infoshow'><option value='0'>默认模板</option>
  98.           <%set temprs=conn.execute("select id,title from sd_temp where classid=2 order by id desc")
  99. while not temprs.eof
  100. echo "<option value='"&temprs(0)&"'>"&temprs(1)&"</option>"
  101. temprs.movenext
  102. wend%></select>
  103.           </td>
  104.     </tr>
  105.         <tr>
  106.       <td align="center" class="tdbg">每页数量:      </td>
  107.       <td class="tdbg"><input name='t1' value="20" class="input" type='text' id='t1' size='30' maxlength='3' onKeyUp="value=value.replace(/[^\d]/g,'');"  onbeforepaste="clipboardData.setData('text',clipboardData.getData('text').replace(/[^\d]/g,''));"></td>
  108.     </tr>
  109.         <tr>
  110.       <td align="center" class="tdbg">关 键 字:      </td>
  111.       <td class="tdbg"><textarea name="keyword" cols="60" rows="4" class="inputs"></textarea></td>
  112.     </tr>
  113.         <tr>
  114.       <td align="center" class="tdbg">描  述:      </td>
  115.       <td class="tdbg"><textarea name="t0" cols="60" rows="4" class="inputs"></textarea><br><%all_set="生成分类|生成地图":all_set=split(all_set,"|"):for i=0 to ubound(all_set)%><input name="up<%=i+1%>" type="checkbox" value="1" <%if instr(", "&sdcms_create_set&", ",", "&i+4&", ")>0 then echo "checked"%> id="<%=i+4%>"><label for="<%=i+4%>"><%=all_set(i)%></label><%next%></td>
  116.     </tr>
  117.     <tr class="tdbg">
  118.           <td>&nbsp;</td>
  119.       <td><input name="Submit" type="submit" class="bnt" value="保 存">
  120.         <input name="Submit23" type="button" onClick="history.go(-1)" class="bnt" value="返 回"></td>
  121.     </tr>
  122.         </form>
  123.   </table>
  124. <%
  125. end sub
  126. sub edit
  127. set rs=conn.execute("select title,indexshow,listshow,infoshow,keyword,class_desc,pagenum from "&sd_table&" where id="&id&"")
  128. if rs.eof then
  129. echo "请勿非法提交参数":Died
  130. end if
  131. %>
  132.   <table width="98%" border="0" align="center" cellpadding="3" cellspacing="1">
  133.   <form method="post" action="?action=save&act=save&id=<%=id%>">
  134.         <tr>
  135.       <td width="12%" align="center" class="tdbg">分类名称:      </td>
  136.       <td class="tdbg"><input name='title' value="<%=rs(0)%>" class="input" type='text' id='title' size='30' maxlength='50'></td>
  137.     </tr>
  138.         <tr class="tdbg">
  139.       <td align="center">首页模板:</td>
  140.       <td>   <select name='indexshow'><option value='0'>不启用频道首页</option>
  141.           <%set temprs=conn.execute("select id,title from sd_temp where classid=0 order by id desc")
  142. while not temprs.eof
  143. echo "<option value='"&temprs(0)&"' "&w_select(rs(1),temprs(0))&">"&temprs(1)&"</option>"
  144. temprs.movenext
  145. wend%></select>
  146.           </td>
  147.     </tr>
  148.     <tr class="tdbg">
  149.       <td align="center">列表模板:</td>
  150.       <td>   <select name='listshow'>
  151.           <option value='-1' <%=w_select(rs(2),-1)%>>默认文字式</option>
  152.           <option value='0' <%=w_select(rs(2),0)%>>默认图片式</option>
  153.           <%set temprs=conn.execute("select id,title from sd_temp where classid=1 order by id desc")
  154. while not temprs.eof
  155. echo "<option value='"&temprs(0)&"' "&w_select(rs(2),temprs(0))&">"&temprs(1)&"</option>"
  156. temprs.movenext
  157. wend%></select>
  158.           </td>
  159.     </tr>
  160.         <tr class="tdbg">
  161.       <td align="center">页面模板:</td>
  162.       <td>   <select name='infoshow'><option value='0'>默认模板</option>
  163.           <%set temprs=conn.execute("select id,title from sd_temp where classid=2 order by id desc")
  164. while not temprs.eof
  165. echo "<option value='"&temprs(0)&"' "&w_select(rs(3),temprs(0))&">"&temprs(1)&"</option>"
  166. temprs.movenext
  167. wend%></select>
  168.           </td>
  169.     </tr>
  170.         <tr>
  171.       <td align="center" class="tdbg">每页数量:      </td>
  172.       <td class="tdbg"><input name='t1' value="<%=rs(6)%>" class="input" type='text' id='t1' size='30' maxlength='3' onKeyUp="value=value.replace(/[^\d]/g,'');"  onbeforepaste="clipboardData.setData('text',clipboardData.getData('text').replace(/[^\d]/g,''));"></td>
  173.     </tr>
  174.         <tr>
  175.       <td align="center" class="tdbg">关 键 字:      </td>
  176.       <td class="tdbg"><textarea name="keyword" cols="60" rows="4" class="inputs"><%=rs(4)%></textarea></td>
  177.     </tr>
  178.         <tr>
  179.       <td align="center" class="tdbg">描  述:      </td>
  180.       <td class="tdbg"><textarea name="t0" cols="60" rows="4" class="inputs"><%=rs(5)%></textarea><br><%all_set="生成分类|生成地图":all_set=split(all_set,"|"):for i=0 to ubound(all_set)%><input name="up<%=i+1%>" type="checkbox" value="1" <%if instr(", "&sdcms_create_set&", ",", "&i+4&", ")>0 then echo "checked"%> id="<%=i+4%>"><label for="<%=i+4%>"><%=all_set(i)%></label><%next%></td>
  181.     </tr>
  182.     <tr class="tdbg">
  183.           <td>&nbsp;</td>
  184.       <td><input name="Submit" type="submit" class="bnt" value="保 存">
  185.         <input name="Submit232" type="button" onClick="history.go(-1)" class="bnt" value="返 回"></td>
  186.     </tr>
  187.         </form>
  188.   </table>
  189. <%
  190. end sub
  191. sub batch
  192. %>
  193.   <table width="98%" border="0" align="center" cellpadding="3" cellspacing="1">
  194.   <form name="add" method="post" action="?action=batchsave" onSubmit='return checkadd()'>
  195.     <tr>
  196.       <td width="12%" align="center">类别选择:</td>
  197.       <td><select name="t0" size="10" multiple="multiple" id="t0" style="width:60%;"><%ssort(0)%>
  198.         </select>
  199.       </td>
  200.     </tr>
  201.         <tr class="tdbg">
  202.       <td align="center"><input name="up1" id="up1" type="checkbox" value="1" checked="checked" /><label for="up1">首页模板:</label></td>
  203.       <td>   <select name='t1'><option value='0'>不启用频道首页</option>
  204.           <%set temprs=conn.execute("select id,title from sd_temp where classid=0 order by id desc")
  205. while not temprs.eof
  206. echo "<option value='"&temprs(0)&"'>"&temprs(1)&"</option>"
  207. temprs.movenext
  208. wend%></select>
  209.           </td>
  210.     </tr>
  211.     <tr class="tdbg">
  212.       <td align="center"><input name="up2" id="up2" type="checkbox" value="1" checked="checked" /><label for="up2">列表模板:</label></td>
  213.       <td>   <select name='t2'>
  214.           <option value='-1'>默认文字式</option>
  215.           <option value='0'>默认图片式</option>
  216.           <%set temprs=conn.execute("select id,title from sd_temp where classid=1 order by id desc")
  217. while not temprs.eof
  218. echo "<option value='"&temprs(0)&"'>"&temprs(1)&"</option>"
  219. temprs.movenext
  220. wend%></select>
  221.           </td>
  222.     </tr>
  223.         <tr class="tdbg">
  224.       <td align="center"><input name="up3" id="up3" type="checkbox" value="1" checked="checked" /><label for="up3">页面模板:</label></td>
  225.       <td>   <select name='t3'><option value='0'>默认模板</option>
  226.           <%set temprs=conn.execute("select id,title from sd_temp where classid=2 order by id desc")
  227. while not temprs.eof
  228. echo "<option value='"&temprs(0)&"'>"&temprs(1)&"</option>"
  229. temprs.movenext
  230. wend%></select>
  231.           </td>
  232.     </tr>
  233.     <tr>
  234.       <td align="center" class="tdbg"><input name="up4" type="checkbox" id="up4" value="1" checked="checked" />
  235.       <label for="up4">关键字:</label></td>
  236.       <td class="tdbg"><textarea name="t4" cols="60" rows="4" class="inputs"></textarea></td>
  237.     </tr>
  238.         <tr>
  239.       <td align="center" class="tdbg"><input name="up5" type="checkbox" id="up5" value="1" checked="checked" />
  240.       <label for="up5">描 述:</label></td>
  241.       <td class="tdbg"><textarea name="t5" cols="60" rows="4" class="inputs"></textarea></td>
  242.     </tr>
  243.     <tr class="tdbg">
  244.           <td align="center"><span style="font-weight: bold">勾选的才更新</span></td>
  245.       <td><input name="Submit" type="submit" class="bnt" value="保 存">
  246.         <input name="Submit23" type="button" onClick="history.go(-1)" class="bnt" value="返 回"></td>
  247.     </tr>
  248.         </form>
  249.   </table>
  250. <%
  251. end sub
  252. sub save
  253. title=trim(request("title"))
  254. classid=trim(request("classid"))
  255. indexshow=trim(request("indexshow"))
  256. listshow=trim(request("listshow"))
  257. infoshow=trim(request("infoshow"))
  258. keyword=trim(request("keyword"))
  259. classname=dir_check(trim(request("classname")))
  260. t0=clear_bad(trim(request("t0")))
  261. t1=trim(request("t1"))
  262. 'visited=trim(request("visited"))
  263. act=trim(request("act"))
  264. up1=trim(request("up1"))
  265. up2=trim(request("up2"))
  266. sys_dir="admin|inc|editor|data|upfile|skins|plug|other|notice"
  267. sys_dir=split(sys_dir,"|")
  268. for i=0 to ubound(sys_dir)
  269.  if classname=""&sys_dir(i)&"" then echo "此目录为系统目录,请换其他的试试!":Died
  270. next
  271.  
  272. set rs=server.CreateObject("adodb.recordset")
  273. sql="select title,followid,ordnum,listshow,infoshow,keyword,filename,indexshow,class_desc,id,pagenum from "&sd_table&""
  274. if act="add" then
  275. sql=sql&" where filename='"&classname&"'"
  276. else
  277. sql=sql&" where id="&id&""
  278. end if
  279. rs.open sql,conn,1,3
  280. if act="add" then
  281.         if not rs.eof then
  282.                 echo "该类别的目录名称已存在,请换个试试!":Died
  283.         end if
  284.         rs.addnew
  285. else
  286.         rs.update
  287. end if
  288. rs(0)=title
  289. if act="add" then
  290. rs(1)=classid
  291.   if classid<>0 then
  292.     set rs2=conn.execute("select top 1 ordnum from "&sd_table&" where followid="&classid&" order by ordnum desc")
  293.       if rs2.eof and rs2.bof then
  294.                   ordnum1=1
  295.       else
  296.         if rs2(0)<>"" then
  297.         ordnum1=rs2(0)+1
  298.         else
  299.         ordnum1=1
  300.       end if
  301.   end if
  302.  rs(2)=ordnum1
  303.  else
  304.     set rs1=conn.execute("select top 1 ordnum from "&sd_table&" where followid=0 order by ordnum desc")
  305.      if rs1.eof then
  306.                  ordnum1=1
  307.      else
  308.        if rs1(0)<>"" then
  309.        ordnum1=rs1(0)+1
  310.        else
  311.        ordnum1=1
  312.        end if
  313.      end if
  314.         rs(2)=ordnum1
  315.   end if
  316. end if  
  317. rs(3)=listshow
  318. rs(4)=infoshow
  319. rs(5)=keyword
  320. if act="add" then
  321. rs(6)=classname
  322. end if
  323. rs(7)=indexshow
  324. rs(8)=t0
  325. if isnumeric(t1) then
  326. rs(10)=t1
  327. end if
  328. rs.update
  329. if act="save" then
  330. remove_app(sdcms_cookies&rs(9))
  331. end if
  332. id=rs(9)
  333. remove_app id
  334. if act="add" then
  335. '更新类别绝对路径,并建立文件夹
  336. set sdcms_f=new sdcms_function
  337.         if classid=0 then
  338.                 partent_dir=classname&"/"
  339.                 conn.execute("update "&sd_table&" set classdir='"&partent_dir&"' where id="&id&"")
  340.                 sdcms_f.Create_upfile sdcms_root&sdcms_htmdir&classname
  341.         else
  342.                 partent_dir=sdcms_f.LoadRecord("classdir",sd_table,classid)&classname&"/"
  343.                 conn.execute("update "&sd_table&" set classdir='"&partent_dir&"' where id="&id&"")
  344.                 sdcms_f.Create_upfile sdcms_root&sdcms_htmdir&partent_dir
  345.         end if
  346. set sdcms_f=nothing
  347. end if
  348. if act="add" then
  349.         this_id=id
  350.         if classid=0 then
  351.            conn.execute("update  "&sd_table&" set allclassid='"&this_id&"',partentid='"&this_id&"' where id="&this_id&"")
  352.         else
  353.            conn.execute("update "&sd_table&" set class_num=class_num+1 where id="&classid&"")
  354.         '计算分类之间的关系,将下级分类id添加到上级id中去
  355.          conn.execute("update  "&sd_table&" set allclassid='"&this_id&"',partentid='"&this_id&"' where id="&this_id&"")
  356.          set rs1=conn.execute("select partentid from "&sd_table&" where id="&classid&"")
  357.          partent_id=this_id&","&rs1(0)
  358.          conn.execute("update "&sd_table&" set partentid='"&partent_id&"'  where id="&this_id&"")
  359.         '向父目录中添加子目录的id号,先检测是否存在,存在就跳过
  360.         add_classid this_id,classid
  361.         end if
  362.         if len(up1&up2)>0 then
  363.                 set sdcms_c=new sdcms_create
  364.                 if len(up1)>0 then sdcms_c.Create_class_list id
  365.                 if len(up2)>0 then sdcms_c.Create_map
  366.                 set sdcms_c=nothing
  367.         end if
  368.         conn.execute("Insert into sd_log (sdcms_name,ip,content) values('"&sdcms_adminname&"','"&sdcms_adminip&"','添加类别:"&title&"')")
  369.         echo "添加成功":Died
  370. else
  371.     if len(up1&up2)>0 then
  372.                 set sdcms_c=new sdcms_create
  373.                 if len(up1)>0 then sdcms_c.Create_class_list id
  374.                 if len(up2)>0 then sdcms_c.Create_map
  375.                 set sdcms_c=nothing
  376.         end if
  377.         conn.execute("Insert into sd_log (sdcms_name,ip,content) values('"&sdcms_adminname&"','"&sdcms_adminip&"','修改类别:"&title&"')")
  378.         echo "修改成功":Died
  379. end if
  380.  
  381. end sub
  382.  
  383. sub batchsave
  384. t0=trim(request("t0"))
  385. t1=trim(request("t1"))
  386. t2=trim(request("t2"))
  387. t3=trim(request("t3"))
  388. t4=trim(request("t4"))
  389. t5=trim(request("t5"))
  390. up1=trim(request("up1"))
  391. up2=trim(request("up2"))
  392. up3=trim(request("up3"))
  393. up4=trim(request("up4"))
  394. up5=trim(request("up5"))
  395. if t0="" then   echo "<script>alert('至少选择一个类别');location.href='?action=batch';</script>":Died
  396. if instr(t0,", ")>0 then
  397. t00=split(t0,", ")
  398.         for i=0 to ubound(t00)
  399.         if len(up1&up2&up3&up4&up5)>0 then
  400.                 set rs=server.CreateObject("adodb.recordset")
  401.                 sql="select indexshow,listshow,infoshow,keyword,class_desc from "&sd_table&" where id="&t00(i)&""
  402.                 rs.open sql,conn,1,3
  403.                 rs.update
  404.                 if len(up1)>0 then rs(0)=t1
  405.                 if len(up2)>0 then rs(1)=t2
  406.                 if len(up3)>0 then rs(2)=t3
  407.                 if len(up4)>0 then rs(3)=t4
  408.                 if len(up5)>0 then rs(4)=t5
  409.                 rs.update
  410.         end if
  411.         next
  412. else
  413.         if len(up1&up2&up3&up4&up5)>0 then
  414.                 set rs=server.CreateObject("adodb.recordset")
  415.                 sql="select indexshow,listshow,infoshow,keyword,class_desc from "&sd_table&" where id="&t0&""
  416.                 rs.open sql,conn,1,3
  417.                 rs.update
  418.                 if len(up1)>0 then rs(0)=t1
  419.                         if len(up2)>0 then rs(1)=t2
  420.                         if len(up3)>0 then rs(2)=t3
  421.                         if len(up4)>0 then rs(3)=t4
  422.                         if len(up5)>0 then rs(4)=t5
  423.                 rs.update
  424.         end if
  425. end if
  426.         echo "<script>alert('设置成功');location.href='?';</script>"
  427. end sub
  428.  
  429. sub del
  430. set rs=conn.execute("select class_num,followid,classdir from "&sd_table&" where id="&id&"")
  431. if rs(0)>0 then
  432. echo "不能删除有下级分类的分类":Died
  433. else
  434. conn.execute("Insert into sd_log (sdcms_name,ip,content) values('"&sdcms_adminname&"','"&sdcms_adminip&"','删除分类:"&conn.execute("select title from "&sd_table&" where id="&id&"")(0)&"')")
  435. conn.execute("update "&sd_table&" set class_num=class_num-1 where id="&rs(1)&"")
  436. set sdcms_f=new sdcms_Function
  437. sdcms_f.Delfile sdcms_root&sdcms_htmdir&rs(2)
  438. set sdcms_f=nothing
  439. conn.execute("delete from "&sd_table&" where id="&id&"")
  440. conn.execute("delete from sd_info where classid="&id&"")
  441. '严格意义上来讲,这里还应该更新下全站,暂时先空着
  442.  
  443. end if
  444. 'create_index
  445. response.Redirect("?")
  446. end sub
  447.  
  448. sub up
  449. sql="select top 1 id,ordnum from "&sd_table&" where followid="&followid&"   and ordnum>"&ordnum&" order by ordnum"
  450. set rs=conn.execute(sql)
  451. if not rs.eof then
  452. conn.execute("update "&sd_table&" set ordnum="&rs(1)&" where id="&id&"")
  453. conn.execute("update "&sd_table&" set ordnum="&rs(1)&"-1 where id="&rs(0)&"")
  454. end if
  455. response.redirect("?")
  456. end sub
  457.  
  458. sub down
  459. sql="select top 1 id,ordnum from "&sd_table&" where followid="&followid&"   and ordnum<"&ordnum&" order by ordnum desc"
  460. set rs=conn.execute(sql)
  461. if not rs.eof then
  462. conn.execute("update "&sd_table&" set ordnum="&rs(1)&" where id="&id&"")
  463. conn.execute("update "&sd_table&" set ordnum="&rs(1)&"+1 where id="&rs(0)&"")
  464. end if
  465. response.redirect("?")
  466. end sub
  467.  
  468. dim ii
  469. ii=0
  470. sub sdsort(selec)
  471. with response
  472. if session(sdcms_cookies&"sdcms_admin")=1 then
  473. sql="Select id,title,ordnum,followid,classdir,indexshow From ["&sd_table&"] where followid="&selec&"  order by ordnum desc"
  474. else
  475.  if selec=0  then
  476.    sql="Select id,title,ordnum,followid,classdir,indexshow From ["&sd_table&"] where  "
  477.    if session(sdcms_cookies&"sdcms_infolever")<>"" then
  478.    sql=sql&" id in ("&session(sdcms_cookies&"sdcms_infolever")&") and followid="&selec&" order by ordnum desc"
  479.    else
  480.    sql=sql&"  followid<"&selec&" order by ordnum desc"
  481.    end if
  482.  else
  483. sql="Select id,title,ordnum,followid,classdir,indexshow From ["&sd_table&"] where followid="&selec&"  order by ordnum desc"
  484.  
  485.  end if
  486. end if
  487. Set Rs1=Conn.Execute(sql)
  488. do while not rs1.eof
  489. .write(" <tr  onmouseover=this.bgColor='#EBFFDC'; onmouseout=this.bgColor='#ffffff';  bgcolor='#ffffff'>")
  490. .write("      <td align='center' >"&rs1(0)&"</td>")
  491. .write("      <td >&nbsp;")
  492. if selec<>0 then
  493. .write(""&string(ii," ")&" ")
  494. set rsn=conn.execute("select max(ordnum),min(ordnum) from "&sd_table&" where followid="&Rs1(3)&"")
  495. if rs1(2)=rsn(0) and rs1(2)=rsn(1) then
  496. .write(" └")
  497. elseif rs1(2)=rsn(0) and rs1(2)>rsn(1) then
  498. .write(" ├")
  499. elseif rs1(2)<rsn(0) and rs1(2)=rsn(1) then
  500. .write(" └")
  501. elseif rs1(2)<rsn(0) and rs1(2)>rsn(1) then
  502. .write(" ├")
  503. rsn.close
  504. end if
  505. end if
  506. .write("&nbsp;<a href="""&sdcms_root&sdcms_htmdir&rs1(4)&""" target=""_blank"">"&rs1(1)&"")
  507. .write("          </td>")
  508. .write("      <td>"&string(ii," ")&"<a href='?action=up&id="&rs1(0)&"&ordnum="&rs1(2)&"&followid="&rs1(3)&"'>上升</a> <a href='?action=down&id="&rs1(0)&"&ordnum="&rs1(2)&"&followid="&rs1(3)&"'>下降</a></td>")
  509. .write("      <td  align='center'><a href='?action=add&id="&rs1(0)&"'>添加下级分类</a> <a href='?action=edit&id="&rs1(0)&"'>编辑</a> <a href='?action=del&id="&rs1(0)&"' onclick='return confirm(""真的要删除?不可恢复!"");'>删除</a> <a href='?action=make_c_list&id="&rs1(0)&"'>生成</a></td>")
  510. .write("</tr>")
  511. ii=ii+1
  512. sdsort rs1(0)
  513. ii=ii-1
  514. rs1.Movenext
  515. loop
  516. Set Rs1 = Nothing
  517. end with
  518. end sub
  519. dim iii
  520. iii=0
  521. sub ssort(t)
  522. with response
  523. if session(sdcms_cookies&"sdcms_admin")=1 then
  524. sql="Select id,title,ordnum,followid From ["&sd_table&"] where followid="&t&"  order by ordnum desc"
  525. else
  526. if t=0 then
  527.    sql="Select id,title,ordnum,followid From ["&sd_table&"] where  "
  528.    if session(sdcms_cookies&"sdcms_infolever")<>"" then
  529.    sql=sql&" id in ("&session(sdcms_cookies&"sdcms_infolever")&") and followid="&t&" order by ordnum desc"
  530.    else
  531.    sql=sql&"  followid<"&t&" order by ordnum desc"
  532.    end if
  533.  else
  534. sql="Select id,title,ordnum,followid From [sd_class] where followid="&t&"   order by ordnum desc"
  535.  
  536.  end if
  537. end if
  538.  Set rs1=Conn.Execute(sql)
  539. do while not rs1.eof
  540. .write("<option value='"&rs1(0)&"' ")
  541. if id=""&rs1(0)&"" then
  542. .write("selected")
  543. end if
  544. .write(">")
  545. if t<>0 then
  546. .write(""&string(iii," ")&" ")
  547. set rsn=conn.execute("select max(ordnum),min(ordnum) from "&sd_table&" where followid="&Rs1(3)&"")
  548. if rs1(2)=rsn(0) and rs1(2)=rsn(1) then
  549. .write("└")
  550. elseif rs1(2)=rsn(0) and rs1(2)>rsn(1) then
  551. .write("├")
  552. elseif rs1(2)<rsn(0) and rs1(2)=rsn(1) then
  553. .write("└")
  554. elseif rs1(2)<rsn(0) and rs1(2)>rsn(1) then
  555. .write("├")
  556. rsn.close
  557. end if
  558. end if
  559. .write("&nbsp;"&rs1(1)&"</option>")
  560. iii=iii+1
  561. ssort rs1(0)
  562. iii=iii-1
  563. rs1.Movenext
  564. loop
  565. Set Rs1 = Nothing
  566. end with
  567. end sub
  568.  
  569. '向上级分类中添加子目录的id
  570. sub add_classid(this_id,classid)
  571. partent_id=conn.execute("select allclassid from "&sd_table&" where id="&classid&"")(0)
  572.    if not instr(partent_id,this_id)>0 then
  573.     partent=partent_id&","&this_id
  574.       conn.execute("update "&sd_table&" set allclassid='"&partent&"' where id="&classid&" ")
  575.            set rs1=conn.execute("select followid from "&sd_table&" where id="&classid&"")
  576.             if rs1(0)<>0 then
  577.             add_classid this_id,rs1(0)
  578.            end if  
  579.   end if
  580. end sub
  581.  
  582. sub make_c_list
  583.         set sdcms_c=new sdcms_create
  584.         conn.execute("Insert into sd_log (sdcms_name,ip,content) values('"&sdcms_adminname&"','"&sdcms_adminip&"','生成分类:编号为"&request("id")&"')")
  585.             if clng(request("id"))<>0 then
  586.                 tj="where id="&id&" "
  587.                 end if
  588.             set rs_c=conn.execute("select id from sd_class "&tj&" order by id ")
  589.                 while not rs_c.eof
  590.                         sdcms_c.Create_class_list rs_c(0)
  591.                         response.Flush()
  592.                 rs_c.movenext
  593.                 wend
  594.         set sdcms_c=nothing
  595.         echo "生成完毕"
  596. end sub
  597.  
  598. sub check_info
  599. with response
  600. .write("        <script>")
  601. .write("        function checkadd()")
  602. .write("        {")
  603. .write("        if (document.add.title.value=='')")
  604. .write("        {")
  605. .write("        alert('分类名称不能为空');")
  606. .write("        document.add.title.focus();")
  607. .write("        return false")
  608. .write("        }")
  609. .write("        if (document.add.classname.value=='')")
  610. .write("        {")
  611. .write("        alert('生成的目录不能为空');")
  612. .write("        document.add.classname.focus();")
  613. .write("        return false")
  614. .write("        }")
  615. .write("        }")
  616. .write("        </script>")
  617. end with
  618. end sub
  619. %>  
  620. </div>
  621. </body>
  622. </html>
downloadsdcms_class.asp Source code - Download Pcook CMS bubble guest v3.0 SDCMS version Source code
Related Source Codes/Software:
Oo 126 CMS movie site system - This procedure ASP + ACC/ASP + SQL, using new kern... 2016-09-21
IDC sales web site - Beautiful IDC sales web site source code 2016-09-21
NPOINT virtual host v1.7.0 formal version management system - The system main function is introduced 2016-09-21
Classified information network business in suzhou - Overall module: classification of supply and deman... 2016-09-21
Jie Yang v0.6.3 article system - System functions: 1, the system settings A confi... 2016-09-21
Age design website information management system SDCMS v1.1 SP1 - SDCMS is designed to build the information managem... 2016-09-21
Age design website information management system SDCMS v1.1 SP1 - SDCMS is designed to build the information managem... 2016-09-21
C9 v2.1.1 static post system - Program USES ASP + ACC structure design and develo... 2016-09-21
Imitation green download station perfect version - Before increased | software home page, on the basi... 2016-09-21
Subdomain hosting edition v1.9 s taobao, pat - The background site admin 2016-09-21
CRYENGINE - CRYENGINE is a powerful real-time game development... 2017-06-11
postal - 2017-06-11
reactide - Reactide is the first dedicated IDE for React web ... 2017-06-11
rkt - rkt is a pod-native container engine for Linux. It... 2017-06-11
uWebSockets - Tiny WebSockets https://for... 2017-06-11
realworld - TodoMVC for the RealWorld - Exemplary fullstack Me... 2017-06-11
goreplay - GoReplay is an open-source tool for capturing and ... 2017-06-10
pyenv - Simple Python version management 2017-06-10
redux-saga - An alternative side effect model for Redux apps ... 2017-06-10
angular-starter - 2017-06-10

 Back to top