'******************************************
'*** 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