⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 manage_config.asp

📁 JTBC网站内容管理系统是一套可扩充的网站内容管理系统
💻 ASP
📖 第 1 页 / 共 2 页
字号:
<%
'****************************************************
' Jetiben CMS Power by Jetiben.com
' Email: jetiben@hotmail.com
' Web: http://www.jetiben.com/
'****************************************************
Dim nsearch

Class manage_passport_user

  Private Sub Class_Initialize()
    ncontrol = "select,lock,delete"
    nsearch = "username,id"
    ndatabase = cndatabase(ngenre, "0")
    nidfield = cnidfield(ngenre, "0")
    nfpre = cnfpre(ngenre, "0")
  End Sub

  Public Function manage_navigation()
    Dim tmpstr
    tmpstr = ireplace("manage.navigation", "tpl")
    manage_navigation = tmpstr
  End Function

  Public Sub manage_list()
    Dim search_field, search_keyword
    search_field = get_safecode(request.querystring("field"))
    search_keyword = get_safecode(request.querystring("keyword"))
    Dim tmpstr, tmpastr, tmptstr
    tmpstr = ireplace("manage.list", "tpl")
    tmpastr = ctemplate(tmpstr, "{$recurrence_ida}")
    Dim tmpary, tmprstr
    tmpary = get_xinfo_ary("sel_group.all", "sel")
    If IsArray(tmpary) Then
      Dim tmpi, thspan, tstr0, tstr1
      For tmpi = 0 To UBound(tmpary)
        tstr0 = tmpary(tmpi, 0)
        tstr1 = tmpary(tmpi, 1)
        If Not tstr0 = "" Then
          thspan = "group" & tstr0
          tmptstr = Replace(tmpastr, "{$topic}", tstr1)
          tmptstr = Replace(tmptstr, "{$ahref}", "?keyword=" & tstr0 & "&field=utype&hspan=" & thspan)
          tmptstr = Replace(tmptstr, "{$hspan}", thspan)
        End If
        tmprstr = tmprstr & tmptstr
      Next
    End If
    tmpstr = Replace(tmpstr, jtbc_cinfo, tmprstr)
    tmprstr = ""
    tmpastr = ctemplate(tmpstr, "{$recurrence_idb}")
    sqlstr = "select * from " & ndatabase & " where " & nidfield & ">0"
    If search_field = "username" Then sqlstr = sqlstr & " and " & cfname("username") & " like '%" & search_keyword & "%'"
    If search_field = "id" Then sqlstr = sqlstr & " and " & nidfield & "=" & get_num(search_keyword, 0)
    If search_field = "lock" Then sqlstr = sqlstr & " and " & cfname("lock") & "=" & get_num(search_keyword, 0)
    If search_field = "utype" Then sqlstr = sqlstr & " and " & cfname("utype") & "=" & get_num(search_keyword, 0)
    sqlstr = sqlstr & " order by " & nidfield & " desc"
    Dim jcutpage, jcuti
    Set jcutpage = New jtb_cutpage
    jcutpage.perpage = npagesize
    jcutpage.sqlstr = sqlstr
    jcutpage.cutpage
    Set rs = jcutpage.pagers
    Dim tmpusername, font_disabled
    font_disabled = itake("global.tpl_config.font_disabled", "tpl")
    For jcuti = 1 To npagesize
      If Not rs.EOF Then
        tmpusername = get_str(rs(cfname("username")))
        If rs(cfname("lock")) = 1 Then tmpusername = Replace(font_disabled, "{$explain}", tmpusername)
        tmptstr = Replace(tmpastr, "{$username}", tmpusername)
        tmptstr = Replace(tmptstr, "{$usernamestr}", urlencode(get_str(rs(cfname("username")))))
        tmptstr = Replace(tmptstr, "{$email}", get_str(rs(cfname("email"))))
        tmptstr = Replace(tmptstr, "{$sex}", itake("global.sel_sex." & get_str(rs(cfname("sex"))), "sel"))
        tmptstr = Replace(tmptstr, "{$old}", get_str(rs(cfname("old"))))
        tmptstr = Replace(tmptstr, "{$time}", get_str(rs(cfname("time"))))
        tmptstr = Replace(tmptstr, "{$group}", itake("sel_group." & get_str(rs(cfname("utype"))), "sel"))
        tmptstr = Replace(tmptstr, "{$id}", get_str(rs(nidfield)))
        rs.movenext
        tmprstr = tmprstr & tmptstr
      End If
    Next
    tmpstr = Replace(tmpstr, "{$cpagestr}", jcutpage.pagestr)
    Set rs = Nothing
    Set jcutpage = Nothing
    tmpstr = Replace(tmpstr, jtbc_cinfo, tmprstr)
    response.write tmpstr
  End Sub

  Public Sub manage_add()
    Dim tmpstr
    tmpstr = ireplace("manage.add", "tpl")
    response.write tmpstr
  End Sub

  Public Sub manage_edit()
    Dim tid, tbackurl
    tid = get_num(request.querystring("id"), 0)
    tbackurl = get_safecode(request.querystring("backurl"))
    sqlstr = "select * from " & ndatabase & " where " & nidfield & "=" & tid
    Set rs = conn.Execute(sqlstr)
    If Not rs.EOF Then
      Dim tmpstr, tmpi, tmpfields, tmpfieldsvalue
      tmpstr = itake("manage.edit", "tpl")
      For tmpi = 0 To rs.fields.Count - 1
        tmpfields = rs.fields(tmpi).Name
        tmpfieldsvalue = get_str(rs(tmpfields))
        tmpstr = Replace(tmpstr, "{$" & Replace(tmpfields, nfpre, "") & "}", htmlencode(tmpfieldsvalue))
      Next
      tmpstr = Replace(tmpstr, "{$id}", get_str(rs(nidfield)))
      tmpstr = creplace(tmpstr)
      response.write tmpstr
    Else
      Call jtb_cms_admin_msg(itake("global.lng_public.not_exist", "lng"), tbackurl, 0)
    End If
    rs.Close
    Set rs = Nothing
  End Sub

  Public Sub manage_adddisp()
    Dim tbackurl, tmpusername
    tbackurl = get_safecode(request.querystring("backurl"))
    tmpusername = left_intercept(htmlencode(request.Form("username")), 50)
    Set rs = server.CreateObject("adodb.recordset")
    sqlstr = "select * from " & ndatabase & " where " & cfname("username") & "='" & tmpusername & "'"
    rs.open sqlstr, conn, 1, 3
    If Not rs.EOF Then
      Call jtb_cms_admin_msg(itake("global.lng_public.exist", "lng"), tbackurl, 1)
    Else
      rs.addnew
      rs(cfname("username")) = tmpusername
      rs(cfname("password")) = md5(request.Form("password"), 2)
      rs(cfname("email")) = left_intercept(htmlencode(request.Form("email")), 50)
      rs(cfname("city")) = left_intercept(htmlencode(request.Form("city")), 50)
      rs(cfname("sex")) = left_intercept(htmlencode(request.Form("sex")), 50)
      rs(cfname("old")) = left_intercept(htmlencode(request.Form("old")), 50)
      rs(cfname("name")) = left_intercept(htmlencode(request.Form("name")), 50)
      rs(cfname("qq")) = get_num(request.Form("qq"), 0)
      rs(cfname("msn")) = left_intercept(htmlencode(request.Form("msn")), 50)
      rs(cfname("phone")) = left_intercept(htmlencode(request.Form("phone")), 50)
      rs(cfname("homepage")) = left_intercept(htmlencode(request.Form("homepage")), 50)
      rs(cfname("code")) = left_intercept(htmlencode(request.Form("code")), 50)
      rs(cfname("address")) = left_intercept(htmlencode(request.Form("address")), 50)
      rs(cfname("emoney")) = get_num(request.Form("emoney"), 0)
      rs(cfname("integral")) = get_num(request.Form("integral"), 0)
      rs(cfname("utype")) = get_num(request.Form("utype"), 0)
      rs(cfname("lock")) = get_num(request.Form("lock"), 0)
      rs(cfname("forum_admin")) = get_num(request.Form("forum_admin"), 0)
      rs(cfname("face")) = get_num(request.Form("face"), 0)
      rs(cfname("face_u")) = get_num(request.Form("face_u"), 0)
      rs(cfname("face_url")) = left_intercept(get_str(request.Form("face_url")), 255)
      rs(cfname("face_width")) = get_num(request.Form("face_width"), 0)
      rs(cfname("face_height")) = get_num(request.Form("face_height"), 0)
      rs(cfname("sign")) = left_intercept(get_str(request.Form("sign")), 100)
      rs(cfname("time")) = Now()
      rs.Update
      Call jtb_cms_admin_msg(itake("global.lng_public.add_succeed", "lng"), tbackurl, 1)
    End If
    rs.Close
    Set rs = Nothing
  End Sub

  Public Sub manage_editdisp()
    Dim tid, tbackurl
    tid = get_num(request.querystring("id"), 0)
    tbackurl = get_safecode(request.querystring("backurl"))
    Set rs = server.CreateObject("adodb.recordset")
    sqlstr = "select * from " & ndatabase & " where " & nidfield & "=" & tid
    rs.open sqlstr, conn, 1, 3
    If Not rs.EOF Then
      If Not check_null(request.Form("password")) Then rs(cfname("password")) = md5(request.Form("password"), 2)
      rs(cfname("email")) = left_intercept(htmlencode(request.Form("email")), 50)
      rs(cfname("city")) = left_intercept(htmlencode(request.Form("city")), 50)
      rs(cfname("sex")) = left_intercept(htmlencode(request.Form("sex")), 50)
      rs(cfname("old")) = left_intercept(htmlencode(request.Form("old")), 50)
      rs(cfname("name")) = left_intercept(htmlencode(request.Form("name")), 50)
      rs(cfname("qq")) = get_num(request.Form("qq"), 0)
      rs(cfname("msn")) = left_intercept(htmlencode(request.Form("msn")), 50)
      rs(cfname("phone")) = left_intercept(htmlencode(request.Form("phone")), 50)
      rs(cfname("homepage")) = left_intercept(htmlencode(request.Form("homepage")), 50)
      rs(cfname("code")) = left_intercept(htmlencode(request.Form("code")), 50)
      rs(cfname("address")) = left_intercept(htmlencode(request.Form("address")), 50)
      rs(cfname("emoney")) = get_num(request.Form("emoney"), 0)
      rs(cfname("integral")) = get_num(request.Form("integral"), 0)
      rs(cfname("utype")) = get_num(request.Form("utype"), 0)
      rs(cfname("lock")) = get_num(request.Form("lock"), 0)
      rs(cfname("forum_admin")) = get_num(request.Form("forum_admin"), 0)
      rs(cfname("face")) = get_num(request.Form("face"), 0)
      rs(cfname("face_u")) = get_num(request.Form("face_u"), 0)
      rs(cfname("face_url")) = left_intercept(get_str(request.Form("face_url")), 255)
      rs(cfname("face_width")) = get_num(request.Form("face_width"), 0)
      rs(cfname("face_height")) = get_num(request.Form("face_height"), 0)
      rs(cfname("sign")) = left_intercept(get_str(request.Form("sign")), 100)
      rs.Update
      Call jtb_cms_admin_msg(itake("global.lng_public.edit_succeed", "lng"), tbackurl, 1)
    Else
      Call jtb_cms_admin_msg(itake("global.lng_public.not_exist", "lng"), tbackurl, 0)
    End If
    rs.Close
    Set rs = Nothing
  End Sub

  Private Sub Class_Terminate()
  End Sub
