BBcode photobucket

New BBCodes, tips and tricks, hacks and MODs for the BBCode system

BBcode photobucket

Postby Micael » 21 Jan 2008, 09:08

Hello people,

I tried to use the bbcode photobucket, using it:

Code: Select all
BBCode usage
[photobucket]{TEXT}[/photobucket]

HTML replacement
<embed width="448" height="361" type="application/x-shockwave-flash" wmode="transparent" src="http://i64.photobucket.com/player.swf?file=http://s64.photobucket.com/albums/"></embed>



However, the video doesn't start, is in the 00:00 (not load the video), someone knows how to operate?

Thanks! :good:
Micael    
Translator
Translator
 
Posts: 53
Joined: 17 Jan 2008, 18:45
Favorite Team: SPFC
Gender: Male


Re: BBcode photobucket

Postby CoC » 21 Jan 2008, 12:32

You have no {TEXT} to replace there.

Code: Select all
[photobucket]{TEXT}[/photobucket]


Code: Select all
<embed width="430" height="389" type="application/x-shockwave-flash" wmode="transparent" src="http://photobucket.com/flash/player.swf?file={TEXT}"></embed>


Then you would to use the photobucket url
Code: Select all
http://s0006.photobucket.com/albums/0006/pbhomepage/video1/?action=view&current=unbelieveable_goals.flv


Although you would need to remove this part of the url, ?action=view&current=.

So the link you would post,
Code: Select all
[photobucket]http://s0006.photobucket.com/albums/0006/pbhomepage/video1/unbelieveable_goals.flv[/photobucket]


Code: Select all
[photobucket]http://s189.photobucket.com/albums/z140/wolverhamptonboy/Soccer.flv[/photobucket]
User avatar
CoC    
MOD Author
MOD Author
 
Posts: 490
Joined: 23 Jan 2007, 11:09
Location: Coventry
Favorite Team: Coventry City
Gender: Male
phpBB Knowledge: 8

Re: BBcode photobucket

Postby Micael » 21 Jan 2008, 12:45

Thanks!

Excellent!!

Bye :good:
Micael    
Translator
Translator
 
Posts: 53
Joined: 17 Jan 2008, 18:45
Favorite Team: SPFC
Gender: Male

Re: BBcode photobucket

Postby ScrapbookSupplies » 29 Apr 2008, 21:10

How about just plain Photo Bucket photos (still snap shots)?
ScrapbookSupplies    
Cadet III
Cadet III
 
Posts: 39
Joined: 29 Apr 2008, 20:24
Favorite Team: not a clue. :o)
Gender: Female
phpBB Knowledge: 4

Re: BBcode photobucket

Postby Krupski » 26 Mar 2010, 20:40

Hi all,

First thank you all for allowing me to join here :good:

This is in reply to the post about the PhotoBucket BBCode where it's stated:

Although you would need to remove this part of the url, ?action=view&current=


I came up with a little embedded Javascript BBCode that automatically strips out that string and allows simply pasting the entire "Direct Link" code from Photobucket in between the Photobucket BBCode.

The code does the following:
* puts the URL string into a variable named "str"
* makes the string all lowercase to avoid search mismatch grief
* REPLACES the offending "?action=view&current=" string with "" (i.e. gets rid of it)
* Uses several "document.write" Javascript calls to generate the proper HTML code - with the fixed Photobucket filename


Here's the info:

BBCode Usage:
Code: Select all
[PhotoBucket]{URL}[/PhotoBucket]



HTML Replacement:
Code: Select all
<script type="text/javascript">
var str = "{URL}";
str = str.toLowerCase();
str = str.replace("?action=view&amp;current=", "");
document.write('<embed width="448" height="361" type="application/x-shockwave-flash" quality="high" wmode="transparent" src="http://photobucket.com/flash/player.swf?file=');
document.write(str);
document.write('"></embed>');
</script>



Help Line:
Code: Select all
Embed PhotoBucket movie: [PhotoBucket]Direct Link Code[/PhotoBucket]



Hope this is of some help to you all!

--Roger
User avatar
Krupski    
Lieutenant
Lieutenant
 
Posts: 287
Joined: 26 Mar 2010, 20:25
Location: PHPBB 3.0.10 with full WYSIWYG Editor. Try it with UN: "tester" and PW: "tester"
Gender: Male
phpBB Knowledge: 5

Re: BBcode photobucket

Postby Sniper_E » 26 Mar 2010, 22:44

@ Krupski - Your codes gave errors.

CoC's codes worked perfect. :yahoo: We have a winner!
Image
No is NEVER an Option and NEVER is the only Option when it comes to Giving Up!
User avatar
Sniper_E    
STG Jedi Master
STG Jedi Master
 
Posts: 6991
Joined: 31 May 2006, 06:29
Location: Shreveport, LA
Favorite Team: The STG Team
Gender: Male
phpBB Knowledge: 6

Re: BBcode photobucket

Postby Krupski » 27 Mar 2010, 13:33

Sniper_E wrote:@ Krupski - Your codes gave errors.

CoC's codes worked perfect. :yahoo: We have a winner!


