Playing Photo Bucket Videos in Forum - Posted (2252 Views)
Junior Member
leesh695
Posts: 101
101
Hi,

I have Balex's Video Mod 1.00 installed on my forum but, I cannot get any photo bucket videos to play.
http://s301.photobucket.com/albums/nn80/SinnSinn/?action=view¤t=clip0099.flv
I have tried for a while to modify the code to make the video above play, but have been unsuccesful.
Can anyone please help me?sad<
 Sort direction, for dates DESC means newest first  
 Page size 
Posted
Junior Member
leesh695
Posts: 101
101
Hi,

I really need this feature and I try to make it work and I just cant. I would be willing to pay someone to help me make this work.<
Posted
Snitz Forums Admin
ruirib
Posts: 26364
26364
Does the mod include code to display photobucketvideos?<
Posted
Advanced Member
Carefree
Posts: 4224
4224
No, Ruirib, it doesn't. That may explain why it isn't working.<
Posted
Snitz Forums Admin
ruirib
Posts: 26364
26364
So I guess it would be a matter of adding the specific photobucket code, no?<
Posted
Junior Member
leesh695
Posts: 101
101
Originally posted by ruirib
So I guess it would be a matter of adding the specific photobucket code, no?

Yeah, ive tried doing it myself but im not to good with asp & I cant get it to work.<
Posted
Snitz Forums Admin
ruirib
Posts: 26364
26364
Well I must say that I don't know the code for this that well, but here is what I did, simply by looking at similar code and I managed to get it working. This is all I will do, if it suits you, great, if not, too bad.
1. Inside the function ChkUrls, in inc_func_common.asp, add the lines in red:

Code:

                                (UCase(Right(strArray(Counter-1), 6)) <> "[GVID]") and _
(UCase(Right(strArray(Counter-1), 10)) <> "[METACAFE]") and _
(UCase(Right(strArray(Counter-1), 5)) <> "[WMA]") and _
(UCase(Right(strArray(Counter-1), 4)) <> "[QT]") and _
(UCase(Right(strArray(Counter-1), 5)) <> "[PBT]") and _ (UCase(Right(strArray(Counter-1), 4)) <> "[RV]") and _
(UCase(Right(strArray(Counter-1), 7)) <> "FLASH]""") and _
(UCase(Right(strArray(Counter-1), 5)) <> "WMV]""") and _
(UCase(Right(strArray(Counter-1), 4)) <> "QT]""") and _
(UCase(Right(strArray(Counter-1), 5)) <> "PBT]") and _ (UCase(Right(strArray(Counter-1), 4)) <> "RV]""") and _
(UCase(Right(strArray(Counter-1), 7)) <> "[FLASH]") and _

2. At the end of the function formatStr, in inc_func_common.asp, add the red line:

Code:


fString = ReplaceWMVTags(fString) ' windows media
fString = ReplaceRVTags(fString) ' Real video
fString = ReplacePhotoBucketVideoTags(fString)

FormatStr = fString
on Error goto 0


3. Near the end of inc_func_common.asp, just before the WriteFooter sub, add this code:

Code:

Function ReplacePhotoBucketVideoTags(fString)
Dim oTag, cTag
Dim roTag, rcTag
Dim oTagPos, cTagPos
Dim nTagPos
Dim counter1, counter2
Dim strCodeText
Dim Tagcount
Dim strTempString, strResultString
TagCount = 2
Dim CodeTags(2,2,2)
Dim strArray, strArray2

