忠网广告 系统 用到的几个函数

2019-01-14 04:34:24王旭

end function



'//********************************************************************
'  PubIfzhengshu(shu) 判断是否为正整数 , 参数:shu 要判断的数字
'********************************************************************//

function PubIfzhengshu(shu)

    PubIfzhengshu="yes"

    Dim shus,shui
    shus=split(shu,"")

    for shui=0 to Ubound(shus)    
    if isnumeric(shus(shui))=false then
    PubIfzhengshu="no"    
    exit function
    end if
    next

end function

  
'/********************************************************************
' PubPageGs() 格式化分页, rssum 总数,nummer 每页数目,page 当前页码
'********************************************************************/

  Sub PubPageGs()
    if rssum mod nummer > 0 then
      thepages=rssumnummer+1
    else
      thepages=rssumnummer
    end if
    page=trim(request("page"))
    if not(isnumeric(page)) then page=1
    if int(page)>int(thepages) or int(page)<1 then
      viewpage=1
    else
      viewpage=int(page)
    end if
  end Sub


'//********************************************************************
'  PubPage1(maxpage,thepages,viewpage,pageurl,pp,font_color) 通用分页函数 (1)
'  maxpage,thepages,viewpage,pageurl 链接地址前缀,pp,font_color 显示字体色
'********************************************************************//

  Function PubPage1(maxpage,thepages,viewpage,pageurl,pp,font_color)
    dim pn,pi,page_num,ppp,pl,pr:pi=1
    ppp=pp2
    if pp mod 2 = 0 then ppp=ppp-1
    pl=viewpage-ppp
    pr=pl+pp-1
    if pl<1 then
      pr=pr-pl+1:pl=1
      if pr>thepages then pr=thepages
    end if

    if pr>int(thepages) then
      pl=pl+thepages-pr:pr=thepages
      if pl<1 then pl=1