I think you may have gotten errors because the file 'root/includes/acp/acp_bbcodes.php' has an error in it and because I should have used "{TEXT}" instead of "{URL}".

Here's the ORIGINAL part (from version 3.07-PL1) (approximately at line 411):
Code: Select all
         'TEXT' => array(
            '!(.*?)!es'    =>   "str_replace(array(\"\\r\\n\", '\\\"', '\\'', '(', ')'), array(\"\\n\", '\"', '&#39;', '&#40;', '&#41;'), trim('\$1'))"
         ),



The escaped quotes and backslashes are done wrong. Also, the single quote character is handled wrong.


This is how I changed the part above to fix it:
Code: Select all
         'TEXT' => array(
            '!(.*?)!es'    =>   "str_replace(array('\\r\\n', '\"', '\'', '(', ')'), array('\\n', '&#34;', '&#39;', '&#40;', '&#41;'), trim('\$1'))"
         ),



I have also totally re-done my Video BBCode so that it can handle Youtube or Photobucket by using the large "Embed" strings they provide. The BBCode supports lines that typically look like this:

From YouTube (called "EMBED"):
Code: Select all
<object width="640" height="505"><param name="movie" value="http://www.youtube.com/v/2dHG8jf3Mew&hl=en_US&fs=1&"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/v/2dHG8jf3Mew&hl=en_US&fs=1&" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="640" height="505"></embed></object>



From PhotoBucket (called "HTML Code"):
Code: Select all
<embed width="600" height="361" type="application/x-shockwave-flash" allowFullscreen="true" allowNetworking="all" wmode="transparent" src="http://static.photobucket.com/player.swf?file=http://vid0006.photobucket.com/albums/0006/pbhomepage/mommynolove.flv&amp;sr=1">



Here's the BBCode to support both formats shown above:


BBCode Usage:
Code: Select all
[Video]{TEXT}[/Video]


HTML Replacement:
Code: Select all
<script type="text/javascript" />
<!--hide from old browsers
var n=0;
var str='{TEXT}';
var src=[/<br \/>/g, /&lt;/g, /&gt;/g, /&amp;/g, /&quot;/g, /&#34;/g, /&#39;/g, /&#40;/g, /&#41;/g];
var dst=["\n", "<", ">", "&", "\"", "\"", "\'", "(", ")"];
for(n=0; n<src.length; n++) { str=str.replace(src[n], dst[n]); }
if((str.toLowerCase(str).search('application/x-shockwave-flash') | str.toLowerCase(str).search('<embed')) < 0)
{ alert('Error: You may only use the <embed> version of video code!'); } else { document.write(str); }
//-->
</script />


Help line:
Code: Select all
Embed YouTube or Photobucket: [Video]<embed> code[/Video]


Note: The "document.write() call COULD be a security risk by allowing a user to embed other HTML code which is why the script explicitly checks for "application/x-shockwave-flash" and "<embed" in the string and fails if they are not found.

Whether or not a clever person could write malicious code AND embed a dummy "application/x-shockwave-flash" and "<embed" string in it to trick the script I do not know... that's up to smarter people than me to decide. :grin:

Anyway, take a look into the ''root/includes/acp/acp_bbcodes.php' file and see if you agree that the original is wrong and if my fix is right. I had problems with single quotes transforming into "\\'" and messing up contractions, as well as the presence of single quotes simply causing video uploads to fail (I think because the PHP code saw the inline single quote as a mistaken string terminator). ???

Hopefully this helps someone.

(edit to add): The canned line 'Error: You may only use the <embed> version of video code!' in the script above COULD be replaced with '{L_ERR_EMBED_ONLY}' IF the following line is ADDED to '/root/language/your_language/common.php':

Find:
Code: Select all
        'ERR_CONNECTING_SERVER'

Add on a new line AFTER:
Code: Select all
        'ERR_EMBED_ONLY'                        => 'Error: You may only use the <embed> version of video code!',


Obviously the error message string would be in the language desired.
(end of edit)

-- Roger
User avatar
Krupski    
Lieutenant
Lieutenant
 
Posts: 287
Joined: 26 Mar 2010, 20:25
Location: PHPBB 3.0.10 with full WYSIWYG Editor. Try it with UN: "tester" and PW: "tester"
Gender: Male
phpBB Knowledge: 5

Re: BBcode photobucket

Postby modnoob » 21 Apr 2011, 11:44

Is there a way to insert a thumbnail gallery instead of a single image?
User avatar
modnoob    
Crewman
Crewman
 
Posts: 6
Joined: 20 Apr 2011, 14:57
Gender: Male
phpBB Knowledge: 4

Re: BBcode photobucket

Postby Zeittriven » 19 Oct 2011, 11:45

modnoob wrote:Is there a way to insert a thumbnail gallery instead of a single image?

Please, can anyone explain it? I need to do the same thing but lack php knowledge...
Zeittriven    
Crewman
Crewman
 
Posts: 9
Joined: 17 Oct 2011, 08:10
Gender: Male
phpBB Knowledge: 1


Return to BBCode System

Who is online

Users browsing this forum: No registered users and 5 guests