Active Topics Filter broken?
Printed From: Web Wiz Forums
Category: Web Wiz Web App Support Forums
Forum Name: Web Wiz Forums
Forum Description: Support forum for Web Wiz Forums application.
URL: https://forums.webwiz.net/forum_posts.asp?TID=10338
Printed Date: 12 April 2026 at 12:12am Software Version: Web Wiz Forums 12.08 - https://www.webwizforums.com
Topic: Active Topics Filter broken?
Posted By: D__G
Subject: Active Topics Filter broken?
Date Posted: 07 May 2004 at 3:15pm
|
Hey all, 1st of all, let me apologise if this question has been answered elsewhere in this forum. I have searched but can find queries similar to mine, but no end fix..so here goes...
Up until yesterday forum (access 7.51a) worked fine. Now I find that the active topics wont show any posts unless the filter is set to "yesterday" when it will show all post made within the last 24 hours. All other filters "last login, last 15 mins right up to 16 hours" all show no posts.
I have edited my common.asp, admin/common.asp and active_topics.asp to show LCID 2057(UK-English) and have checked that server(based in England) is also set to this.
Here is a link to my forum, you dont have to register, to see what the problem is. If you click on active topics and select "yesterday" you will see a good many posts all made within the last few hours, but if you select anything other than "yesterday", you see no posts.
http://www.sfhclan.co.uk/aspnuke/nuforum/default.asp - http://www.sfhclan.co.uk/aspnuke/nuforum/default.asp
Can anyone help, or have any ideas?
|
Replies:
Posted By: dj air
Date Posted: 07 May 2004 at 3:21pm
|
firstly its best to update to the latest version as there has been some mojor security patchs and features added.
as you are using access it is at the most inportance you update as access is at the greatest risk.
all you have to do is update the .asp files as there has not been any database changes since 7.01.
|
Posted By: D__G
Date Posted: 07 May 2004 at 4:07pm
|
Thanks mate, I have set up a 7.8 forum on my site and transferred database across. Unfortunately it is still the same, no filters on active topics work except "yesterday". (I have also edited new common, and active_topics file to LCID 2057 for UK).
Any more info you can help me with, please? 
|
Posted By: WebWiz-Bruce
Date Posted: 08 May 2004 at 9:21am
Try setting the LCID number to US or another locale to see if that sorts it.
I found it stoped working on my own test machine in other day but started to work again after a reboot for some reason.
------------- https://www.webwiz.net/web-wiz-forums/forum-hosting.htm" rel="nofollow - Web Wiz Forums Hosting https://www.webwiz.net/web-hosting/windows-web-hosting.htm" rel="nofollow - ASP.NET Web Hosting
|
Posted By: D__G
Date Posted: 08 May 2004 at 10:01am
OK I will try setting to English US -1033 and report back. Thanks -boRg-
|
Posted By: D__G
Date Posted: 08 May 2004 at 10:16am
|
Lo all,
I changed the LCID in the 7.8 access version I set up, and it is still only showing results from from filter "Yesterday".
I did note that all through my changes to various LCID's, the bit at top left of the forum which says the current time and time of last visit has always stayed correct...
(The time now is 08 May 2004 at 3:09pm. You last visited on 08 May 2004 at 1:06pm)
...and every post I have made during these tests has the correct time on it. Should this be so, if I am changing the LCID or am I confusing its purpose?
In any case changing LCID's doesn't appear to work.
Are there any other suggestions you can make, that I may try?
Thanks to everyone for taking the time to read this thread, and more importantly, thankyou to those who have so far replied. I feel you may yet save my sanity!
|
Posted By: D__G
Date Posted: 08 May 2004 at 7:26pm
|
Any ideas, Anyone?
My sanity is beginning to suffer and I am pulling my hair (what's left of it) out! 
|
Posted By: WebWiz-Bruce
Date Posted: 09 May 2004 at 12:55pm
Try rebooting the server or updating the MDAC drivers (www.microsoft.com/data) on the server.
------------- https://www.webwiz.net/web-wiz-forums/forum-hosting.htm" rel="nofollow - Web Wiz Forums Hosting https://www.webwiz.net/web-hosting/windows-web-hosting.htm" rel="nofollow - ASP.NET Web Hosting
|
Posted By: D__G
Date Posted: 09 May 2004 at 12:58pm
Ok thanks -boRg-, I will speak to my hosts and see what they can do, and report back. Thanks again
|
Posted By: D__G
Date Posted: 09 May 2004 at 2:29pm
|
Message from my hosts is that all components/drivers are up to date, and that the machine is restarted weekly.
Anything else you can suggest I check? Please?
|
Posted By: D__G
Date Posted: 09 May 2004 at 5:37pm
|
Could it be a cookie problem? As far as I understand (I may be wrong ), the database stores time of last login and time of last post, but is there a cookie which is read to indicate also the time you logged in?
If something is wrong with this cookie, then is it possible that whilst the database records are correct for last login and last user post, if the cookie isnt being read properly or wasnt set properly, then it really wont make a difference what is in the database?
I hope you guys can understand what Im getting at, cos its confusing me!
|
Posted By: WebWiz-Bruce
Date Posted: 10 May 2004 at 12:36pm
It won't be a cookie problem.
I'm afraid I'm out of options for you to do, it looks like then that
something has been altered on the server that means that the active
topics feature is not compatiable with the server you are on. The only
option left is to move to another server/host that maybe compatible.
------------- https://www.webwiz.net/web-wiz-forums/forum-hosting.htm" rel="nofollow - Web Wiz Forums Hosting https://www.webwiz.net/web-hosting/windows-web-hosting.htm" rel="nofollow - ASP.NET Web Hosting
|
Posted By: D__G
Date Posted: 11 May 2004 at 2:05pm
|
I hear you -boRg-, I have tried the forum on another site hosted by the same company, and its the same 
I have, however found a workaround which restores 90% functionality to active topics, if you could look at it and maybe advise on the last 10%?
active_topics.asp
I have edited the above file and commented out the following lines.
'Initialse the string to display when active topics are shown since 'Select Case intShowTopicsFrom ' Case 1 'Filter the recorset to leave only active topics since last vists (Filter used for overcome incompatibilty problems between application and database) ' rsForum.Filter = "Last_entry_date > #" & CDate(Session("dtmLastVisit")) & "#" ' case 2 ' rsForum.Filter = "Last_entry_date > #" & DateAdd("n", -15, Now()) & "#" ' case 3 ' rsForum.Filter = "Last_entry_date > #" & DateAdd("n", -30, Now()) & "#" ' Case 4 ' rsForum.Filter = "Last_entry_date > #" & DateAdd("n", -45, Now()) & "#" ' Case 5 ' rsForum.Filter = "Last_entry_date > #" & DateAdd("h", -1, Now()) & "#" ' Case 6 ' rsForum.Filter = "Last_entry_date > #" & DateAdd("h", -2, Now()) & "#" ' Case 7 ' rsForum.Filter = "Last_entry_date > #" & DateAdd("h", -4, Now()) & "#" ' Case 8 ' rsForum.Filter = "Last_entry_date > #" & DateAdd("h", -6, Now()) & "#" ' Case 9 ' rsForum.Filter = "Last_entry_date > #" & DateAdd("h", -8, Now()) & "#" ' Case 10 ' rsForum.Filter = "Last_entry_date > #" & DateAdd("h", -12, Now()) & "#" ' Case 11 ' rsForum.Filter = "Last_entry_date > #" & DateAdd("h", -16, Now()) & "#" 'End Select
Also I have commented these lines out
' case 2 ' strShowTopicsFrom = strTxtLastFifteenMinutes ' dblActiveFrom = 1 ' case 3 ' strShowTopicsFrom = strTxtLastThirtyMinutes ' dblActiveFrom = 1 ' Case 4 ' strShowTopicsFrom = strTxtLastFortyFiveMinutes ' dblActiveFrom = 1 ' Case 5 ' strShowTopicsFrom = strTxtLastHour ' dblActiveFrom = 1 ' Case 6 ' strShowTopicsFrom = strTxtLastTwoHours ' dblActiveFrom = 1 ' Case 7 ' strShowTopicsFrom = strTxtLastFourHours ' dblActiveFrom = 1 ' Case 8 ' strShowTopicsFrom = strTxtLastSixHours ' dblActiveFrom = 1 ' Case 9 ' strShowTopicsFrom = strTxtLastEightHours ' dblActiveFrom = 1 ' Case 10 ' strShowTopicsFrom = strTxtLastTwelveHours ' dblActiveFrom = 1 ' Case 11 ' strShowTopicsFrom = strTxtLastSixteenHours ' dblActiveFrom = 1
Case 12 strShowTopicsFrom = strTxtYesterday dblActiveFrom = 1 Case 13 strShowTopicsFrom = strTxtLastWeek dblActiveFrom = 7 Case 14 strShowTopicsFrom = strTxtLastMonth dblActiveFrom = 28
and I have inserted these lines in the same place
case 2 strShowTopicsFrom = strTxtLastFifteenMinutes dblActiveFrom = 0.0104166 case 3 strShowTopicsFrom = strTxtLastThirtyMinutes dblActiveFrom = 0.0208333 Case 4 strShowTopicsFrom = strTxtLastFortyFiveMinutes dblActiveFrom = 0.0312498 Case 5 strShowTopicsFrom = strTxtLastHour dblActiveFrom = 0.0416666 Case 6 strShowTopicsFrom = strTxtLastTwoHours dblActiveFrom = 0.0833333 Case 7 strShowTopicsFrom = strTxtLastFourHours dblActiveFrom = 0.1666666 Case 8 strShowTopicsFrom = strTxtLastSixHours dblActiveFrom = 0.2499999 Case 9 strShowTopicsFrom = strTxtLastEightHours dblActiveFrom = 0.3333332 Case 10 strShowTopicsFrom = strTxtLastTwelveHours dblActiveFrom = 0.4999998 Case 11 strShowTopicsFrom = strTxtLastSixteenHours dblActiveFrom = 0.6666664 Case 12 strShowTopicsFrom = strTxtYesterday dblActiveFrom = 1 Case 13 strShowTopicsFrom = strTxtLastWeek dblActiveFrom = 7 Case 14 strShowTopicsFrom = strTxtLastMonth dblActiveFrom = 28
I did this because I found that no active topic filters worked except "Yesterday", "Last week" and "last month". By trial an error I found the bit in the code which seemed to relate to those filters, ie 1 day, 7 days and 28 days, then I edited the code to show each case as a decimal fraction of one day.
EG. the line
case 2 strShowTopicsFrom = strTxtLastFifteenMinutes dblActiveFrom = 1
became
case 2 strShowTopicsFrom = strTxtLastFifteenMinutes dblActiveFrom = 0.0104166
This seems to work for all except active topics since last login (which I havent touched, as I cant work out how it works)
Here is the code for case 1 (topics since last login)
Case 1 strShowTopicsFrom = strTxtLastVisitOn & " " & DateFormat(Session("dtmLastVisit"), saryDateTimeData) & " " & strTxtAt & " " & TimeFormat(Session("dtmLastVisit"), saryDateTimeData) dblActiveFrom = DateDiff("d", Session("dtmLastVisit"), Now()) + 1
There is obviously something here, I reckon that my server/host doesnt understand, do you have an alternative I could use in place of this, so I can get active topics since last login working and get that final 10% functionality back?
Also, do you think these changes are ok, or have I compromised something else by doing them, and maybe risk some problem in future?
I ask this second question because some of the lines I commented out include the text..
'Filter the recorset to leave only active topics since last vists (Filter used for overcome incompatibilty problems between application and database)
What incompatibility problems am I risking?
Hopefully, using this limited information, you may be able to suggest something else to me. Also I apologise to everyone about the length of this post and possibly it's somewhat confusing layout. Hope you can understand what I've done, and what my aim is. 
Thanks again to everyone for taking the time/trouble to read (and hopefully reply!)
|
Posted By: D__G
Date Posted: 11 May 2004 at 4:19pm
|
Right - success, further to my last post when I had everything apart from active topics since "lastlogin". I have changed the code in active_topics.asp for case 1 from this :
'Initialse the string to display when active topics are shown since Select Case intShowTopicsFrom Case 1 strShowTopicsFrom = strTxtLastVisitOn & " " & DateFormat(Session("dtmLastVisit"), saryDateTimeData) & " " & strTxtAt & " " & TimeFormat(Session("dtmLastVisit"), saryDateTimeData) dblActiveFrom = DateDiff("d", Session("dtmLastVisit"), Now()) + 1
to this :
'Initialse the string to display when active topics are shown since dim timediff Select Case intShowTopicsFrom Case 1 strShowTopicsFrom = strTxtLastVisitOn & " " & DateFormat(Session("dtmLastVisit"), saryDateTimeData) & " " & strTxtAt & " " & TimeFormat(Session("dtmLastVisit"), saryDateTimeData) ' dblActiveFrom = DateDiff("d", Session("dtmLastVisit"), Now()) + 1 timediff = DateDiff("n", Session("dtmLastVisit"), Now()) dblActiveFrom = (timediff / 1440)
Basically it seems to get the difference in minutes between the servers time and the last login time, then divides it by 1440 (As there are 1440 minutes in 1 day). This is in line with my other revisions to include fractions in the other cases to reflect times
IE to get 15 mins, i divided 15 by total number of minutes in 1 day (1440) and that gives 0.0104166, and so on..
I am no expert on this, far from it, but by trial and error, these modifications seem to work.
Here are the modified sections of active_topics.asp that I have changed, which now seem to work fully, as I said in my last post, I'd like comments from anyone who knows, about how this may affect ongoing functionality of my forum and what incompatibility problems may occur since I have commented out the whole section which refers to filtering the recordset to avoid compatibility probs between application and database.
1st part:
'Initialse the string to display when active topics are shown since dim timediff Select Case intShowTopicsFrom Case 1 strShowTopicsFrom = strTxtLastVisitOn & " " & DateFormat(Session("dtmLastVisit"), saryDateTimeData) & " " & strTxtAt & " " & TimeFormat(Session("dtmLastVisit"), saryDateTimeData) ' dblActiveFrom = DateDiff("d", Session("dtmLastVisit"), Now()) + 1 timediff = DateDiff("n", Session("dtmLastVisit"), Now()) dblActiveFrom = (timediff / 1440) ' case 2 ' strShowTopicsFrom = strTxtLastFifteenMinutes ' dblActiveFrom = 1 ' case 3 ' strShowTopicsFrom = strTxtLastThirtyMinutes ' dblActiveFrom = 1 ' Case 4 ' strShowTopicsFrom = strTxtLastFortyFiveMinutes ' dblActiveFrom = 1 ' Case 5 ' strShowTopicsFrom = strTxtLastHour ' dblActiveFrom = 1 ' Case 6 ' strShowTopicsFrom = strTxtLastTwoHours ' dblActiveFrom = 1 ' Case 7 ' strShowTopicsFrom = strTxtLastFourHours ' dblActiveFrom = 1 ' Case 8 ' strShowTopicsFrom = strTxtLastSixHours ' dblActiveFrom = 1 ' Case 9 ' strShowTopicsFrom = strTxtLastEightHours ' dblActiveFrom = 1 ' Case 10 ' strShowTopicsFrom = strTxtLastTwelveHours ' dblActiveFrom = 1 ' Case 11 ' strShowTopicsFrom = strTxtLastSixteenHours ' dblActiveFrom = 1 case 2 strShowTopicsFrom = strTxtLastFifteenMinutes dblActiveFrom = 0.0104166 case 3 strShowTopicsFrom = strTxtLastThirtyMinutes dblActiveFrom = 0.0208333 Case 4 strShowTopicsFrom = strTxtLastFortyFiveMinutes dblActiveFrom = 0.0312498 Case 5 strShowTopicsFrom = strTxtLastHour dblActiveFrom = 0.0416666 Case 6 strShowTopicsFrom = strTxtLastTwoHours dblActiveFrom = 0.0833333 Case 7 strShowTopicsFrom = strTxtLastFourHours dblActiveFrom = 0.1666666 Case 8 strShowTopicsFrom = strTxtLastSixHours dblActiveFrom = 0.2499999 Case 9 strShowTopicsFrom = strTxtLastEightHours dblActiveFrom = 0.3333332 Case 10 strShowTopicsFrom = strTxtLastTwelveHours dblActiveFrom = 0.4999998 Case 11 strShowTopicsFrom = strTxtLastSixteenHours dblActiveFrom = 0.6666664 Case 12 strShowTopicsFrom = strTxtYesterday dblActiveFrom = 1 Case 13 strShowTopicsFrom = strTxtLastWeek dblActiveFrom = 7 Case 14 strShowTopicsFrom = strTxtLastMonth dblActiveFrom = 28 End Select
2nd part :
'Initialse the string to display when active topics are shown since 'Select Case intShowTopicsFrom ' Case 1 'Filter the recorset to leave only active topics since last vists (Filter used for overcome incompatibilty problems between application and database) ' rsForum.Filter = "Last_entry_date > #" & CDate(Session("dtmLastVisit")) & "#" ' case 2 ' rsForum.Filter = "Last_entry_date > #" & DateAdd("n", -15, Now()) & "#" ' case 3 ' rsForum.Filter = "Last_entry_date > #" & DateAdd("n", -30, Now()) & "#" ' Case 4 ' rsForum.Filter = "Last_entry_date > #" & DateAdd("n", -45, Now()) & "#" ' Case 5 ' rsForum.Filter = "Last_entry_date > #" & DateAdd("h", -1, Now()) & "#" ' Case 6 ' rsForum.Filter = "Last_entry_date > #" & DateAdd("h", -2, Now()) & "#" ' Case 7 ' rsForum.Filter = "Last_entry_date > #" & DateAdd("h", -4, Now()) & "#" ' Case 8 ' rsForum.Filter = "Last_entry_date > #" & DateAdd("h", -6, Now()) & "#" ' Case 9 ' rsForum.Filter = "Last_entry_date > #" & DateAdd("h", -8, Now()) & "#" ' Case 10 ' rsForum.Filter = "Last_entry_date > #" & DateAdd("h", -12, Now()) & "#" ' Case 11 ' rsForum.Filter = "Last_entry_date > #" & DateAdd("h", -16, Now()) & "#" 'End Select
|
Posted By: D__G
Date Posted: 13 May 2004 at 2:33am
|
Can anyone tell me is this (although it works) will be ok?
|
Posted By: D__G
Date Posted: 15 May 2004 at 8:30am
|
-boRg_ Please post your thoughts on what Ive done, let me know if it seems ok or if if borked it up by doing this :/
|
Posted By: WebWiz-Bruce
Date Posted: 15 May 2004 at 3:44pm
If it works for you then I can't see any problem, but I do remember
doing some testing with the type of thing you are changing it to, and I
can't remember why now but I think something ment it wouldn't work on
some servers, or with SQL server or something along those lines.
------------- https://www.webwiz.net/web-wiz-forums/forum-hosting.htm" rel="nofollow - Web Wiz Forums Hosting https://www.webwiz.net/web-hosting/windows-web-hosting.htm" rel="nofollow - ASP.NET Web Hosting
|
Posted By: D__G
Date Posted: 15 May 2004 at 4:37pm
ok m8, thanks
|
Posted By: Kolyanich
Date Posted: 20 September 2005 at 7:31am
|
Hello
I've just fixed a problem for myself, hope it well be useful for someone else using MSSQL database with different locale settings. Solution is to add some extra code to common asp:
Function MyCDate(val)
If VarType(val) = 8 Then 'vbString Dim s If Session.LCID = 1049 Then s = Replace(val, ".", ",") Else s = Replace(val, ",", ".") End If
MyCDate = CDate(s) Else MyCDate = CDate(val) End If
End Function
Function UDate(val) Dim v v = MyCDate(val) UDate = Year(v) & "/" & Month(v) & "/" & Day(v) & " " & TimeValue(v) End Function
and fix at active topics.asp:
'Initialse the string to display when active topics are shown since Select Case intShowTopicsFrom Case 1 'Filter the recorset to leave only active topics since last vists (Filter used for overcome incompatibilty problems between application and database) rsForum.Filter = "Last_entry_date > #" & UDate(Session("dtmLastVisit")) & "#" case 2 rsForum.Filter = "Last_entry_date > #" & UDate(DateAdd("n", -15, Now())) & "#" case 3 rsForum.Filter = "Last_entry_date > #" & UDate(DateAdd("n", -30, Now())) & "#" Case 4 rsForum.Filter = "Last_entry_date > #" & UDate(DateAdd("n", -45, Now())) & "#" Case 5 rsForum.Filter = "Last_entry_date > #" & UDate(DateAdd("h", -1, Now())) & "#" Case 6 rsForum.Filter = "Last_entry_date > #" & UDate(DateAdd("h", -2, Now())) & "#" Case 7 rsForum.Filter = "Last_entry_date > #" & UDate(DateAdd("h", -4, Now())) & "#" Case 8 rsForum.Filter = "Last_entry_date > #" & UDate(DateAdd("h", -6, Now())) & "#" Case 9 rsForum.Filter = "Last_entry_date > #" & UDate(DateAdd("h", -8, Now())) & "#" Case 10 rsForum.Filter = "Last_entry_date > #" & UDate(DateAdd("h", -12, Now())) & "#" Case 11 rsForum.Filter = "Last_entry_date > #" & UDate(DateAdd("h", -16, Now())) & "#" End Select
and also code to global.asa (need to be created)
<SCRIPT LANGUAGE=VBSCRIPT RUNAT=SERVER>
Sub Session_OnStart() Session.LCID = 1049 End Sub
</SCRIPT>
with this fixups all works fine in default russian server settings, possibli will in other locales
|
|