Snitz Forums 2000
Snitz Forums 2000
Home | Profile | Register | Active Topics | Members | Search | FAQ
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 Snitz Forums 2000 MOD-Group
 MOD Add-On Forum (W/O Code)
 Mod JumpToPost
 New Topic  Topic Locked
 Printer Friendly
Author Previous Topic Topic Next Topic  

GauravBhabu
Advanced Member

4288 Posts

Posted - 29 September 2002 :  10:20:38  Show Profile
Mod JumpToPost
Date: 29 September 2002
For snitz 3.4xx
Note: Changes are for Access and sqlServer users only. Changes required for mysql users are not posted.
This is more of a feature enhancement rather then a new feature.

1. Jump to LastPost (LastEdit/LastPost)
2. Jump to First NewPost
3. Jump to EndPost
4. Hilites the Posted date on JumptoPost (updated)

Above options will be available after the changes are made as posted below:

Changes are required to be made in following files

1. topic.asp
2. default.asp
3. forum.asp
4. active.asp
5. inc_func_common.asp

topic.asp
Step 1:
Add the following code at the end of topic.asp. Just before the ASP closing tag (%>).
function JumpToPage(jump)
    dim intPageNumber
    Select Case jump
      Case "lastpost"
        rsReplies.MoveLast
      Case "newpost"
	rsReplies.Find = "R_DATE >'" & Session(strCookieURL & "last_here_date") & "'"
      Case "thispost"
	rsReplies.Find = "REPLY_ID=" & Request.QueryString("REPLY_ID") 
     Case else
        JumpToPage = myPage
        exit function
    End select
    if not (rsReplies.BOF or rsReplies.EOF) then
      intPageNumber = rsReplies.absolutepage
      intJumpToID = rsReplies("REPLY_ID")
    end if
    rsReplies.MoveFirst     
    if intPageNumber <= 0 then intPageNumber = myPage
    JumpToPage = intPageNumber
End function


Step 2:
Find the following statements on Line 601
Response.Write  "      " & getCurrentIcon(strIconPosticon,"","hspace=""3""") & "<font color=""" & strForumFontColor & """ face=""" & strDefaultFontFace & """ size=""" & strFooterFontSize  & """>Posted - " & ChkDate(Reply_Date, " : " ,true) & "</font>" & vbNewline

Modify the above statement to look like as below
Response.Write  "       " & getCurrentIcon(strIconPosticon,"","hspace=""3""") & "<font color=""" & strForumFontColor & """ face=""" & strDefaultFontFace & """ size=""" & strFooterFontSize  & """>" & strHiliteOTag & "Posted - " & ChkDate(Reply_Date, " : " ,true) & strHiliteCTag & "</font>" & vbNewline


Step 3:
Find the following statement on Line 595
Response.Write	"valign=""top""><a name=""" & Reply_ReplyID & """></a>" & vbNewLine & _

Modify the above statement to look like as below
Response.Write	"valign=""top"">" & vbNewLine
strHiliteOTag="" : strHiliteCTag = ""
If Reply_ReplyID = intJumpToID Then	
   Response.Write "<a name=""" & strJumpTo & """></a>"
   strHiliteOTag = "<span class=""spnSearchHighlight"">"
   strHiliteCTag = "</span>"
end if 
Response.Write	"<a name=""" & Reply_ReplyID & """></a>" & vbNewLine & _

Step 4:
Find the following statements on Lines 381-382
if not (rsReplies.EOF or rsReplies.BOF) then
  rsReplies.pagesize = strPageSize

Add the following statement just below the above statements
if strJumpTo <> "" then myPage = JumpToPage(strJumpTo)

Step 5:
Remove the statements between lines 203-276.
The statement on Line 203 and statements on Lines 274-276 looks like as shown below
if mypage = -1 and Request.QueryString("REPLY_ID") <> "" then ---Line 203
  ...
  ...
  Response.Redirect("topic.asp?" & strwhichpage & "TOPIC_ID=" & Topic_ID & "#" & LastPostReplyID & "") --- Line 274
  Response.End --- Line 275
end if --- Line 276

After Remove the code between Lines 197-206 will look like as shown below:
if strModeration > 0 and Cat_Moderation > 0 and Forum_Moderation > 0 and AdminAllowed = 0 then
        Moderation = "Y"
else
        Moderation = "N"
end if



' -- Get all the high level(board, category, forum) subscriptions being held by the user
Dim strSubString, strSubArray, strBoardSubs, strCatSubs, strForumSubs, strTopicSubs


Step 6:
Add the following statements on Line Number 202-204
Rem -Declare and initialize the variable
Dim strJumpTo, intJumpToID
strJumpTo = Trim(Request.QueryString("jump"))

After adding these lines code will look like as shown below:
if strModeration > 0 and Cat_Moderation > 0 and Forum_Moderation > 0 and AdminAllowed = 0 then
        Moderation = "Y"
else
        Moderation = "N"
end if
Rem -Declare and initialize the variable
Dim strJumpTo, intJumpToID
strJumpTo = Trim(Request.QueryString("jump"))
' -- Get all the high level(board, category, forum) subscriptions being held by the user
Dim strSubString, strSubArray, strBoardSubs, strCatSubs, strForumSubs, strTopicSubs

default.asp
Replace the function DoLastPostLink between Lines 1041-1053 with the following function
Function DoLastPostLink(showicon)
    if ForumLastPostReplyID <> 0 then
     AnchorLink = "&REPLY_ID=" & ForumLastPostReplyID & "&jump=replyid#replyid"
     DoLastPostLink = "<a href=""topic.asp?TOPIC_ID=" & ForumLastPostTopicID & AnchorLink & """>"
    elseif ForumLastPostTopicID <> 0 then
     DoLastPostLink = "<a href=""topic.asp?TOPIC_ID=" & ForumLastPostTopicID & """>"
    else
     DoLastPostLink = ""
     exit function
    end if
    if (showicon = true) then 
     DoLastPostLink = DoLastPostLink & getCurrentIcon(strIconLastpost,"Jump to this Post","align=""absmiddle""") & "</a>"
    end if
end function

forum.asp
Step 1:
Replace the function DoLastPostLink between Lines 881-891 with the following function
Function DoLastPostLink()
    dim AnchorLink, strIcon
    strIcon = getCurrentIcon(strIconLastpost,"Jump to this Post","align=""absmiddle""") 
    if Topic_Replies < 1 or Topic_LastPostReplyID = 0 then
     DoLastPostLink = "<a href=""topic.asp?" & ArchiveLink & "TOPIC_ID=" & Topic_ID & """>" & strIcon & "</a>"
    elseif Topic_LastPostReplyID <> 0 then
     AnchorLink = "&REPLY_ID=" & Topic_LastPostReplyID & "&jump=thispost#thispost"
     DoLastPostLink = "<a href=""topic.asp?" & ArchiveLink & "TOPIC_ID=" & Topic_ID & AnchorLink & """>" & strIcon & "</a>"
    else
     DoLastPostLink = ""
    end if
end function

Step 2:
Find the following statements on Lines 533-535
if strShowPaging = "1" then 
	Call TopicPaging() 
end if

Step 3:
Add the following statement just below the above statements
if Topic_Replies > 0 then Response.Write LinkToPost("lastpost")

Step 4:
Find the following statements on Lines 528
Response.Write	"</a></td>" & vbNewLine & _

Step 5:
Modify the above statement as shown below
Response.Write	"</a>" 
if Topic_Replies > 0 and _
   Topic_LastPost > Session(strCookieURL & "last_here_date") then
 Response.Write LinkToPost("newpost")
end if
Response.Write	vbNewLine & _
"                </td>" & vbNewLine & _

active.asp
Step 1:
Replace the function DoLastPostLink between Lines 789-799 with the following function
Function DoLastPostLink()
    dim AnchorLink, strIcon
    strIcon = getCurrentIcon(strIconLastpost,"Jump to this Post","align=""absmiddle""") 
    if Topic_Replies < 1 or Topic_Last_Post_Reply_ID = 0 then
     DoLastPostLink = "<a href=""topic.asp?" & ArchiveLink & "TOPIC_ID=" & Topic_ID & """>" & strIcon & "</a>"
    elseif Topic_Last_Post_Reply_ID <> 0 then
     AnchorLink = "&REPLY_ID=" & Topic_Last_Post_Reply_ID & "&jump=thispost#thispost"
     DoLastPostLink = "<a href=""topic.asp?" & ArchiveLink & "TOPIC_ID=" & Topic_ID & AnchorLink & """>" & strIcon & "</a>"
    else
     DoLastPostLink = ""
    end if
end function

Step 2:
Find the following statements on Lines 573-575
if strShowPaging = "1" then 
    TopicPaging() 
end if

Step 3:
Add the following statement just below the above statements
if Topic_Replies > 0 then Response.Write LinkToPost("lastpost")

Step 4:
Find the following statements on Lines 570
Response.Write	"                </td>" & vbNewline

Step 5:
Add the following statement in red just before the above statement as shown below
if Topic_Replies > 0 then Response.Write LinkToPost("newpost")
Response.Write	"                </td>" & vbNewline

inc_func_common.asp
Add the following function at the end of this file

Function LinkToPost(strLinkTo)
    dim AnchorLink, strHoverText, strIcon
    Select case strLinkTo
     Case "newpost"
      AnchorLink = "&jump=newpost#newpost"
      strHoverText = "Jump to first New Post"
     Case "lastpost"
      AnchorLink = "&jump=lastpost#lastpost"
      strHoverText = "Jump to Last Post"
     case else
      AnchorLink = "&jump=lastpost#lastpost"
      strHoverText = "Jump to Last Post"
    end select
    if Topic_Replies >= 1 then
     strIcon = getCurrentIcon(strIconLastpost,strHoverText,"align=""absmiddle""")
     LinkToPost = "<a href=""topic.asp?" & ArchiveLink & "TOPIC_ID=" & Topic_ID & AnchorLink & """>" & strIcon & "</a>"
    else
     LinkToPost = ""
    end if
end function

Edited by - GauravBhabu on 29 September 2002 23:00:18

James
Average Member

USA
539 Posts

Posted - 29 September 2002 :  13:06:08  Show Profile  Visit James's Homepage
GauravBhabu, In my active.asp your line numbers are off by about 30
too high. Anyway, added the code where appropriate in that file.

I'm getting an error though when I try to enter any forum on my site:


Microsoft VBScript runtime  error '800a000d'

Type mismatch: 'LastPostLink'

/forum/forum.asp, line 531



Line 531 is:


		Response.Write	"</a>" & LastPostLink("newpost") & "</td>" & vbNewLine & _


*Interested in Radio Control*
*The RC Web Board - http://www.rcwebboard.com/*

Edited by - James on 29 September 2002 13:07:34
Go to Top of Page

GauravBhabu
Advanced Member

4288 Posts

Posted - 29 September 2002 :  15:46:43  Show Profile
quote:
Originally posted by James
Line 531 is:


		Response.Write	"</a>" & LastPostLink("newpost") & "</td>" & vbNewLine & _





Change LastPostLink to LinkToPost


		Response.Write	"</a>" & LinkToPost("newpost") & "</td>" & vbNewLine & _



Go to Top of Page

James
Average Member

USA
539 Posts

Posted - 29 September 2002 :  16:21:54  Show Profile  Visit James's Homepage
That fixed the error problem, but the tags don't seem to be placed in
the post. When I click the arrows for newpost, lastpost or thispost I
always go to the first post (lastpost goes to the first post of the
last page). When I view the page source that's produced, I can't find
newpost, lastpost or thispost except as the
under the refer line
input name="Refer" type="hidden" value="/forum/topic.asp?TOPIC_ID=828&jump=lastpost">


but no where do I see a bookmark tag.

*Interested in Radio Control*
*The RC Web Board - http://www.rcwebboard.com/*

Edited by - James on 29 September 2002 16:22:35
Go to Top of Page

GauravBhabu
Advanced Member

4288 Posts

Posted - 29 September 2002 :  18:18:44  Show Profile
quote:
Originally posted by James
but no where do I see a bookmark tag.



I updated the instructions. See Step 2 for topic.asp
Go to Top of Page

James
Average Member

USA
539 Posts

Posted - 29 September 2002 :  20:58:48  Show Profile  Visit James's Homepage
I had to update that change to look like:

If Reply_ReplyID = intJumpToID Then Response.Write "<a name=""" & strJumpTo & """></a><"


If you don't do this, it messes up the formatting of the valign tag in the next line. Alright, now I have a few other problems. It doesn't seem to work in IE (ver 6.0) for me, it somewhat works in netscape 6.0. It goes where it's suppose to in netscape but the status bar at the bottom that states transfering data gets stuck about 3/4 the way (even though the page is loaded). Also, is there a check where you can have it not add the arrow to posts that have no new replies?

*Interested in Radio Control*
*The RC Web Board - http://www.rcwebboard.com/*
Go to Top of Page

GauravBhabu
Advanced Member

4288 Posts

Posted - 29 September 2002 :  21:50:29  Show Profile
quote:
Originally posted by James
Also, is there a check where you can have it not add the arrow to posts that have no new replies?



Updated. See step 3 and step 5 for active.asp and forum.asp
Go to Top of Page

GauravBhabu
Advanced Member

4288 Posts

Posted - 29 September 2002 :  21:55:21  Show Profile
quote:
Originally posted by James
It doesn't seem to work in IE (ver 6.0) for me, it somewhat works in netscape 6.0.


Works for me in both.
Go to Top of Page

GauravBhabu
Advanced Member

4288 Posts

Posted - 29 September 2002 :  23:00:50  Show Profile
Updated, Added feature to hilite the posted date on Jumpto post.
Go to Top of Page

Carefree
Advanced Member

Philippines
4207 Posts

Posted - 30 September 2002 :  02:14:54  Show Profile
Don't you need some "end if" statements in Active & Forum.asp?
Go to Top of Page

GauravBhabu
Advanced Member

4288 Posts

Posted - 30 September 2002 :  02:26:43  Show Profile
quote:
Originally posted by Carefree

Don't you need some "end if" statements in Active & Forum.asp?


No
Go to Top of Page

James
Average Member

USA
539 Posts

Posted - 30 September 2002 :  23:10:56  Show Profile  Visit James's Homepage
Ok, was going to start over from scratch. Got stuck on the second step of topic.asp:

quote:


Step 2:
Find the following statements on Line 601

Response.Write  "      " & getCurrentIcon(strIconPosticon,"","hspace=""3""") & "<font color=""" & strForumFontColor & """ face=""" & strDefaultFontFace & """ size=""" & strFooterFontSize  & """>Posted - " & ChkDate(Reply_Date, " : " ,true) & "</font>" & vbNewline

Modify the above statement to look like as below

Response.Write  "       " & getCurrentIcon(strIconPosticon,"","hspace=""3""") & "<font color=""" & strForumFontColor & """ face=""" & strDefaultFontFace & """ size=""" & strFooterFontSize  & """>" & strHiliteOTag & "Posted - " & ChkDate(Reply_Date, " : " ,true) & strHiliteCTag & "</font>" & vbNewline



I don't have a strIconPosticon in that file. The line I have uses getCurrentMsgIcon(Reply_MsgIcon) because it was altered when I installed the Message Icons mod. That block of code now looks like:

			' DEM --> Start of Code altered for moderation
			if Reply_Status < 2 then
				Response.Write  "                      " & getCurrentIcon(getCurrentMsgIcon(Reply_MsgIcon),"","hspace=""3""") & "<font color=""" & strForumFontColor & """ face=""" & strDefaultFontFace & """ size=""" & strFooterFontSize  & """>Posted - " & ChkDate(Reply_Date, " : " ,true) & "</font>" & vbNewline
			elseif Reply_Status = 2 then
				Response.Write  "                      <font color=""" & strForumFontColor & """ face=""" & strDefaultFontFace & """ size=""" & strFooterFontSize  & """>NOT MODERATED!!!</font>" & vbNewline
			elseif Reply_Status = 3 then
				Response.Write  "                      " & getCurrentIcon(strIconPosticonHold,"","hspace=""3""") & "<font color=""" & strForumFontColor & """ face=""" & strDefaultFontFace & """ size=""" & strFooterFontSize  & """>ON HOLD</font>" & vbNewline
			end if
			' DEM --> End of Code added for moderation.



*Interested in Radio Control*
*The RC Web Board - http://www.rcwebboard.com/*
Go to Top of Page

David K
Junior Member

494 Posts

Posted - 24 November 2002 :  14:24:45  Show Profile  Send David K an AOL message  Send David K an ICQ Message  Send David K a Yahoo! Message
it's not the correct line, can you post a link of a .txt ver of the file?
Go to Top of Page

GauravBhabu
Advanced Member

4288 Posts

Posted - 24 November 2002 :  15:36:17  Show Profile
quote:
I don't have a strIconPosticon in that file. The line I have uses getCurrentMsgIcon(Reply_MsgIcon) because it was altered when I installed the Message Icons mod. That block of code now looks like:


Change it as below:



' DEM --> Start of Code altered for moderation
if Reply_Status < 2 then
	Response.Write  "                      " & getCurrentIcon(getCurrentMsgIcon(Reply_MsgIcon),"","hspace=""3""") & "<font color=""" & strForumFontColor & """ face=""" & strDefaultFontFace & """ size=""" & strFooterFontSize  & """>""">" & strHiliteOTag & "Posted - " & ChkDate(Reply_Date, " : " ,true) & strHiliteCTag & "</font>" & vbNewline
elseif Reply_Status = 2 then
	Response.Write  "                      <font color=""" & strForumFontColor & """ face=""" & strDefaultFontFace & """ size=""" & strFooterFontSize  & """>NOT MODERATED!!!</font>" & vbNewline
elseif Reply_Status = 3 then
	Response.Write  "                      " & getCurrentIcon(strIconPosticonHold,"","hspace=""3""") & "<font color=""" & strForumFontColor & """ face=""" & strDefaultFontFace & """ size=""" & strFooterFontSize  & """>ON HOLD</font>" & vbNewline
end if
' DEM --> End of Code added for moderation.




Edited by - GauravBhabu on 24 November 2002 15:37:17
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Topic Locked
 Printer Friendly
Jump To:
Snitz Forums 2000 © 2000-2021 Snitz™ Communications Go To Top Of Page
This page was generated in 0.27 seconds. Powered By: Snitz Forums 2000 Version 3.4.07