<%
function format_user_view(uuser,ut,uc)
  if len(uuser)<1 then format_user_view="<font class=gray>-----</font>":exit function
  if uc<>"" then uc=" class="&uc
  format_user_view="<a href='user_view.asp?username="&server.urlencode(uuser)&"' title='查看 "&uuser&" 的详细资料'"
  if ut=1 then format_user_view=format_user_view&" target=_blank"
  format_user_view=format_user_view&uc&">"&uuser&"</a>"
end function
function format_img(fvar)
  format_img="<img border=0 src='images/"&objv7.web_var(web_config,5)&"/"&fvar&"'>"
end function
function img_small(snum)
  img_small="<img border=0 src='images/small/"&snum&".gif' align=absmiddle>&nbsp;"
end function
function left_action(jt,lat)
  dim jtn:jtn=img_small(jt)
  left_action=vbcrlf&"<table border=0 width='96%' cellspacing=0 cellpadding=4 align=center>" & _
		vbcrlf&"<tr><td height=5 width='50%'></td><td width='50%'></td></tr>" & _
		vbcrlf&"<tr><td>"&jtn&"<a href='user_action.asp?action=list'>用户列表</a></td><td>"&jtn&"<a href='online.asp'>与我在线</a></td></tr>" & _
		vbcrlf&"<tr><td>"&jtn&"<a href='user_action.asp?action=top'>发贴排行</a></td><td>"&jtn&"<a href='user_action.asp?action=emoney'>财富排行</a></td></tr>" & _
		vbcrlf&"<tr><td>"&jtn&"<a href='forum_action.asp?action=new'>论坛新贴</a></td><td>"&jtn&"<a href='forum_action.asp?action=hot'>论坛热贴</a></td></tr>" & _
		vbcrlf&"<tr><td>"&jtn&"<a href='forum_action.asp?action=top'>论坛置顶</a></td><td>"&jtn&"<a href='forum_action.asp?action=good'>论坛精华</a></td></tr>" & _
		vbcrlf&"<tr><td>"&jtn&"<a href='forum_action.asp?action=tim'>回复新贴</a></td><td>"&jtn&"<a href='help.asp?action=forum'>论坛帮助</a></td></tr>" & _
		vbcrlf&"</table>"
  select case lat
  case 2
    left_action=kong&format_bar("<img src='images/"&web_skin&"/left_user.gif' border=0>",left_action,"",13,"")
  case 3,4
    left_action=format_bar2("功能跳转",left_action,"fk4"," class=bg_1"):left_action=kong&format_bar3(left_action)
  case else
    left_action=kong&format_bar2("功能跳转",left_action,"fk4"," class=bg_1")
  end select
end function
sub main_stat(sh,sjt,sm,st,sbg)
  dim num_topic,num_data,num_reg,new_username,num_news,num_article,num_down,stat_temp
  sql="select * from configs where id=1":set rs=conn.execute(sql)
  if rs.eof and rs.bof then
    rs.close:conn.execute("insert into configs(id,num_topic,num_data,num_reg,new_username,num_news,num_article,num_down,num_product,counter,max_online,max_tim,start_tim) values(1,0,0,0,'',0,0,0,0,1,1,'"&now_time&"','"&tim_type(now_time,33)&"')"):set rs=conn.execute(sql)
  end if
  num_topic=rs("num_topic"):num_data=rs("num_data"):num_reg=rs("num_reg"):new_username=rs("new_username"):num_news=rs("num_news"):num_article=rs("num_article"):num_down=rs("num_down"):rs.close
  if sjt<>"" then sjt=img_small(sjt)
  stat_temp="<table border=0 width='99%' align=center><tr><td height=2></td></tr>"
  if st=1 then
    stat_temp=stat_temp&vbcrlf&"<tr><td>"&sjt&"网站模式：<font class=blue>"&objv7.web_var(web_stamp,int(mid(web_setup,3,1))+1)&"</font></td></tr>" & _
	      vbcrlf&"<tr><td>"&sjt&"当前在线：<font class=red>"&online_num&"</font> 人</td></tr>" & _
	      vbcrlf&"<tr><td>"&sjt&"新闻总数：<font class=red>"&num_news&"</font> 条</td></tr>" & _
	      vbcrlf&"<tr><td>"&sjt&"文章总数：<font class=red>"&num_article&"</font> 篇</td></tr>" & _
	      vbcrlf&"<tr><td>"&sjt&"软件总数：<font class=red>"&num_down&"</font> 个</td></tr>"
  end if
  stat_temp=stat_temp&vbcrlf&"<tr><td>"&sjt&"网站注册：<font class=red>"&num_reg&"</font> 人</td></tr>" & _
	    vbcrlf&"<tr><td>"&sjt&"最新注册："&format_user_view(new_username,1,"")&"</td></tr>" & _
	    vbcrlf&"<tr><td>"&sjt&"主题总数：<font class=red>"&num_topic&"</font> 贴</td></tr>" & _
	    vbcrlf&"<tr><td>"&sjt&"贴子总数：<font class=red>"&num_data&"</font> 贴</td></tr>" & _
	    vbcrlf&"<tr><td height=2></td></tr></table>"
  if st=1 then
    call left_type(stat_temp,"stat",sm)
  else
    response.write format_bar2("论坛数据",stat_temp,sh," class=bg_1")
  end if
end sub
%>