<%
'-----------------------------------查看用户信息------------------------------------
function format_user_view(uuser,ut,un)
  if var_null(uuser)="" then
    format_user_view="<font class=gray>-----</font>"
    exit function
  end if
  dim uname
  uname=uuser
  if un=1 then uname=joekoe_cms.cuted(uuser,5)
  format_user_view="<a href='../user_view.asp?username="&server.urlencode(uuser)&"' alt='查看 "&uuser&" 的详细资料'"
  if ut=1 then format_user_view=format_user_view&" target=_blank"
  format_user_view=format_user_view&">"&uname&"</a>"
end function

function format_user_name(varss,ctt,ct)
  dim cnum,vars,classt
  cnum=5
  if int(ctt)=0 then cnum=0
  vars=varss
  if var_null(vars)="" then
    format_user_name="<font class=gray>-----</font>"
    exit function
  end if
  if var_null(ct)<>"" and ct<>"" then classt=" class="&ct
  format_user_name="<a href='../user_view.asp?username="&server.urlencode(vars)&"' alt='查看 "&vars&" 的详细资料' target=_blank"&classt&">"&joekoe_cms.code_html(vars,1,cnum)&"</a>"
end function

function format_user_face(f_vars,f_w,f_h)
  if var_null(f_vars)="" or f_vars="" then
    format_user_face="images/face/0.gif"
    exit function
  end if
  format_user_face="<img src='"&f_vars&"' border=0 width="&f_w&" height="&f_h&">"
end function

function user_view_sex(us,utim)
  dim a,b,temp1,t
  a="0"
  b="离线了"
  t=datediff("n",utim,joekoe_cms.now_time)
  if int(t)<=int(dim_num(2)) then
    a=""
    b="在线哦！有人找吗？"
  end if
  if us=false then
    temp1="<img src='"&joekoe_cms.web_dir_skin&"small/girl"&a&".gif' align=absmiddle alt='"&web_n_girl&"，"&b&"' border=0>"
  else
    temp1="<img src='"&joekoe_cms.web_dir_skin&"small/boy"&a&".gif' align=absmiddle alt='"&web_n_boy&"，"&b&"' border=0>"
  end if
  user_view_sex=temp1
end function

