#define paginate(currentPage, totalPage, link) #if(totalPage <= 0 || currentPage > totalPage) #return #end #setLocal(startPage = currentPage - 4) #if (startPage < 1) #setLocal(startPage = 1) #end #setLocal(endPage = currentPage + 4) #if (endPage > totalPage) #setLocal(endPage = totalPage) #end
#if (currentPage <= 8) #setLocal(startPage = 1) #end #if ((totalPage - currentPage) < 8) #setLocal(endPage = totalPage) #end #if (currentPage == 1) 上页 #else 上页 #end #if (currentPage > 8) #(1) #(2) … #end #for(i : [startPage..endPage]) #if (currentPage == i) #(i) #else #(i) #end #end #if ((totalPage - currentPage) >= 8) … #(totalPage - 1) #(totalPage) #end #if (currentPage == totalPage) 下页 #else 下页 #end
#end