Web Wiz - Green Windows Web Hosting - Celebrating 25 Years!

  New Posts New Posts RSS Feed - Active Topics Filter broken?
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Active Topics Filter broken?

 Post Reply Post Reply Page  <123
Author
WebWiz-Bruce View Drop Down
Admin Group
Admin Group
Avatar
Web Wiz Developer

Joined: 03 September 2001
Location: Bournemouth
Status: Offline
Points: 9844
Post Options Post Options   Thanks (0) Thanks(0)   Quote WebWiz-Bruce Quote  Post ReplyReply Direct Link To This Post 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.
Back to Top
D__G View Drop Down
Newbie
Newbie


Joined: 07 May 2004
Status: Offline
Points: 13
Post Options Post Options   Thanks (0) Thanks(0)   Quote D__G Quote  Post ReplyReply Direct Link To This Post Posted: 15 May 2004 at 4:37pm
ok m8, thanks
Back to Top
Kolyanich View Drop Down
Newbie
Newbie


Joined: 20 September 2005
Location: Kazakhstan
Status: Offline
Points: 1
Post Options Post Options   Thanks (0) Thanks(0)   Quote Kolyanich Quote  Post ReplyReply Direct Link To This Post 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
Back to Top
 Post Reply Post Reply Page  <123

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.08
Copyright ©2001-2026 Web Wiz Ltd.


Become a Fan on Facebook Follow us on X Connect with us on LinkedIn Web Wiz Blogs
About Web Wiz | Contact Web Wiz | Terms & Conditions | Cookies | Privacy Notice

Web Wiz is the trading name of Web Wiz Ltd. Company registration No. 05977755. Registered in England and Wales.
Registered office: Web Wiz Ltd, Unit 18, The Glenmore Centre, Fancy Road, Poole, Dorset, BH12 4FB, UK.

Prices exclude VAT at 20% unless otherwise stated. VAT No. GB988999105 - $, € prices shown as a guideline only.

Copyright ©2001-2026 Web Wiz Ltd. All rights reserved.