Changed the code a little
forum_posts.asp
If InStr(1, strMessage, "[FPLAYER]", 1) > 0 AND InStr(1, strMessage, "[/FPLAYER]", 1) > 0 Then strMessage = formatFPLAYER(strMessage)
If InStr(1, strAuthorSignature, "[FPLAYER", 1) > 0 AND InStr(1, strAuthorSignature, "[/FPLAYER]", 1) > 0 Then strAuthorSignature = formatFPLAYER(strAuthorSignature)
functions_format_post.asp
'******************************************
'*** Start flash player Mod ***
'******************************************
'This function formats FPLAYER
Function formatFPLAYER(ByVal strMessage)
'Declare variables
Dim strFPLAYERLink 'Hold the You FPLAYER Link
Dim lngStartPos 'Holds search start postions
Dim lngEndPos 'Holds end start postions
Dim strBuildFPLAYER 'Holds the built coded message
Dim strOriginalFPLAYER 'Holds the code block in original format
'Loop through all the BB codes in the message and convert to a link to the FPLAYER movie
Do While InStr(1, strMessage, "[FPLAYER]", 1) > 0 AND InStr(1, strMessage, "[/FPLAYER]", 1) > 0
'Get the start and end of the FPLAYER BBcode
lngStartPos = InStr(1, strMessage, "[FPLAYER]", 1) + 6
lngEndPos = InStr(lngStartPos, strMessage, "[/FPLAYER]", 1)
'Make sure the end position is not in error
If lngEndPos < lngStartPos Then lngEndPos = lngStartPos + 6
'If there is a FPLAYER link then process
If lngEndPos > lngStartPos Then
'Get the FPLAYER link
strFPLAYERLink = Trim(Mid(strMessage, lngStartPos, lngEndPos-lngStartPos))
'Insert FPLAYER movie
strBuildFPLAYER = "<EMBED src=""albumplayer2.swf"" width=300 height=20 type=application/x-shockwave-flash allowfullscreen=""true"" allowscriptaccess=""always"" flashvars=""&file=" & strFPLAYERLink & "&height=140&width=240&frontcolor=0x999999&backcolor=0x00000&lightcolor=0x990000&&height=20&width=300"">"
End If
'Get the start and end position in the start and end position in the message of the BBcode FPLAYER
lngStartPos = InStr(1, strMessage, "[FPLAYER]", 1)
lngEndPos = InStr(lngStartPos, strMessage, "[/FPLAYER]", 1) + 7
'Make sure the end position is not in error
If lngEndPos < lngStartPos Then lngEndPos = lngStartPos + 6
'Get the original code to be replaced in the message
strOriginalFPLAYER = Trim(Mid(strMessage, lngStartPos, lngEndPos-lngStartPos))
'Replace the code codes in the message with the new formated code block
If strBuildFPLAYER <> "" Then
strMessage = Replace(strMessage, strOriginalFPLAYER, strBuildFPLAYER, 1, -1, 1)
Else
strMessage = Replace(strMessage, strOriginalFPLAYER, Replace(strOriginalFPLAYER, "[", "[", 1, -1, 1), 1, -1, 1)
End If
Loop
'Return the function
formatFPLAYER = strMessage
End Function
'******************************************
'*** End flash player Mod ***
'******************************************