End Class

Class manage_passport_message

  Private Sub Class_Initialize()
    ncontrol = "select,delete"
    nsearch = "topic,addresser,recipients,id"
    ndatabase = cndatabase(ngenre, "message")
    nidfield = cnidfield(ngenre, "message")
    nfpre = cnfpre(ngenre, "message")
  End Sub

  Public Function manage_navigation()
    Dim tmpstr
    tmpstr = ireplace("message.navigation", "tpl")
    manage_navigation = tmpstr
  End Function

  Public Sub manage_list()
    Dim search_field, search_keyword
    search_field = get_safecode(request.querystring("field"))
    search_keyword = get_safecode(request.querystring("keyword"))
    Dim tmpstr, tmpastr, tmprstr, tmptstr
    tmpstr = ireplace("message.list", "tpl")
    tmpastr = ctemplate(tmpstr, "{$recurrence_ida}")
    sqlstr = "select * from " & ndatabase & " where " & nidfield & ">0"
    If search_field = "topic" Then sqlstr = sqlstr & " and " & cfname("topic") & " like '%" & search_keyword & "%'"
    If search_field = "addresser" Then sqlstr = sqlstr & " and " & cfname("addresser") & " like '%" & search_keyword & "%'"
    If search_field = "recipients" Then sqlstr = sqlstr & " and " & cfname("recipients") & " like '%" & search_keyword & "%'"
    If search_field = "read" Then sqlstr = sqlstr & " and " & cfname("read") & "=" & get_num(search_keyword, 0)
    If search_field = "id" Then sqlstr = sqlstr & " and " & nidfield & "=" & get_num(search_keyword, 0)
    sqlstr = sqlstr & " order by " & ndatabase & "." & cfname("time") & " desc"
    Dim jcutpage, jcuti
    Set jcutpage = New jtb_cutpage
    jcutpage.perpage = npagesize
    jcutpage.sqlstr = sqlstr
    jcutpage.cutpage
    Set rs = jcutpage.pagers
    Dim tmptopic, font_red
    If Not check_null(search_keyword) And search_field = "topic" Then font_red = itake("global.tpl_config.font_red", "tpl")
    For jcuti = 1 To npagesize
      If Not rs.EOF Then
        tmptopic = get_str(rs(cfname("topic")))
        If Not check_null(font_red) Then font_red = Replace(font_red, "{$explain}", search_keyword): tmptopic = Replace(tmptopic, search_keyword, font_red)
        tmptstr = Replace(tmpastr, "{$topic}", tmptopic)
        tmptstr = Replace(tmptstr, "{$topicstr}", urlencode(get_str(rs(cfname("topic")))))
        tmptstr = Replace(tmptstr, "{$addresser}", get_str(rs(cfname("addresser"))))
        tmptstr = Replace(tmptstr, "{$recipients}", get_str(rs(cfname("recipients"))))
        tmptstr = Replace(tmptstr, "{$read}", get_num(rs(cfname("read")), 0))
        tmptstr = Replace(tmptstr, "{$time}", get_date(rs(cfname("time"))))
        tmptstr = Replace(tmptstr, "{$id}", get_num(rs(nidfield), 0))
        rs.movenext
        tmprstr = tmprstr & tmptstr
      End If
    Next
    tmpstr = Replace(tmpstr, "{$cpagestr}", jcutpage.pagestr)
    Set rs = Nothing
    Set jcutpage = Nothing
    tmpstr = Replace(tmpstr, jtbc_cinfo, tmprstr)
    response.write tmpstr
  End Sub

  Public Sub manage_add()
    Dim tmpstr
    tmpstr = ireplace("message.add", "tpl")
    response.write tmpstr
  End Sub

  Public Sub manage_edit()
    Dim tid, tbackurl
    tid = get_num(request.querystring("id"), 0)
    tbackurl = get_safecode(request.querystring("backurl"))
    sqlstr = "select * from " & ndatabase & " where " & nidfield & "=" & tid
    Set rs = conn.Execute(sqlstr)
    If Not rs.EOF Then
      Dim tmpstr, tmpi, tmpfields, tmpfieldsvalue
      tmpstr = itake("message.edit", "tpl")
      For tmpi = 0 To rs.fields.Count - 1
        tmpfields = rs.fields(tmpi).Name
        tmpfieldsvalue = get_str(rs(tmpfields))
        tmpstr = Replace(tmpstr, "{$" & Replace(tmpfields, nfpre, "") & "}", htmlencode(tmpfieldsvalue))
      Next
      tmpstr = Replace(tmpstr, "{$id}", get_str(rs(nidfield)))
      tmpstr = creplace(tmpstr)
      response.write tmpstr
    Else
      Call jtb_cms_admin_msg(itake("global.lng_public.not_exist", "lng"), tbackurl, 0)
    End If
    rs.Close
    Set rs = Nothing
  End Sub

  Public Sub manage_adddisp()
    Dim tbackurl, ttopic, taddresser, tmode, trecipients1, trecipients2, tcontents, ttime, tread
    tbackurl = get_safecode(request.querystring("backurl"))
    ttopic = left_intercept(request.Form("topic"), 50)
    taddresser = left_intercept(request.Form("addresser"), 50)
    tmode = get_num(request.Form("mode"), 0)
    trecipients1 = left_intercept(request.Form("recipients1"), 1000)
    trecipients2 = left_intercept(request.Form("recipients2"), 50)
    tcontents = left_intercept(request.Form("content"), 1000)
    ttime = get_date(request.Form("time"))
    tread = get_num(request.Form("read"), 0)
    If tmode = 1 Then
      If check_null(trecipients1) Then
        Call jtb_cms_admin_msg(itake("global.lng_public.add_failed", "lng"), tbackurl, 1)
      Else
        Dim tary: tary = split(trecipients1, ",")
        Dim ti
        Set rs = server.CreateObject("adodb.recordset")
        sqlstr = "select * from " & ndatabase
        rs.open sqlstr, conn, 1, 3
        For ti = 0 to UBound(tary)
          rs.addnew
          rs(cfname("topic")) = ttopic
          rs(cfname("content")) = tcontents
          rs(cfname("read")) = tread
          rs(cfname("time")) = ttime
          rs(cfname("len")) = Len(tcontents)
          rs(cfname("addresser")) = taddresser
          rs(cfname("recipients")) = Trim(tary(ti))
          rs.update
        Next
        rs.close
        Set rs = nothing

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -