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/Code)
 Small Mod: Fill Last Reply ID
 New Topic  Topic Locked
 Printer Friendly
Next Page
Author Previous Topic Topic Next Topic
Page: of 2

ruirib
Snitz Forums Admin

Portugal
26364 Posts

Posted - 22 August 2002 :  22:46:08  Show Profile  Send ruirib a Yahoo! Message
Title: Fill Last Reply ID and Enable Last Reply on Archived Topics

Snitz forum version: This mod is for Snitz Forums version 3.4

Purpose: Fill In the last reply ID for every forum and topic in your database, both for Active and Archived topics. This will enable you to use the Jump To Last Post icon for all existing topics and forums in your board, including Jump To Last Post for Archived Topics. This is mainly useful for upgraded forums, though it can be used for any forums, at any time.

Description: The Jump To Last Post feature is based in a field named F_LAST_POST_REPLY_ID in the FORUM_FORUM table and in a field named T_LAST_POST_REPLY_ID in the FORUM_TOPICS table. With upgraded forums, these fields are left unfilled for existing topics and forums, and will be left unfilled until new posts or edits are done to those forums and topics. Until this happens the Jump To Last Post feature is not available. Also, by default, Jump To Last Post is not enabled for Archived Topics.

Since I love this Jump To Last Post feature, I decided to write a very small mod to fill in the required info for existing forums and active and archived topics.

The mod is composed of a single file and a small change to topic.asp. The file, named FillLastReplyID.asp, will update the info on your database. The change to topic.asp will allow it to recognize the bookmark needed to jump to the last post for archived topics.

Platforms: Forums running on SQL Server and Access databases only. This will not work in forums with a MySQL database.

Download it from here

Installation Instructions: Extract the FillLastReplyID.asp from the zip file and place it at the forum folder. If you want to enable the Jump To Last post feature both for active and archived topics, execute the file like this:

http://YourForumURL.com/FillLastReplyID.asp?archive=true

If you have no interest in enabling the feature for archived topics, just don't specify the query string:

http://YourForumURL.com/FillLastReplyID.asp

This file can be executed as many times as you like. The only thing it will do is update a field in two or three tables (3 if you enable the feature for archived topics). You can start by enabling the feature only for active topics and then execute the file again for enabling it to archived topics as well.

Additional Changed Needed for Archived Topics: To enable topic.asp to recognize the bookmark used to jump to the last post, you need to make a very small and simple change in topic.asp. At line #163, find this code:



Response.Redirect("topic.asp?ARCHIVE=true&TOPIC_ID=" & Topic_ID & SearchLink)

Replace it by this one:

Response.Redirect("topic.asp?ARCHIVE=true&"&Request.QueryString)

For Snitz 3.4.01 this is not even needed anymore, since the change has been incorporated into the code.


Enjoy .


Snitz 3.4 Readme | Like the support? Support Snitz too

Edited by - ruirib on 24 August 2002 23:09:55

DoraMoon
Average Member

Taiwan
661 Posts

Posted - 23 August 2002 :  02:10:33  Show Profile
hi~ ruirib
so glad to see your Mods! we expect this for a long time.. no matter how "small" it was ...

i have Last Post Mod installed on old v3.3.0x. and it really nagged me that it didn't update the topics "before" u install this mod.

so if this mod also available on my situation, it'll be great !!

i check the old Last Post Mod, it only use the field T_LAST_POSTER to store the reply id.
if i change your code T_LAST_POST_REPLY_ID to T_LAST_POSTER, and remove the section 'update FORUM table...
could i use this mod to my old snitz ???

just want to make sure this.... thanks!

~......~.~~
Go to Top of Page

ruirib
Snitz Forums Admin

Portugal
26364 Posts

Posted - 23 August 2002 :  03:51:57  Show Profile  Send ruirib a Yahoo! Message
Hi DoraMoon,

I can't tell wether this applies to that mod or not. You can, however, give it a try with a backup copy of your database and see if it works. If the only difference is the field name, it is possible, but I don't know the mod, so I cannot reallt advise it...Sorry.


Snitz 3.4 Readme | Like the support? Support Snitz too
Go to Top of Page

DoraMoon
Average Member

Taiwan
661 Posts

Posted - 23 August 2002 :  10:01:37  Show Profile
hi~ ruirib,
i test it as your suggestion.. and it's great and no any problem!!
now a lots "last post link" eventually can really work on my pages..
THANKS !!!

and all i need to do just like i said in previous post..
change T_LAST_POST_REPLY_ID to T_LAST_POSTER, and get rid the forum update section...
if someone else also use Last Post mod in 3.3.x, this really a "sweet" addon for your last post mod.

~......~.~~
Go to Top of Page

ruirib
Snitz Forums Admin

Portugal
26364 Posts

Posted - 23 August 2002 :  20:19:58  Show Profile  Send ruirib a Yahoo! Message
Ok, glad you could use it .


Snitz 3.4 Readme | Like the support? Support Snitz too
Go to Top of Page

Etymon
Advanced Member

United States
2385 Posts

Posted - 24 August 2002 :  22:08:18  Show Profile  Visit Etymon's Homepage

Thanks for the MOD, ruirib!

I have been fiddling with BabyGate's and DoraMoon's Last Post MODs here and there. I also like that Jump function.

Thanks also DoraMoon for sharing the detail of your experience for implementing it in your pre-v3.4 forum. That will help others besides myself I am sure.

I'm looking forward to getting this to work for me!


Sincerely,

Etymon
Go to Top of Page

ruirib
Snitz Forums Admin

Portugal
26364 Posts

Posted - 24 August 2002 :  22:21:37  Show Profile  Send ruirib a Yahoo! Message
You're welcome Etymon .

If you're using Access or SQL Server this will be very easy to implement, really.


Snitz 3.4 Readme | Like the support? Support Snitz too
Go to Top of Page

Etymon
Advanced Member

United States
2385 Posts

Posted - 24 August 2002 :  22:28:40  Show Profile  Visit Etymon's Homepage
quote:
Originally posted by ruirib

You're welcome Etymon .

If you're using Access or SQL Server this will be very easy to implement, really.



Cool! I plan on upgrading one day to SQL. It's nice to know this in advance!



Etymon
Go to Top of Page

Etymon
Advanced Member

United States
2385 Posts

Posted - 25 August 2002 :  09:53:37  Show Profile  Visit Etymon's Homepage
Ok, I had a look-see at it.

I considered DoraMoon's instructions above, but DoraMoon is working off of BabyGate's MOD, and I think perhaps even with some additional modifications.

Concerning the areas you mentioned to edit in v3.4 for your MOD, instead of v3.4, I am figuratively using a clean install of 3.3.05 for editing. It's not entirely clean. I do have other MODs installed ... just not in that area of my forum's topic.asp.

Here are my questions/comments for v3.3.05's topic.asp:

I understand that the Last Post function is a feature in v3.4.xx whereas it was only offered as a MOD previously, so I would have to modify my topic.asp file to make it show in the Last Post column.

In the 3.3.05 install, the table fields you mentioned are not listed.

Is it safe to just copy the fields from the v3.4 (either v3.4.00 or v3.4.01 - I have both) Access 2000 database and paste them into my v3.3.05 Access 2000 database? I'd rather do this than rename things.

I suppose I need to grab the and add it to my forum?

When it came to the actual editing of the topic.asp file, there is a part in v3.4 topic.asp that I found wasn't in the v3.3.05 topic.asp.