CodeTags(1,1,1) = "[pbt]"
CodeTags(1,2,1) = "[/pbt]"
CodeTags(1,1,2) = "<div class=""media""><script language=""javascript"">EmbedPBV("""
CodeTags(1,2,2) = """)</script></div><div class=""break""></div>"

CodeTags(2,1,1) = "[PBT]"
CodeTags(2,2,1) = "[/PBT]"
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))
strResultString = strResultString & roTag & strCodeText & rcTag & strArray2(1)
else
strResultString = strResultString & strArray(counter2)
end if
next

strTempString = strResultString
strResultString = ""
end if
next

ReplacePhotoBucketVideoTags = strTempString
end function

4. In video.js, add this code, at the end of the file, for example:

Code:

function EmbedPBV(URL){
if(URL == null || URL == "illegal"){
//Nope, we can't. document.writeln(" error: illegal use of PhotoBucketVideo tag! ");
}else{
//Add the code to the document. document.writeln('<embed width="448" height="361" type="application/x-shockwave-flash" wmode="transparent" src="http://i301.photobucket.com/player.swf?file='+ URL +'"> </embed>');
}
}

Use the tags like this:

[pbt] http://s301.photobucket.com/albums/nn80/SinnSinn/clip0099.flv
[/pbt]
You will need to insert the complete link to the file, but without parameters.
I hope this helps, as I really don't have the time to filter out the parameters to allow you to use the complete link,as per your post.
I tested this locally and it works.<
Posted
Snitz Forums Admin
ruirib
Posts: 26364
26364
To add a button, just as the mod does for other video types, here are the changes:

1. Save this icon as icon_PBT.gif, in your forum folder:
2. Add the line in to your icon_files.asp file:

Code:

Const strIconRealVideo = "icon_RV.gif|23|22"
Const strIconPBT = "icon_PBT.gif|23|22"

3. Add this function at the end of inc_code.js
Code:

function pbt() {
var text = getText();
if (helpstat){
alert("PhotoBucket Video.\n\nUSE: [pbt]Real Video URL[/pbt]");
} else if (basic) {
AddTxt="[pbt]" + text + "[/pbt]";
AddText(AddTxt);
} else {
if (text) {
txt=prompt("PhotoBucket Video URL",text);
} else {
txt=prompt("PhotoBucket Video URL","Text");
}
if(txt!=null) {
AddTxt=" [pbt] "+txt+" [/pbt]";
AddText(AddTxt);
}
}
}
4. Add the parts in red to inc_post_buttons.asp. Don't forget the & _ at the end of the line before the last:
Code:

	"<a href=""Javascript:qtv();"" tabindex=""-1"">" & getCurrentIcon(strIconQuickTime,"Quicktime movie","align=""top""") & "</a>" & _
"<a href=""Javascript:wmv();"" tabindex=""-1"">" & getCurrentIcon(strIconWMV,"Windows Media video","align=""top""") & "</a>" & _
"<a href=""Javascript:rv();"" tabindex=""-1"">" & getCurrentIcon(strIconRealVideo,"Real Video","align=""top""") & "</a>" &_
"<a href=""Javascript:pbt();"" tabindex=""-1"">" & getCurrentIcon(strIconPBT,"PhotoBucket Video","align=""top""") & "</a>"

<
Posted
Junior Member
balexandre
Posts: 418
418
Obrigado Rui.
Thank you Rui for the quick code, I will add this to the MOD and re-publish it.
Baptize and 1st Anniversary of my daughter with a house full of persons doesn't give me time to be with "you" here in the Forum.<
Posted
Snitz Forums Admin
ruirib
Posts: 26364
26364
No problem Bruno.
This works, but I'm not too sure about the ReplaceVideoTags function and the changes to ChkUrls, I didn't really have much time to understand what it does (it would require some time to test, which I don't have), so maybe have a look at it to make sure it's not doing more than it should.
Congrats on your daughter's baptism and birthday.<
Posted
Junior Member
leesh695
Posts: 101
101
Originally posted by ruirib
No problem Bruno.
This works, but I'm not too sure about the ReplaceVideoTags function and the changes to ChkUrls, I didn't really have much time to understand what it does (it would require some time to test, which I don't have), so maybe have a look at it to make sure it's not doing more than it should.
Congrats on your daughter's baptism and birthday.

Thanks a lot for you help!smile<
You Must enter a message