<% '*********************************** ' ÇÁ·Î±×·¥¸í : ÆäÀÌ¡ Ŭ·¡½º ' Á¦ÀÛ ÀÏÀÚ : 2003.12.26 ' Á¦ÀÛÀÚ : ÀÌ»óÈ£(search_go@yahoo.co.kr) ' License : GPL(Gnu's Public License) ' Á¦ÀÛÀÚ ´çºÎ : º» ÆäÀÌ¡ Ŭ·¡½º´Â PHP Ŭ·¡½º¿¡¼­ ÆäÀÌ¡ ' ÇÔ¼ö¸¸À» »©¼­, ASP·Î Æ÷ÆÃÇßÀ¸¸ç, ÀÌ¿¡ ´ëÇÑ Ã¥ÀÓÀº ÁöÁö ' ¾Ê½À´Ï´Ù. %> <% Class Lib '***** Property Define Private strEndPage Private strPage Private strNumOfBlock Private strQueryString '************** '***** ÃʱâÈ­ ¹× Á¾·á Private Sub Class_Initialize() ' ÆäÀÌÁö ÃʱâÈ­ If Request("page") = "" Then strPage = CInt(1) Else strPage = CInt(Request("page")) End If End Sub '************** '***** Let Property Define Public Property Let EndPage(str) strEndPage = str End Property Public Property Let NumOfBlock(str) strNumOfBlock = str End Property Public Property Let QueryString(str) strQueryString = str End Property '************** '***** Method Define Public Function PageLink() 'ÀÌÀü ÆäÀÌÁö°¡ Á¸ÀçÇÒ °æ¿ì If strPage > 1 Then Dim PrevLink PrevLink = strPage - 1 Response.Write "pre " End If '´ÙÀ½ ÆäÀÌÁö°¡ Á¸ÀçÇÒ °æ¿ì If strPage < strEndPage Then Dim NextLink NextLink = strPage + 1 Response.Write "next " End If 'ÆäÀÌÁö ¸µÅ©ÀÇ °¡¿îµ¥ Á¤·ÄÀ» À§ÇÑ ±âÁذª °áÁ¤ Dim PageBase PageBase = CInt(strNumOfBlock/2) 'ÀÌÀü ÆäÀÌÁö ºí·Ï °áÁ¤ If PageBase < strPage+1 Then Dim PrevBlockNo PrevBlockNo = strPage - strNumOfBlock If PrevBlockNo < 0 Then PrevBlockNo = 1 End If Response.Write "[Prev "&strNumOfBlock&"]" Response.Write "[First].." Else Response.Write "[Prev "&strNumOfBlock&"]" Response.Write "[First].." End If Dim Start Start = 0 'ÆäÀÌÁö ¸µÅ© Ãâ·Â°ª °áÁ¤ Dim i For i = 1 to strNumOfBlock If PageBase < strPage+1 Then Start = strPage - (PageBase) End If Dim RealPage RealPage = Start + i If strPage = RealPage-1 Then Response.Write "["&RealPage&"]" Elseif RealPage >= strEndPage Then Exit For Else Response.Write "["&RealPage&"]" End If Next '´ÙÀ½ ÆäÀÌÁö ºí·Ï °áÁ¤ If RealPage < strEndPage Then Dim NextBlockNo NextBlockNo = strPage+strNumOfBlock If NextBlockNo > strEndPage Then NextBlockNo = strEndPage End If Response.Write "..[Last]" Response.Write "[Next "&strNumOfBlock&"]" Else Response.Write "..[Last]" Response.Write "[Next "&strNumOfBlock&"]" End If End Function '************** End Class %>