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

📄 log_lib.asp

📁 blog 程序 DIV BLOG 0.6 Readme [ http://www.IamTing.com ] DIV BLOG 0.6版更新说明 =====================
💻 ASP
📖 第 1 页 / 共 2 页
字号:
<!--#include file="pass.asp"-->
<%
dim startime,endtime
startime=timer()

dim l_year,l_month,l_day,l_time,cat_id
l_year=Request("l_year")
l_month=Request("l_month")
l_day=Request("l_day")

cat_id=request("cat_id")
if cat_id="" then cat_id=0
sql = "SELECT m_id,my_page_size,log_view_type,log_cut_line,ccolor1,ccolor2 FROM log_config WHERE log_cat_id="&cat_id&""
set tempc=conn.execute(sql)
if tempc.eof or tempc.bof then 
  sql = "SELECT m_id,my_page_size,log_view_type,log_cut_line FROM log_config WHERE log_cat_id=0"
  set tempc=conn.Execute(sql)
end if
m_id=cint(tempc("m_id"))
'win_head=tempc("win_head")
color1=tempc("ccolor1")
color2=tempc("ccolor2")
mypagesize=tempc("my_page_size")
'font_color=tempc("font_color")
'a_link=tempc("a_link")
'a_over=tempc("a_over")
'a_visited=tempc("a_visited")
log_view_type=tempc("log_view_type")
log_cut_line=tempc("log_cut_line")

tempc.close
set tempc=nothing


dim ulogin,isad,username,check_user

sub checkuser()
    Username=Session("username"&dlog_session)
    Password=Session("password"&dlog_session)
	if username="" or password="" then
    		Username=replace(request.Cookies(dlog_cookies_name)("Username"),"'","")
    		Password=replace(request.Cookies(dlog_cookies_name)("Password"),"'","")
	end if
	sql= "SELECT isad FROM User_MDB where username = '" & Username & "' and password='" & Password & "'"
	set rs_inc=conn.Execute(sql)
    		if not (rs_inc.BOF or rs_inc.eof) then
        		ulogin="true" 
			Session("username"&dlog_session) = Username
			Session("password"&dlog_session) = Password
			Session("isad"&dlog_session)=rs_inc("isad")

        		isad=Session("isad"&dlog_session)       
    		end if
    		rs_inc.Close()
		set rs_inc=nothing


if uLogin = "true" then
'==================用户登陆信息代码start

    uhl="<ul><li><a href=login.asp>重新登陆</a></li><li><a href='logout.asp'>退&nbsp;&nbsp;&nbsp;&nbsp;出</a></li><li><a href='edituser.asp?un=" & username & "'>资&nbsp;&nbsp;&nbsp;&nbsp;料</a>"
else
    uhl="<form name='Login' method='post' action='login.asp'><input name=""username"" type=""text""  value=""输入你的用户名"" size=""15"" onBlur=""if(this.value=='') {if(this.style.backgroundColor='#eaf7f8'){this.value='输入你的用户名';}}"" onFocus=""if(this.value.indexOf('输')!=-1) {if(this.style.backgroundColor='#FFFFFF'){this.value='';}}"" onMouseOver=""this.focus()"" /> <input type='image' src='images/Login.gif' name='submint' value='Login' alt='登陆' align='middle' /><input name='password' type='password' value='******' size='15' onBlur=""if(this.value=='') {if(this.style.backgroundColor='#eaf7f8'){this.value='******'}}"" onFocus=""if(this.value.indexOf('*')!=-1) {if(this.style.backgroundColor='#FFFFFF'){this.value='';}}"" onMouseOver=""this.focus();"" /> <input type='image' src='images/Reg.gif' name='submint' value='Reg' alt='注册' align='middle' onclick=""window.location.href='adduser.asp';return false;""/><input type='hidden' name='Cookies_Time' value='0' /><input type='hidden' name='IsLogin' value='True' /><input type='hidden' name='kLogin' value='True' /></form> "
end if



if isad<0 then uhl=uhl& "</li><li><a href='addlog.asp'>添加日志</a>"
if isad>0 then uhl=uhl& "</li><li><a href='addlog.asp?cat_id="&isad&"'>添加日志</a>"
if isad=-1 then uhl=uhl& "</li><li><a href='admin/index.asp' target='_blank'>全景处理</a></li></ul>"
uhl=uhl

'======================用户登陆信息代码end
check_user=uhl
end sub

'=================================================================甩选隐藏分类中的日志
dim thehide()
dim nai()

dim j
dim k
dim noneshow
sub gethidecatid()

  sql= "SELECT id,cat_name,ifhide from log_cat order by id"
  set rs_h=conn.EXECUTE(sql)
  j=0
  k=0
  while not rs_h.eof
     Redim Preserve nai(1,k)
     nai(0,k)=rs_h("id")
     nai(1,k)=rs_h("cat_name")
     'response.write nai(0,k)&","&nai(1,k)&" | "
     k=k+1

 
  if rs_h("ifhide")=1 then
     Redim Preserve thehide(j)
     thehide(j)=rs_h("id")
     'response.write thehide(j)&" | "
     j=j+1
  end if
  rs_h.moveNext

  wend

rs_h.close
set rs_h=nothing
end sub
gethidecatid

sub checkhide(lid)
dim thehideid
for each thehideid in thehide
if lid=thehideid then
noneshow="true"
Exit for
else noneshow="false"
end if
next

end sub

dim incat
sub getcatname(ci)
    for cati=0 to k
        if ci=nai(0,cati) then
           incat=nai(1,cati)
           exit for

        end if
    next
end sub



'=================================================================
function CovHtml(content)
ON ERROR RESUME NEXT
CovHtml=content
if not isnull(content) then
CovHtml=replace(CovHtml,"&","&amp;")
CovHtml=replace(CovHtml,"<","&lt;")
CovHtml=replace(CovHtml,">","&gt;")
CovHtml=replace(CovHtml,chr(34),"&quot;")
CovHtml=replace(CovHtml,chr(39),"&#39;")
end if 
if Err.Number <>0 then 
CovHtml= "CovHtml转换中出错请联系管理员<br>" 
Err.Clear
end if
end function
'=================================================================
'=================================================================
function unCovHtml(content)
ON ERROR RESUME NEXT
unCovHtml=content
if not isnull(content) then
unCovHtml=replace(unCovHtml,"&amp;","&",1,-1,1)
unCovHtml=replace(unCovHtml,"&nbsp;",chr(32),1,-1,1)
unCovHtml=replace(unCovHtml,"&lt;","<",1,-1,1)
unCovHtml=replace(unCovHtml,"&gt;",">",1,-1,1)
unCovHtml=replace(unCovHtml,"&quot;",chr(34),1,-1,1)
end if
if Err.Number <>0 then
unCovHtml= "unCovHtml转换中出错请联系管理员<br>"
Err.Clear
end if
end function
'=================================================================


'==================================================================
SUB MESSAGE(error) '错误页面 %>

      <div style="color:red;font-family:arial;font-size:12px; width:300px; height:200px;" align="center">
          <%=error%> | <a href="javascript:history.go(-1)">返 回</a>
      </div>

<%
'set ASPBook=nothing
'conn.Close
'set conn = nothing
end sub


'=================================================================
function furl(url)
furl=replace(url," ","%20",1,-1,1)
end function
'=================================================================
'========================================================================
sub redirect(url,success)  '操作成功页面 %>
<meta http-equiv=refresh content="2; url=<%=url%>">
<div align="center"><%=success%> |  <a href="index.asp">返回首页</a></div>
<%end sub



'==========================================================截断日志内容
Function SplitLines(mys,coun,logid,catid)
dim ts,i,l
if isnull(mys) then exit Function
i=1
ts = 0
For i=1 to Len(mys)
      l=Mid(mys,i,4)
      if l="<br>" or l="<BR>" or l="</p>" or l="</P>"  then
         ts=ts+1
      end if
      if ts>coun then exit for 
Next
if ts>coun then
    mys=left(mys,i-1)
    'mys=mys & "<br>... ..."
    mys=mys & "<div id='MoreLink'><a href='showlog.asp?cat_id="&catid&"&log_id="&logid&"'>详细内容...</a></div>"   
end if
SplitLines=mys
end Function


'========================================获取日志信息
'dim countcode
'countcode="<b>Visited:</b> <script src='count/v_count.asp'></script>"
dim icode
sub getloginfo
sql = "SELECT top 1 * FROM log_count"
set tempc=conn.execute(sql)
u_count=tempc("u_count")
l_count=tempc("l_count")
r_count=tempc("r_count")
set tempc=nothing

icode=icode&"共有日志:"&l_count
icode=icode&" 注册观员:<a href='userlist.asp'>"&u_count&"</a><br />"
icode=icode&"<select name='sort' onChange=""location.href='index.asp'+document.all.sort.options[document.all.sort.selectedIndex].value""> <option value=''>按发布时间排列</option><option value='?vt=byview'>按查看数排列</option><option value='?vt=bycomment'>按评论数排列</option></select>"
' <input type='button' value='GO' onclick=location.href='index.asp'+document.all.sort.options[document.all.sort.selectedIndex].value />
end sub
'getloginfo


'============================================获取分类列表
dim nowcat
dim lcode
'dim CN()
'dim CI()

⌨️ 快捷键说明

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