Web Wiz - Green Windows Web Hosting

  New Posts New Posts RSS Feed - CDate error in some posts
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

CDate error in some posts

 Post Reply Post Reply Page  <12
Author
Gargaleo View Drop Down
Newbie
Newbie
Avatar

Joined: 01 June 2004
Status: Offline
Points: 20
Post Options Post Options   Thanks (0) Thanks(0)   Quote Gargaleo Quote  Post ReplyReply Direct Link To This Post Posted: 04 July 2004 at 4:30am

I got the same error after chamging the host of the forum!
As i see nobody here had a solution for this problem i opened "functions_format_post" and changed it a little and resolved the problem. infortunatelly when someone edit a post, it cant tell anymore the date and time it was edited but still says who did it.

Here is the code, all you have to do is coment the lines where inserts the date and time.
Im a asp noob, another solution is welcome.
Sorry for the awful english

'******************************************
'***        Display edit author  ***
'******************************************


'This function formats XML into the name of the author and edit date and time if a message has

been edited
'XML is used so that the date can be stored as a double npresion number so that it can display

the local edit time to the message reader
Function editedXMLParser(ByVal strMessage)

  'Declare variables
  Dim strEditedAuthor  'Holds the name of the author who is editing the

post
  Dim dtmEditedDate    'Holds the date the post was edited
  Dim lngStartPos  'Holds search start postions
  Dim lngEndPos  'Holds end start postions


  'Get the start and end in the message of the author who edit the post
  lngStartPos = InStr(1, strMessage, "<editID>", 1) + 8
  lngEndPos = InStr(1, strMessage, "</editID>", 1)
  If lngEndPos < lngStartPos Then lngEndPos = lngStartPos
  

  'If there is something returned get the authors name
  strEditedAuthor = Trim(Mid(strMessage, lngStartPos,

lngEndPos-lngStartPos))

  'Get the start and end in the message of the date the message was edited
  'lngStartPos = InStr(1, strMessage, "<editDate>", 1) + 10
  'lngEndPos = InStr(1, strMessage, "</editDate>", 1)
  'If lngEndPos < lngStartPos Then lngEndPos = lngStartPos

  'If there is something returned get the date the message was edited
  'dtmEditedDate = Trim(Mid(strMessage, lngStartPos,

lngEndPos-lngStartPos))

  'If it is a date then read convert it to a date otherwise set the variable to 0
  If isNumeric(dtmEditedDate) Then dtmEditedDate = CDate(dtmEditedDate)

Else dtmEditedDate = 0


  'Get the start and end position in the string of the XML to remove
  lngStartPos = InStr(1, strMessage, "<edited>", 1)
  lngEndPos = InStr(1, strMessage, "</edited>", 1) + 9
  If lngEndPos < lngStartPos Then lngEndPos = lngStartPos

  'If there is something returned strip the XML from the message
  strMessage = Replace(strMessage, Trim(Mid(strMessage, lngStartPos,

lngEndPos-lngStartPos)), "", 1, -1, 1)


  'Place the date and time into the message for when the post was edited
  If strEditedAuthor <> "" Then
   editedXMLParser = strMessage & "<span class=""smText""><br

/><br />" & strTxtEditBy & " " & strEditedAuthor & " </span>"
  End If

End Function

Back to Top
Phat View Drop Down
Senior Member
Senior Member


Joined: 23 February 2003
Status: Offline
Points: 386
Post Options Post Options   Thanks (0) Thanks(0)   Quote Phat Quote  Post ReplyReply Direct Link To This Post Posted: 04 July 2004 at 9:12pm
Originally posted by Gargaleo Gargaleo wrote:


  'If it is a date then read convert it to a date otherwise set the variable to 0
  If isNumeric(dtmEditedDate) Then dtmEditedDate = CDate(dtmEditedDate)



You could try changing above to
If isDate(dtmEditedDate) Then dtmEditedDate = CDate(dtmEditedDate)

or

If isDate(dtmEditedDate) Then dtmEditedDate = FormatDateTime(dtmEditedDate,0)
Back to Top
 Post Reply Post Reply Page  <12

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.