Please help me understand if what I did below is correct. The first part is the non-modded v3.3.05 topic.asp code. The second part is the modded topic.asp code for my forum. (Also, please let me know about that database fields. Thanks!

----------------------------------------------------------




A clean install of v3.3.05's topic.asp ...

First part to be edited:

set rsTopic = my_Conn.Execute (StrSql)

if rsTopic.EOF then
recTopicCount = ""
rsTopic.close
set rsTopic = Nothing
Response.Redirect("link.asp?TOPIC_ID=" & Topic_ID & "")
' Response.Redirect(strForumURL)
else
recTopicCount = 1
Cat_Status = rsTopic("CAT_STATUS")
Cat_ID = rsTopic("CAT_ID")
Cat_Subscription = rsTopic("CAT_SUBSCRIPTION")


Second part to be edited:

rsTopic.close
set rsTopic = Nothing

'## Forum_SQL
strSql = "UPDATE " & strActivePrefix & "TOPICS "


My v3.3.05's topic.asp with your modifications ...

First part edited:

set rsTopic = my_Conn.Execute (StrSql)

if rsTopic.EOF then
recTopicCount = ""
rsTopic.close
set rsTopic = Nothing
Response.Redirect("link.asp?TOPIC_ID=" & Topic_ID & "")
' Response.Redirect(strForumURL)
else
recTopicCount = 1
Cat_Status = rsTopic("CAT_STATUS")
Cat_ID = rsTopic("CAT_ID")
Cat_Subscription = rsTopic("CAT_SUBSCRIPTION")


Second part edited:

rsTopic.close
set rsTopic = Nothing

if recTopicCount = "" then
if ArchiveView <> "true" then
Response.Redirect("topic.asp?ARCHIVE=true&"&Request.QueryString)
else
Response.Redirect("default.asp")
end if


'## Forum_SQL
strSql = "UPDATE " & strActivePrefix & "TOPICS "

- - - - - - - - - - - - - - - - - - - - - - - - - - - -

Just for reference ... v3.4's topic.asp looks like this:


if rsTopic.EOF then
recTopicCount = ""
else
recTopicCount = 1
Member_Name = rsTopic(strDBNTSQLName)
Member_ReceiveMail = rsTopic("M_RECEIVE_EMAIL")
Member_AIM = rsTopic("M_AIM")
Member_ICQ = rsTopic("M_ICQ")
Member_MSN = rsTopic("M_MSN")
Member_YAHOO = rsTopic("M_YAHOO")
Member_Title = rsTopic("M_TITLE")
Member_Homepage = rsTopic("M_HOMEPAGE")
TMember_ID = rsTopic("MEMBER_ID")
Member_Level = rsTopic("M_LEVEL")
Member_Posts = rsTopic("M_POSTS")
Member_Country = rsTopic("M_COUNTRY")
Topic_Date = rsTopic("T_DATE")
Topic_Subject = rsTopic("T_SUBJECT")
Topic_Author = rsTopic("T_AUTHOR")
TopicID = rsTopic("TOPIC_ID")
Topic_Status = rsTopic("T_STATUS")
Topic_LastEdit = rsTopic("T_LAST_EDIT")
Topic_LastEditby = rsTopic("T_LAST_EDITBY")
Topic_LastPost = rsTopic("T_LAST_POST")
Topic_Sig = rsTopic("T_SIG")
Topic_Replies = rsTopic("T_REPLIES")
Cat_Status = rsTopic("CAT_STATUS")
Cat_ID = rsTopic("CAT_ID")

Cat_Name = rsTopic("CAT_NAME")
Cat_Subscription = rsTopic("CAT_SUBSCRIPTION")
Cat_Moderation = rsTopic("CAT_MODERATION")
'... (etc.)

- - - - - - - - - - - - - - - - - - - - - - - - - - - -

------------------------------------------------------


Did I do the parts in red correctly?

Also, I understand that the Jump to Last Post feature involves other pages like default.asp and forum.asp just to name a couple of files. Can I apply this same code of yours to those files as well, or do I need to install either BabyGate's or DoraMoon's MODs to get the Jump To feature to work there?

I think that question needs some more clarification. If I understand correctly, your MOD links to archives, and the other MODs were created for current topics for v3.3.xx. However, in the back of my mind I am thinking that your MOD does both current and archived topics. At least, I am hoping it does both.

So, I suppose what I am trying to ask is this ... do I need the one of the older Last Post MODs installed on my 3.3.05 forum first before your MOD will work on my forum, or can I just use your MOD (perhaps with some additional tweaking for v3.3.05 if needed) as a stand-alone instead of the other MODs.

Thanks for sticking with me through this mess and tangle of questions and requests!


Cheers,

Etymon




Edited by - Etymon on 25 August 2002 10:37:52
Go to Top of Page

ruirib
Snitz Forums Admin

Portugal
26364 Posts

Posted - 25 August 2002 :  10:53:47  Show Profile  Send ruirib a Yahoo! Message
Etymon,

I haven't looked at Snitz 3.3.05 to add support for this feature. Also I don't plan on releasing the mod for 3.3.05.

The support to the Jump To Last Post feature is achieved basically through the addition of a field to the TOPICS, A_TOPICS (T_LAST_POST_REPLY_ID) and FORUM (F_LAST_POST_REPLY_ID) tables. Then there are some code changes to display the link to that last post in default.asp, forum.asp and active.asp.
There is some code in topic.asp to determine the correct page number for the last reply and to allow archived topics to jump to this last post also.

As you can see there are several changes that need to be done. I can't understand the changes you propose above, for several reasons:

1. I haven't looked at topic.asp/3.3.xx to see how this could be done
2. I don't know what line numbers are you talking about
3. I can't understand what you propose to change above, except the addition of the Archive=true to the query string, but even then, because of note 1 above, I don't know if this is the correct thing to do.

Etymon, I think that it would be better to ask Dora Moon what was the mod she used and start from there. I have such a load of things to do that I really cannot afford to try to implement the Jump To Last Post mod for 3.3.05 myself, and there are already solutions to that posted out there.

I'm sorry that I cannot be of further help, but remember that I just posted a small add-on to take full advantage of a new 3.4 feature, not to implement the feature itself.


Snitz 3.4 Readme | Like the support? Support Snitz too

Edited by - ruirib on 25 August 2002 11:04:00
Go to Top of Page

DoraMoon
Average Member

Taiwan
661 Posts

Posted - 25 August 2002 :  11:49:55  Show Profile
hi~ Etymon

i'm also not understand very well about your problem...

i think there're a little difference with "Babygate's Last Post Mod + v3.3.x" and "the last post function in v3.4"

in 3.4, it use topic.asp?TOPIC_ID=xxx&REPLY_ID=yyy to link to last post.
in 3.3+LastPost Mod, it just like this topic.asp?TOPIC_ID=xxx#yyy

but i think they should be the same rule, we need a new database field to store the Last Reply ID value (in 3.4, it's T_LAST_POST_REPLY_ID, and in 3.3 LastPost Mod it's T_LAST_POSTER..)

and ruirib's mod, it do the update work to let the jump to last post funtion also available to those OLDER topics in your forum..
(maybe someone should suggest to Richard.. i notice this forum did'nt apply ruirib's mod yet~ so if you try to look a old topic, the is NOT Work !! )

and something make me confuse.... the Last Post Mod should be "No need to change anything to topic.asp", it just modify defaul.asp, forum.asp, and active.asp to add a arrow link....
so i really don't know why you must edit the topic.asp file...

i'm not familar to new 3.4 files yet... will try to get some clue to help you these days...
Go to Top of Page

ruirib
Snitz Forums Admin

Portugal
26364 Posts

Posted - 25 August 2002 :  11:57:23  Show Profile  Send ruirib a Yahoo! Message
quote:
Originally posted by DoraMoon


and something make me confuse.... the Last Post Mod should be "No need to change anything to topic.asp", it just modify defaul.asp, forum.asp, and active.asp to add a arrow link....
so i really don't know why you must edit the topic.asp file...


The need to add a change to topic.asp derives from the need to show the proper page number for that last post. If your topic has several pages, when you jump to a page at the end of the topic (for a new reply) or at somewhere in the middle (for an edit, for example), you still need to show the correct page number for the page where that last topic is located. Of course, this must be done in topic.asp.


Snitz 3.4 Readme | Like the support? Support Snitz too

Edited by - ruirib on 25 August 2002 12:01:06
Go to Top of Page

Etymon
Advanced Member

United States
2385 Posts

Posted - 26 August 2002 :  00:34:05  Show Profile  Visit Etymon's Homepage

That's ok, thanks. I was just trying to learn how to apply it in 3.3.05 since I am more familiar with it. I'm struggling at learning ASP to some degree ... just wanted to stick with what I knew best.

Thanks again for the MOD, ruirib.

Etymon
Go to Top of Page

ruirib
Snitz Forums Admin

Portugal
26364 Posts

Posted - 26 August 2002 :  06:21:37  Show Profile  Send ruirib a Yahoo! Message
The problem is that you'll have a bit of work to apply it to 3.3.05. It's not a problem with the tables, it's just the changes to the code. It can be done however, but if you're really interested in having it, maybe starting with an existing mod and tweaking it can be a bit easier.


Snitz 3.4 Readme | Like the support? Support Snitz too
Go to Top of Page

ruirib
Snitz Forums Admin

Portugal
26364 Posts

Posted - 29 August 2002 :  20:40:26  Show Profile  Send ruirib a Yahoo! Message
Just a small update on this: today I found out a situation where the required info won't be propely filled.
That is the situation where a reply (last or not) has been edited, after the last reply was made. Since that change is only registered, for versions prior to 3.4, in the topics table and inside the text of edited reply, it's not possible to determine the edited reply and the last reply id field both for topic and forum may be left with the value 0.

This will only happen in that situation, so the usefullness of the mod remains, IMO.


Snitz 3.4 Readme | Like the support? Support Snitz too
Go to Top of Page

James
Average Member

USA
539 Posts

Posted - 01 September 2002 :  20:34:50  Show Profile  Visit James's Homepage
Great mod Ruirib.

Maybe it can be added to the tools.zip of the download (have to have a short readme with it).
Go to Top of Page
Page: of 2 Previous Topic Topic Next Topic  
Next Page
 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