|
Ok I figured it out but for anyone else who would like to include following RED 9 lines into their code do the following from lines 712 to 830:
[code]
'****************************************** '*** Format Flash File Support *** '******************************************
'This function formats falsh codes Function formatFlash(ByVal strMessage)
'Declare variables Dim lngStartPos 'Holds search start postions Dim lngEndPos 'Holds end start postions Dim saryFlashAttributes 'Holds the features of the input flash file Dim intAttrbuteLoop 'Holds the attribute loop counter Dim strFlashWidth 'Holds the string value of the width of the Flash file Dim intFlashWidth 'Holds the interger value of the width of the flash file Dim strFlashHeight 'Holds the string value of the height of the Flash file Dim intFlashHeight 'Holds the interger value of the height of the flash file Dim strBuildFlashLink 'Holds the converted BBcode for the flash file Dim strTempFlashMsg 'Tempoary store for the BBcode Dim strFlashLink 'Holds the link to the flash file Dim strFlashVars 'Holds the FLASHVARS for the flash file
'Loop through all the codes in the message and convert them to formated flash links Do While InStr(1, strMessage, "[FLASH", 1) > 0 AND InStr(1, strMessage, "[/FLASH]", 1) > 0
'Initiliase variables intFlashWidth = 50 intFlashHeight = 50 strFlashLink = "" strFlashVars = "" strBuildFlashLink = "" strTempFlashMsg = ""
'Get the Flash BBcode from the message lngStartPos = InStr(1, strMessage, "[FLASH", 1) lngEndPos = InStr(lngStartPos, strMessage, "[/FLASH]", 1) + 8
'Make sure the end position is not in error If lngEndPos < lngStartPos Then lngEndPos = lngStartPos + 6
'Get the original Flash BBcode from the message strTempFlashMsg = Trim(Mid(strMessage, lngStartPos, lngEndPos-lngStartPos))
'Get the start and end in the message of the attributes of the Flash file lngStartPos = InStr(1, strTempFlashMsg, "[FLASH", 1) + 6 lngEndPos = InStr(lngStartPos, strTempFlashMsg, "]", 1)
'Make sure the end position is not in error If lngEndPos < lngStartPos Then lngEndPos = lngStartPos
'If there is something returned get the details (eg. dimensions) of the flash file If strTempFlashMsg <> "" Then
'Place any attributes for the flash file in an array saryFlashAttributes = Split(Trim(Mid(strTempFlashMsg, lngStartPos, lngEndPos-lngStartPos)), " ")
'Get the dimensions of the Flash file 'Loop through the array of atrributes that are for the falsh file to get the dimentions For intAttrbuteLoop = 0 To UBound(saryFlashAttributes)
'If this is the width attribute then read in the width dimention If InStr(1, saryFlashAttributes(intAttrbuteLoop), "WIDTH=", 1) Then
'Get the width dimention strFlashWidth = Replace(saryFlashAttributes(intAttrbuteLoop), "WIDTH=", "", 1, -1, 1)
'Make sure we are left with a numeric number if so convert to an interger and place in an interger variable If isNumeric(strFlashWidth) Then intFlashWidth = CInt(strFlashWidth) End If
'If this is the height attribute then read in the height dimention If InStr(1, saryFlashAttributes(intAttrbuteLoop), "HEIGHT=", 1) Then
'Get the height dimention strFlashHeight = Replace(saryFlashAttributes(intAttrbuteLoop), "HEIGHT=", "", 1, -1, 1)
'Make sure we are left with a numeric number if so convert to an interger and place in an interger variable If isNumeric(strFlashHeight) Then intFlashHeight = CInt(strFlashHeight) End If
'If this is the flashvars attribute then read in the flashvars dimention If InStr(1, saryFlashAttributes(intAttrbuteLoop), "FLASHVARS=", 1) Then
'Get the flashvars dimention strFlashVars = Replace(saryFlashAttributes(intAttrbuteLoop), "FLASHVARS=", "", 1, -1, 1) End If
Next
'Get the link to the flash file lngStartPos = InStr(1, strTempFlashMsg, "]", 1) + 1 lngEndPos = InStr(lngStartPos, strTempFlashMsg, "[/FLASH]", 1)
'Make sure the end position is not in error If lngEndPos < lngStartPos Th
|