function forum_user_power_grade(u_int,u_power)
  dim dim_power,dim_grade,si,snum,sdim,sdim2,gp_type,gp_types,gp_name,up_type,up_name,n_int,b
  n_int=0
  b=0
  dim_power=dim_user
  dim_grade=split(web_user_grade,"|")
  snum=ubound(dim_power)
  for si=0 to snum
    sdim=split(dim_power(si),":")
    if u_power=sdim(0) then
      up_type=sdim(0)
      up_name=sdim(1)
      select case si
      case 0
        gp_types=up_type
        gp_type="p"
      case 1
        gp_types=up_type
        gp_type="p"
      case 2
        gp_type="p"
      end select
    end if
  next
  if up_type="" or up_name="" then
    sdim=split(dim_power(0),":")
    up_type=sdim(0)
    up_name=sdim(1)
  end if
  snum=ubound(dim_grade)
  for si=0 to snum
    sdim=split(dim_grade(si),":")'''
    if int(si)<>int(snum-1) then sdim2=split(dim_grade(si+1),":")
    select case si
    case snum-1
      if int(u_int)>=int(sdim(0)) then
        n_int=si
        gp_name=sdim(1)
        b=1
      end if
    case else
      if int(u_int)<int(sdim2(0)) then
        n_int=si
        gp_name=sdim(1)
        b=1
      end if
    end select
    if b=1 then exit for
  next
  dim gp_type2,gp_type3
  gp_type2=gp_type
  gp_type3=gp_type&n_int
  if gp_types<>"" and var_null(gp_types)<>"" then
    gp_type3=gp_types
  end if
  if isarray(dim_power) then erase dim_power
  if isarray(dim_grade) then erase dim_grade
  if isarray(sdim) then erase sdim
  if isarray(sdim2) then erase sdim2
  forum_user_power_grade="<img src='"&joekoe_cms.web_dir_skin&"star/star_"&gp_type3&".gif' border=0><br>&nbsp;&nbsp;等级：<img border=0 src='"&joekoe_cms.web_dir_skin&"small/icon_"&up_type&".gif' alt='"&up_name&"' align=absmiddle>&nbsp;"&gp_name
end function

function commend_friend(t1,t2,t3)
  commend_friend="<a href='javascript:;' onclick=""javascript:open_win('commend.asp?nsort="&server.urlencode(t1)&"&topic="&server.urlencode(t2)&"&url="&server.urlencode(t3)&"','commend',500,380,'no');"">→&nbsp;推荐给我的好友</a>"
end function

function img_small(snum)
  img_small="<img border=0 src='images/small/"&snum&".gif' align=absmiddle>&nbsp;"
end function

function img_skin(snum)
  img_skin="<img border=0 src='"&joekoe_cms.web_dir_skin&"small/"&snum&".gif' align=absmiddle>&nbsp;"
end function

function jk_em(em_frm,em_word)
  dim temp1,j
  for j=0 to 15
    temp1=temp1&"<img src='"&joekoe_cms.web_dir&"images/icon/em"&(j+1)&".gif' border=0 align=absMiddle onclick=""javascript:jk_insert_em('[em"&(j+1)&"]','"&em_frm&"','"&em_word&"');"" style=""cursor: hand"">&nbsp;&nbsp;"
  next
  temp1=temp1&"&nbsp;&nbsp;<font class=gray>[&nbsp;<a href='###' onclick=""javascript:open_win('em.asp?"&em_frm&","&em_word&",em','em',300,360,'no');"">更多EM贴图…</a>&nbsp;]</font>"
  jk_em=temp1
end function

function jk_icon(inum)
  dim temp1,j
  for j=0 to 9
    temp1=temp1&"<img border=0 src='"&joekoe_cms.web_dir&"images/icon/"&j&".gif'>&nbsp;<input class=bg_td type=radio value='"&j&"' name=icon"
    if int(inum)=int(j) then temp1=temp1&" checked"
    temp1=temp1&">&nbsp;"
  next
  jk_icon=temp1
end function

function note_emoney_pay(p_emoney,p_nsort,p_id)
  note_emoney_pay="<img src='"&joekoe_cms.web_dir_skin&"small/emoney.gif' border=0 alt='"&joekoe_cms.web_unit&"支付' align=absmiddle>&nbsp;<font class=gray>不可用</font>"
end function

function shop_emoney_pay(p_is_emoney,p_emoney,p_id)
  dim nemoney
  nemoney=0
  if p_is_emoney then nemoney=p_emoney
  shop_emoney_pay=note_emoney_pay(nemoney,n_sort,p_id)
end function

function img_user()
  dim a,udim,ui,udim2
  a="网站用户图例："
  udim=dim_user
  for ui=0 to ubound(udim)
    udim2=split(udim(ui),":")
    a=a&vbcrlf&"&nbsp;<img border=0 src='"&joekoe_cms.web_dir_skin&"small/icon_"&udim2(0)&".gif' align=absmiddle>&nbsp;"&udim2(1)
  next
  a=a&vbcrlf&"&nbsp;<img border=0 src='"&joekoe_cms.web_dir_skin&"small/icon_other.gif' align=absmiddle>&nbsp;游客"
  if isarray(udim) then erase udim
  if isarray(udim2) then erase udim2
  img_user=a
end function

function img_forum()
  dim a,fdim,fi
  fdim=split(web_forum_type,"|")
  for fi=0 to ubound(fdim)
    a=a&vbcrlf&"&nbsp;<img src='"&joekoe_cms.web_dir_skin&"forum/label_"&(fi+1)&".gif' title='无新贴' border=0 align=absmiddle>&nbsp;" & _
        vbcrlf&"&nbsp;<img src='"&joekoe_cms.web_dir_skin&"forum/label_"&(fi+1)&"n.gif' title='有新贴' border=0 align=absmiddle>&nbsp;"&fdim(fi)&"&nbsp;"
  next
  if isarray(fdim) then erase fdim
  img_forum=a
end function

function img_topic()
  dim a
  a=a&vbcrlf&"<img src='"&joekoe_cms.web_dir_skin&"forum/isok.gif' border=0 align=absmiddle>&nbsp;&nbsp;开放的主题&nbsp;" & _
        vbcrlf&"<img src='"&joekoe_cms.web_dir_skin&"forum/ishot.gif' border=0 align=absmiddle>&nbsp;&nbsp;回复超过10贴&nbsp;" & _
        vbcrlf&"<img src='"&joekoe_cms.web_dir_skin&"forum/islock.gif' border=0 align=absmiddle>&nbsp;&nbsp;锁定的主题&nbsp;" & _
        vbcrlf&"<img src='"&joekoe_cms.web_dir_skin&"forum/istop.gif' border=0 align=absmiddle>&nbsp;<img src='"&joekoe_cms.web_dir_skin&"forum/istops.gif' border=0 align=absmiddle>&nbsp;&nbsp;固顶、总固顶的主题&nbsp;" & _
        vbcrlf&"<img src='"&joekoe_cms.web_dir_skin&"forum/isvote.gif' border=0 align=absmiddle>&nbsp;&nbsp;投票的主题" & _
        vbcrlf&"<img src='"&joekoe_cms.web_dir_skin&"forum/isgood.gif' border=0 align=absmiddle>&nbsp;&nbsp;精华主题"
  img_topic=a
end function

function forum_img_tim()
  dim temp1
  temp1=temp1&vbcrlf&"<table border=0 width='98%'>" & _
              vbcrlf&"<tr><td align=center>"&img_forum&"</td></tr>" & _
              vbcrlf&"<tr><td height=5></td></tr>" & _
              vbcrlf&"<tr><td align=center>时间格式：<font class=gray>年-月-日 时:分:秒</font>　当前时间："&joekoe_cms.now_time&"</a></td></tr>" & _
              vbcrlf&"</table>"
  forum_img_tim=temp1&ukong
end function

function forum_img_topic()
  dim temp1
  temp1=temp1&vbcrlf&"<table border=0 width='98%'>" & _
              vbcrlf&"<tr><td align=center>论坛主题图例： "&img_topic()&"</td></tr>" & _
              vbcrlf&"</table>"
  forum_img_topic=temp1&ukong
end function

function user_sys_type(svar)
  if svar="" or var_null(svar)="" then
    user_sys_type="未知的系统信息"
    exit function
  end if
  dim sys_dim,temp1,sys2,s1,tmp
  sys_dim=split(svar,";")
  if int(ubound(sys_dim))<2 then
    user_sys_type="未知的系统信息"
    exit function
  end if
  sys2=sys_dim(2)
  s1=len(sys2)
  tmp=mid(sys2,s1,1)
  if tmp=")" then sys2=mid(sys2,1,s1-1)
  temp1="操作系统："&sys2
  temp1=temp1&"，浏览器："&sys_dim(1)
  temp1=replace(temp1,"MSIE","Internet Explorer")
  temp1=replace(temp1,"NT 5.0","2000")
  temp1=replace(temp1,"NT 5.1","XP")
  temp1=replace(temp1,"NT 5.2","2003")
  if isarray(sys_dim) then erase sys_dim
  user_sys_type=temp1
end function

function base_forum_istop(b_istop,b_isvote)
  dim temp_b
  temp_b="istop"
  if b_isvote=1 then
    temp_b="isvote"
  elseif b_istop=2 then
    temp_b="istops"
  end if
  base_forum_istop="<img src='"&joekoe_cms.web_dir_skin&"forum/"&temp_b&".gif' border=0>"
end function

function base_forum_is(b_re_counter,b_istop,b_islock,b_isgood,b_isvote,b_vote_num)
  dim temp_b
  temp_b="isok"
  if b_isvote=1 then
    if b_islock=1 then
      temp_b="isvotelock"
    else
      temp_b="isvote"
    end if
  else
    select case b_istop
    case 1
      temp_b="istop"
    case 2
      temp_b="istops"
    case else
      if b_isgood=1 then
        temp_b="isgood"
      else
        if b_islock=1 then
          temp_b="islock"
        else
          if b_re_counter>=10 then temp_b="ishot"
        end if
      end if
    end select
  end if
  base_forum_is="<img src='"&joekoe_cms.web_dir_skin&"forum/"&temp_b&".gif' border=0>"
end function

function base_forum_isview(b_isvote,b_islock,b_re_counter,b_istop,b_isgood)
  dim temp_b
  if fir_isvote then
    temp_b=temp_b&"<img src='"&joekoe_cms.web_dir_skin&"forum/isvote.gif' border=0>&nbsp;"
  else
    if fir_islock=1 then
      temp_b=temp_b&"<img src='"&joekoe_cms.web_dir_skin&"forum/islock.gif' border=0>&nbsp;"
    else
      if re_counter>=dim_num(18) then    'hot_num
        temp_b=temp_b&"<img src='"&joekoe_cms.web_dir_skin&"forum/ishot.gif' border=0>&nbsp;"
      else
        temp_b=temp_b&"<img src='"&joekoe_cms.web_dir_skin&"forum/isok.gif' border=0>&nbsp;"
      end if
    end if
  end if
  if fir_istop=1 then temp_b=temp_b&"<img src='"&joekoe_cms.web_dir_skin&"forum/istop.gif' border=0>&nbsp;"
  if fir_istop=2 then temp_b=temp_b&"<img src='"&joekoe_cms.web_dir_skin&"forum/istops.gif' border=0>&nbsp;"
  if fir_isgood=1 then temp_b=temp_b&"<img src='"&joekoe_cms.web_dir_skin&"forum/isgood.gif' border=0>&nbsp;"
  base_forum_isview=temp_b
end function

function get_abc(var_s)
  '65-90 A-Z
  '97-122 a-z
  '48-58 0-9
  '45 -
  dim tmp,vars:vars=trim(var_s)
  if vars="" or isnull(vars) then get_abc="-":exit function
  vars=left(vars,1)
  tmp=int(asc(vars))
  if tmp>=48 and tmp<=57 then get_abc=vars:exit function
  if (tmp>=65 and tmp<=90) or (tmp>=97 and tmp<=122) then get_abc=ucase(vars):exit function
  tmp=tmp+65536
  if(tmp>=45217 and tmp<=45252) then get_abc="A":exit function
  if(tmp>=45253 and tmp<=45760) then get_abc="B":exit function
  if(tmp>=45761 and tmp<=46317) then get_abc="C":exit function
  if(tmp>=46318 and tmp<=46825) then get_abc="D":exit function
  if(tmp>=46826 and tmp<=47009) then get_abc="E":exit function
  if(tmp>=47010 and tmp<=47296) then get_abc="F":exit function
  if(tmp>=47297 and tmp<=47613) then get_abc="G":exit function
  if(tmp>=47614 and tmp<=48118) then get_abc="H":exit function
  if(tmp>=48119 and tmp<=49061) then get_abc="J":exit function
  if(tmp>=49062 and tmp<=49323) then get_abc="K":exit function
  if(tmp>=49324 and tmp<=49895) then get_abc="L":exit function
  if(tmp>=49896 and tmp<=50370) then get_abc="M":exit function
  if(tmp>=50371 and tmp<=50613) then get_abc="N":exit function
  if(tmp>=50614 and tmp<=50621) then get_abc="O":exit function
  if(tmp>=50622 and tmp<=50905) then get_abc="P":exit function
  if(tmp>=50906 and tmp<=51386) then get_abc="Q":exit function
  if(tmp>=51387 and tmp<=51445) then get_abc="R":exit function
  if(tmp>=51446 and tmp<=52217) then get_abc="S":exit function
  if(tmp>=52218 and tmp<=52697) then get_abc="T":exit function
  if(tmp>=52698 and tmp<=52979) then get_abc="W":exit function
  if(tmp>=52980 and tmp<=53640) then get_abc="X":exit function
  if(tmp>=53641 and tmp<=54480) then get_abc="Y":exit function
  if(tmp>=54481 and tmp<=62289) then get_abc="Z":exit function
  get_abc="-"
end function

sub web_search()
  response.write vbcrlf&"  <table border=0>" & _
                 vbcrlf&"  <form action='search.asp' method=get onsubmit=""javascript:frm_submitonce(this);"">" & _
                 vbcrlf&"  <tr>" & _
                 vbcrlf&"  <td>"&img_small("search")&"</td>" & _
                 vbcrlf&"  <td>&nbsp;<input type=text name=keyword value='' size=20 maxlength=20></td>" & _
                 vbcrlf&"  <td>&nbsp;<select name=sea_type>" & _
                 vbcrlf&"<option value='forum'>论坛</option>" & _
                 vbcrlf&"<option value='news'>新闻</option>" & _
                 vbcrlf&"<option value='article'>文栏</option>" & _
                 vbcrlf&"<option value='down'>下载</option>" & _
                 vbcrlf&"<option value='paste'>图片</option>" & _
                 vbcrlf&"<option value='flash'>Flash</option>" & _
                 vbcrlf&"<option value='website'>网站</option>" & _
                 vbcrlf&"<option value='shop_product'>商城</option>" & _
                 vbcrlf&"</select></td>" & _
                 vbcrlf&"  <td>&nbsp;<input type=checkbox name=celerity value='yes'></td>" & _
                 vbcrlf&"  <td>快速搜索&nbsp;</td>" & _
                 vbcrlf&"  <td valign=top><input type=image src='images/small/web_sea.gif' border=0></td>" & _
                 vbcrlf&"  <td>&nbsp;&nbsp;<a href='search.asp?action=help' title='多功能搜索'>搜索帮助？</a></td>" & _
                 vbcrlf&"  </tr>" & _
                 vbcrlf&"  </form>" & _
                 vbcrlf&"  </table>"
end sub

sub web_copy()
response.write vbcrlf&"<table cellspacing=1 cellpadding=2 class=table>" & _
               vbcrlf&"<tr><td class=bg_tds align=center height=30><a href='"&joekoe_cms.web_url&"' target=_blank>"&joekoe_cms.web_name&"</a>　<a href='http://www.joekoe.com/' class=gray target=_blank>"&joekoe_cms.pro_edition&"</a>　<a href='javascript:window.close();'>关闭窗口</a></td></tr>" & _
               vbcrlf&"</table>"
end sub

%>