Update ; also support for DailyMotion videos!
DEMO: http://oxle.com/topic.asp?tid=3798
It's a bit harder, but ok ; you need to have the HTML code that the DailyMotion website provides.
For example this one:
<div style="margin-bottom:25px;margin-top:25px;"><div style="width:320px;text-align:left;">
<style type="text/css">
<!-- #idn5sabdqi7ui0zud5iuskzpdkw3jyex7q1yexjmz{width:320px;height:256px;border:none;margin:0px;}
--></style>
<iframe src="http://www.dailymotion.com/blog/video/124227?key=dn5sabdqi7ui0zud5iuskzpdkw3jyex7q1yexjmz"
style="width:320px;height:256px;border:none;margin:0px;" width="320" height="256"
frameborder="0" marginwidth="0" marginheight="0" scrolling="no" id="idn5sabdqi7ui0zud5iuskzpdkw3jyex7q1yexjmz">Dailymotion blogged video</iframe>
<br /><span style="margin-top:0px;"><a href="http://www.dailymotion.com/video/124227">QUAD LOOPING</a>
<br />Video sent by <a href="http://www.dailymotion.com/300KMH">300KMH</a>
<br /></span></div></div>
Strip out the entire URL of the iframe source.
Enclose it with [dm][/dm] ; that's it.
Add the following function to your inc_func_common.asp: fString = ReplaceDMTags(fString)
Function ReplaceDMTags(fString)
Dim oTag, cTag
Dim roTag, rcTag
Dim oTagPos, cTagPos
Dim nTagPos
Dim counter1, counter2
Dim strCodeText
Dim Tagcount
dim url
dim code
Dim strTempString, strResultString
TagCount = 2
Dim CodeTags(2,2,2)
Dim strArray, strArray2
CodeTags(1,1,1) = "[dm]"
CodeTags(1,2,1) = "[/dm]"
'user logged in, show the media
CodeTags(1,1,2) = "<div style=""margin-bottom:5px;margin-top:5px;""><div style=""width:320px;text-align:left;""><style type=""text/css""><!-- #id"
CodeTags(1,2,2) = """>Dailymotion blogged video</iframe></div></div>"
CodeTags(2,1,1) = "[DM]"
CodeTags(2,2,1) = "[/DM]"
CodeTags(2,1,2) = CodeTags(1,1,2)
CodeTags(2,2,2) = CodeTags(1,2,2)
strResultString = ""
strTempString = fString
for counter1 = 1 to TagCount
oTag = CodeTags(counter1,1,1)
roTag = CodeTags(counter1,1,2)
cTag = CodeTags(counter1,2,1)
rcTag = CodeTags(counter1,2,2)
oTagPos = InStr(1, strTempString, oTag, 1)
cTagPos = InStr(1, strTempString, cTag, 1)
if (oTagpos > 0) and (cTagPos > 0) then
strArray = Split(strTempString, oTag, -1)
for counter2 = 0 to Ubound(strArray)
if (Instr(1, strArray(counter2), cTag) > 0) then
strArray2 = split(strArray(counter2), cTag, -1)
strCodeText = trim(strArray2(0))
if instr(strCodeText,",") > 0 or _
instr(strCodeText,")") >0 or _
instr(strCodeText,"(") >0 or _
instr(strCodeText,";") >0 or _
instr(strCodeText,"""") >0 or _
instr(strCodeText,"<") >0 or _
instr(strCodeText,">") >0 or _
instr(strCodeText,"[") >0 or _
instr(strCodeText,"]") >0 or _
instr(strCodeText,",") >0 then
strCodeText = "illegal"
end if
if left(strCodeText,38) <> "http://www.dailymotion.com/blog/video/" then
strCodeText = "illegal"
end if
if len(strCodeText) > 100 or len(strCodeText) < 70 then
strCodeText = "illegal"
end if
if strCodeText <> "illegal" then
url = strCodeText
code = mid(url,(instr(url,"=")+2),len(url))
dm01 = "{width:320px;height:256px;border:none;margin:0px;} --></style><iframe src="""
dm02 = """ style=""width:320px;height:256px;border:none;margin:0px;"" width=""320"" height=""256"" frameborder=""0"" marginwidth=""0"" marginheight=""0"" scrolling=""no"" id=""id"
strResultString = strResultString & roTag & code & dm01 & url & dm02 & code & rcTag & strArray2(1)
else
strResultString = strResultString & strArray(counter2)
end if
else
strResultString = strResultString & strArray(counter2)
end if
next
strTempString = strResultString
strResultString = ""
end if
next
ReplaceDMTags = strTempString
end function
Don't forget to add this function to FormatStr, just above or below the line fString = ReplaceWMVTags(fString)
Also, add this line to the function ChkURLs;
(UCase(Right(strArray(Counter-1), 4)) <> "[DM]") and _
just below this line:
(UCase(Right(strArray(Counter-1), 5)) <> "[IMG]") and _
Enjoy.<