Print Page | Close Window

Paging Mod[Update of Zamal's]

Printed From: Web Wiz Forums
Category: Web Wiz Web App Support Forums
Forum Name: Web Wiz Forums Modifications
Forum Description: Mod's and Add-on's for Web Wiz Forums.
URL: https://forums.webwiz.net/forum_posts.asp?TID=21141
Printed Date: 29 March 2026 at 1:25pm
Software Version: Web Wiz Forums 12.08 - https://www.webwizforums.com


Topic: Paging Mod[Update of Zamal's]
Posted By: Hades
Subject: Paging Mod[Update of Zamal's]
Date Posted: 26 August 2006 at 10:23am
Hi all..
A long time ago, in the dark ages when we used WWF 7.9x, Zamal created a "Paging Mod". Basically, it displayed the links to other pages like this :
 
Pages << 1 2 3 4 ... 7 8 9 10 11 12 13 ... 17 18 19 20 >>
                       |
                 Current Page
 
I only had to change a few lines to make it work on my V.8.03, so basically, it's still Zamal's code, but since I only use it for the "forum_posts.asp" page, it's not the complete version. If I remember well, he had modded most things that could display more than one page (Like forum topics, pm inbox, etc..). But since I don't have the original file anymore, you'll have to search for yourself how he did it.
 
This code works for my forum_posts.asp, you may have to fiddle a bit with it :
[code]
<%
'*******************************************************************************
'*******************************************************************************
'************ Zamal's PageMod
'************ Original V7.x code by Zamal
'************ Updated for 8.03 by Hades
'*******************************************************************************
'*******************************************************************************
%>
<td align="right" nowrap>
<%
'If there is more than 1 page of topics then dispaly drop down list to the other threads
If intTotalRecordsPages > 1 Then
 
 'Display a text link to the last topic
 Response.Write (vbCrLf & "  <td colspan=""3"" align=""right"" nowrap=""nowrap"">")
   Response.write("<a class=""PageLink"">Pages </a>")
 
 
 'Display a prev link if previous pages are available
 If intRecordPositionPageNum > 1 Then
  If Request.QueryString("KW") <> "" Then
   Response.Write("<a href=""forum_posts.asp?TID=" & lngTopicID & "&KW=" & Server.URLEncode(Request.QueryString("KW")) & "&PN=" & intRecordPositionPageNum -1 & """ class=""PageLink"">" & "<<" & "</a>&nbsp;")
  Else
   Response.Write("<a href=""forum_posts.asp?TID=" & lngTopicID & "&PN=" & intRecordPositionPageNum -1 & """ class=""PageLink"">" & "<<" & "</a>&nbsp;")
  End If
 End If
 
dim I
dim LowerMin
Dim LowerMax
dim UpperMin
Dim BottomMax
Dim Range
I = intRecordPositionPageNum
Range = 3
LowerMin = intRecordPositionPageNum - Range
LowerMax = intRecordPositionPageNum + Range
BottomMax = 1 + Range
UpperMin = intTotalRecordsPages - Range
if (LowerMax > intTotalRecordsPages) then
 LowerMin = intTotalRecordsPages - (2 * Range)
 LowerMax = intTotalRecordsPages 
end if
if (LowerMin <= 0) then
 LowerMin = 1
 LowerMax = LowerMin + (2 * Range)
 if LowerMax >= intTotalRecordsPages then
  LowerMax = intTotalRecordsPages
 end if
end if
if BottomMax >= LowerMin then
 BottomMax = LowerMin - 1
end if
if UpperMin <= LowerMax then
 UpperMin = LowerMax + 1
end if
For intTopicPageLoopCounter = 1 to BottomMax
 If Request.QueryString("KW") <> "" Then
  If intTopicPageLoopCounter = intRecordPositionPageNum Then
         Response.write("<a class=""PageLink"">")
  else
   %> <a href="forum_posts.asp?TID=<%=lngTopicID%>&KW=<%=Server.URLEncode(Request.QueryString("KW"))%>&PN=<%=intTopicPageLoopCounter%>" class="PageLink">
   <%
  End If
 Else
  If intTopicPageLoopCounter = intRecordPositionPageNum Then
         Response.write("<a class=""PageLink"">")
  else
   %> <a href="forum_posts.asp?TID=<%=lngTopicID%>&PN=<%=intTopicPageLoopCounter%>" class="PageLink">
   <%
  End If
 End If
 %> <%=intTopicPageLoopCounter%></a>
 <%
next
if (LowerMin - BottomMax > 1 ) then
   Response.write("<a class=""PageLink"">...</a>")
end if
For intTopicPageLoopCounter = LowerMin to LowerMax
 If Request.QueryString("KW") <> "" Then
  If intTopicPageLoopCounter = intRecordPositionPageNum Then
         Response.write("<a class=""PageLink"">")
  else
   %> <a href="forum_posts.asp?TID=<%=lngTopicID%>&KW=<%=Server.URLEncode(Request.QueryString("KW"))%>&PN=<%=intTopicPageLoopCounter%>" class="PageLink">
   <%
  End If
 Else
  If intTopicPageLoopCounter = intRecordPositionPageNum Then
         Response.write("<a class=""PageLink"">")
  Else
   %> <a href="forum_posts.asp?TID=<%=lngTopicID%>&PN=<%=intTopicPageLoopCounter%>" class="PageLink">
   <%
  End If
 End If
 %> <%=intTopicPageLoopCounter%></a>
 <%
next
if (UpperMin - LowerMax > 1) then
   Response.write("<a class=""PageLink"">...</a>")
end if
For intTopicPageLoopCounter = UpperMin to intTotalRecordsPages
 If Request.QueryString("KW") <> "" Then
  If intTopicPageLoopCounter = intRecordPositionPageNum Then
         Response.write("<a class=""PageLink"">")
  else
   %> <a href="forum_posts.asp?TID=<%=lngTopicID%>&KW=<%=Server.URLEncode(Request.QueryString("KW"))%>&PN=<%=intTopicPageLoopCounter%>" class="PageLink">
   <%
  End If
 Else
  If intTopicPageLoopCounter = intRecordPositionPageNum Then
         Response.write("<a class=""PageLink"">")
  else
   %> <a href="forum_posts.asp?TID=<%=lngTopicID%>&PN=<%=intTopicPageLoopCounter%>" class="PageLink">
   <%
  End If
 End If
 %> <%=intTopicPageLoopCounter%></a>
 <%
next
 'Display a next link if needed
 If intRecordPositionPageNum <> intTotalRecordsPages Then
  If Request.QueryString("KW") <> "" Then
   Response.Write("&nbsp;<a href=""forum_posts.asp?TID=" & lngTopicID & "&KW=" & Server.URLEncode(Request.QueryString("KW")) & "&PN=" & intRecordPositionPageNum + 1 & """ class=""PageLink"">" & ">>" & "</a>")
  Else
   Response.Write("&nbsp;<a href=""forum_posts.asp?TID=" & lngTopicID & "&PN=" & intRecordPositionPageNum + 1 & """ class=""PageLink"">" & ">>" &



Replies:
Posted By: TechnoDream
Date Posted: 26 August 2006 at 4:13pm
Hello this mod i great ai need pages and styles
 
Pages Styles
 
Screen
 



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.08 - https://www.webwizforums.com
Copyright ©2001-2026 Web Wiz Ltd. - https://www.webwiz.net