Custom BBCodes [Deprecated]

Get help developing custom BBCodes or request one.
chudbert
Registered User
Posts: 1
Joined: Wed Mar 18, 2009 3:10 am

Re: Custom BBCodes

Post by chudbert »

For all those interested, I have added BBCode to my forum which incorporates a viewer for dwf files. If you’re not familiar with dwf, a dwf file is AutoDesk’s answer to the 'pdf'. Although not used commonly, it is an efficient way to exchange construction and technical drawing information.

Autodesk has two different viewers available - freewheel and dwfviewer. Freewheel is more open source and should work on most browsers and dwfviewer - I think - is based on AutoDesk's Design Review and may not work if you do not have Design Review or other autodesk software installed and it does not work with Safari.

I have the latest version of design review installed and both codes seem to work fine on my site. If you’d like to see a sample, feel free to see what I've been playing around with … here.

Hope someone finds this useful!

freewheel

BBCode Usage

Code: Select all

 [fwhl]{URL}[/fwhl] 
HTML Markup

Code: Select all

<iframe scrolling="no" width="100%" height="800"
src="http://freewheel.labs.autodesk.com/dwf.aspx?path={URL}">
</iframe>
Help Line

Code: Select all

Usage: [fwhl]{URL}[/fwhl] add a dwf viewer compatible with safari to your post - dwf file must be accessible via web link (e.g. http://www.yoursite.com/your.dwf) 

dwfviewer

BBCode Usage

Code: Select all

[dwf]{URL}[/dwf]
HTML Markup

Code: Select all

<OBJECT CLASSID="clsid:A662DA7E-CCB7-4743-B71A-D817F6D575DF" 
CODEBASE=http://www.autodesk.com/global/dwfviewer/installer/
DwfViewerSetup.cab#version=7,0,0,928 
WIDTH="100%" HEIGHT="800"> 
<PARAM NAME="Src" 
VALUE="{URL}"> 
</OBJECT>
Help Line

Code: Select all

Usage: [dwf]{URL}[/dwf] add a dwf viewer to your post - dwf file must be accessible via web link (e.g. http://www.yoursite.com/your.dwf)
Cheers!
badbrain
Registered User
Posts: 21
Joined: Mon Aug 10, 2009 2:58 am

Re: Custom BBCodes

Post by badbrain »

I have a question on a coding problem,

I am trying to get myspace video to embed

In the BBCode usage I have:

Code: Select all

[MYSPACE]{TEXT}[/MYSPACE]
And in the HTML replacement I have

Code: Select all

<a href="http://vids.myspace.com/index.cfm?fuseaction=vids.individual&VideoID={TEXT}"></a><br><embed src="http://lads.myspace.com/videos/vplayer.swf" flashvars="m=6991702&v=2&type=video" type="application/x-shockwave-flash" width="430" height="346"></embed><br>
The video I am embedding is:

http://vids.myspace.com/index.cfm?fusea ... id=6991702

With that combination, simply pasting the above video url into the BBCode brackets works fine and the video plays.

The original code I had copied for that had a different videoid in the HTML code after the "m=", so when I implemented this code that was the video that came up, not mine. So I replaced that videoid with mine (6991702) in the html code and now my video comes up fine.

My question is how do I get the code to be such that the videoid is the variable so whenever someone posts their video url between the BBCode brackets their video is the one that pops up.

I tried replacing the 6991702 with TEXT, so it looked like this:

Code: Select all

<a href="http://vids.myspace.com/index.cfm?fuseaction=vids.individual&VideoID={TEXT}"></a><br><embed src="http://lads.myspace.com/videos/vplayer.swf" flashvars="m={TEXT}&v=2&type=video" type="application/x-shockwave-flash" width="430" height="346"></embed><br>
but then the video just comes up as "ERROR".

Anyone have an idea?
User avatar
karzulovic
Registered User
Posts: 14
Joined: Thu Jul 02, 2009 8:34 pm

Re: Custom BBCodes

Post by karzulovic »

try this one mate
BBCode

Code: Select all

[MYSPACE]{TEXT}[/MYSPACE]
using this one you can put the url of the vid
BBCode

Code: Select all

[MYSPACE]http://vids.myspace.com/index.cfm?fuseaction=vids.individual&videoid={IDENTIFIER}[/MYSPACE]
HTML Replacement

Code: Select all

<a href="http://vids.myspace.com/index.cfm?fuseaction=vids.individual&videoid={TEXT}"></a><br/><object width="425px" height="360px" ><param name="allowFullScreen" value="true"/><param name="wmode" value="transparent"/><param name="movie" value="http://mediaservices.myspace.com/services/media/embed.aspx/m={TEXT},t=1,mt=video"/><embed src="http://mediaservices.myspace.com/services/media/embed.aspx/m={TEXT},t=1,mt=video" width="425" height="360" allowFullScreen="true" type="application/x-shockwave-flash" wmode="transparent"></embed></object>

at least it worked on my forum

Image
Rhawn
Registered User
Posts: 10
Joined: Thu Jul 30, 2009 4:57 pm

Re: Custom BBCodes

Post by Rhawn »

Here is my BBCODE and HTML replacement for a full URL youtube BBCODE.

Code: Select all

[youtube]http://www.youtube.com/watch?v={SIMPLETEXT}[/youtube]

<object width="640" height="360"><param name="movie" value="http://www.youtube.com/v/{SIMPLETEXT}"></param><param name="wmode" value="transparent"></param><embed src="http://www.youtube.com/v/{SIMPLETEXT}" type="application/x-shockwave-flash" wmode="transparent" width="640" height="360"></embed></object>

Works great as long as the user has a www in their URL. However, if they leave it out, then it shows a jacked up link on the post. Any way to make it tolerant of both www and w/o?
some blind fool
Registered User
Posts: 409
Joined: Sat Aug 19, 2006 5:28 pm

Re: Custom BBCodes

Post by some blind fool »

Rhawn wrote:Works great as long as the user has a www in their URL. However, if they leave it out, then it shows a jacked up link on the post. Any way to make it tolerant of both www and w/o?
iirc, you change the "www." to a token.

Code: Select all

[youtube]http://{SIMPLETEXT1}youtube.com/watch?v={SIMPLETEXT2}[/youtube]

<object width="640" height="360"><param name="movie" value="http://{SIMPLETEXT1}youtube.com/v/{SIMPLETEXT2}"></param><param name="wmode" value="transparent"></param><embed src="http://{SIMPLETEXT1}youtube.com/v/{SIMPLETEXT2}" type="application/x-shockwave-flash" wmode="transparent" width="640" height="360"></embed></object>
it seems like yahoo comes up something like every third week, so if this doesn't work, try searching the thread or the forum for more codes.
please do not PM me to ask for help. thanks.
Rhawn
Registered User
Posts: 10
Joined: Thu Jul 30, 2009 4:57 pm

Re: Custom BBCodes

Post by Rhawn »

That was an excellent idea, but I seem to get the same result. I flushed the cache after the bbcode code change, anything else I should purge or flush?
untitled.JPG
untitled.JPG (24.24 KiB) Viewed 2233 times
some blind fool
Registered User
Posts: 409
Joined: Sat Aug 19, 2006 5:28 pm

Re: Custom BBCodes

Post by some blind fool »

post what you're using for your bbcode between code tage?

try "search"ing? there's this, from page 113: http://www.phpbb.com/community/viewtopi ... 5#p8025905

using the forum search, i note someone had a problem with youtube while using the 'prime links' mod. if you have it, find the mod's release/support topic, and check pages 10 & 11.
please do not PM me to ask for help. thanks.
Rhawn
Registered User
Posts: 10
Joined: Thu Jul 30, 2009 4:57 pm

Re: Custom BBCodes

Post by Rhawn »

some blind fool wrote:post what you're using for your bbcode between code tage?

try "search"ing? there's this, from page 113: http://www.phpbb.com/community/viewtopi ... 5#p8025905

using the forum search, i note someone had a problem with youtube while using the 'prime links' mod. if you have it, find the mod's release/support topic, and check pages 10 & 11.
The code from your first link worked like a charm dude, thanks. Here is my updated code, the only thing I changed are the dimensions, to allow for widescreen videos. I'm looking for a Vimeo version of the same code. /search on

Code: Select all

[youtube]{TEXT}[/youtube]

<script type="text/javascript">
    function ytubeGo() {
    var ytubeVal = "{TEXT}";
      if(ytubeVal.match("watch")) { //http://www.youtube.com/watch?v=xxxxxxxxxx
        var ytubeId = ytubeVal.indexOf("v=");
        ytubeId = ytubeId+2;
        ytubeId = ytubeVal.slice(ytubeId);
        var doMain = ytubeVal.indexOf("watch");
        doMain = ytubeVal.slice(0,doMain);
        document.write("<object width=\"580\" height=\"344\"><param name=\"movie\" value=\""+doMain+"v/"+ytubeId+"&hl=en&fs=1\"></param><param name=\"allowFullScreen\" value=\"true\"></param><param name=\"allowscriptaccess\" value=\"always\"></param><embed src=\""+doMain+"v/"+ytubeId+"&hl=en&fs=1\" type=\"application/x-shockwave-flash\" allowscriptaccess=\"always\" allowfullscreen=\"true\" width=\"580\" height=\"344\"></embed></object>");
      }
      else if (ytubeVal.match("v/")) { //http://www.youtube.com/v/xxxxxxxxxx
        var ytubeId = ytubeVal.indexOf("v/");
        ytubeId = ytubeId+2;
        ytubeId = ytubeVal.slice(ytubeId);
        var doMain = ytubeVal.indexOf("v/");
        doMain = ytubeVal.slice(0,doMain);
        document.write("<object width=\"580\" height=\"344\"><param name=\"movie\" value=\""+doMain+"v/"+ytubeId+"&hl=en&fs=1\"></param><param name=\"allowFullScreen\" value=\"true\"></param><param name=\"allowscriptaccess\" value=\"always\"></param><embed src=\""+doMain+"v/"+ytubeId+"&hl=en&fs=1\" type=\"application/x-shockwave-flash\" allowscriptaccess=\"always\" allowfullscreen=\"true\" width=\"580\" height=\"344\"></embed></object>");
      }
      else { //just the id xxxxxxxxx
        ytubeId = ytubeVal;
        document.write("<object width=\"580\" height=\"344\"><param name=\"movie\" value=\"http://www.youtube.com/v/"+ytubeId+"&hl=en&fs=1\"></param><param name=\"allowFullScreen\" value=\"true\"></param><param name=\"allowscriptaccess\" value=\"always\"></param><embed src=\"http://www.youtube.com/v/"+ytubeId+"&hl=en&fs=1\" type=\"application/x-shockwave-flash\" allowscriptaccess=\"always\" allowfullscreen=\"true\" width=\"580\" height=\"344\"></embed></object>");
      }
    }
    ytubeGo();
    </script>
User avatar
Hippie459MN
Registered User
Posts: 948
Joined: Mon Oct 15, 2007 10:13 pm
Location: Minnesota, USA
Contact:

Re: Custom BBCodes

Post by Hippie459MN »

Rhawn wrote:I'm looking for a Vimeo version of the same code.
All ya had to do is look back one page. :roll: http://www.phpbb.com/community/viewtopi ... #p10441585
Rhawn
Registered User
Posts: 10
Joined: Thu Jul 30, 2009 4:57 pm

Re: Custom BBCodes

Post by Rhawn »

Hippie459MN wrote:
Rhawn wrote:I'm looking for a Vimeo version of the same code.
All ya had to do is look back one page. :roll: http://www.phpbb.com/community/viewtopi ... #p10441585
Not exactly. The type of code I am talking about handles urls, with our without www or the video ID. Much like the recycled code I posted for youtube. Thanks though. ;)
escapeNM
Registered User
Posts: 1
Joined: Mon Aug 10, 2009 5:51 pm

Re: Custom BBCodes

Post by escapeNM »

Sorry, repost. Didn't see the previous message.
Dem0n_Hunter
Registered User
Posts: 103
Joined: Wed Aug 05, 2009 9:12 am

Re: Custom BBCodes

Post by Dem0n_Hunter »

I have a question:
How do i create drop downs? for example like the font selection. is it suppose to be done by inside the .php files? thx
neocro
Registered User
Posts: 82
Joined: Tue Apr 03, 2007 1:35 pm

Re: Custom BBCodes

Post by neocro »

Hello i have question about bbcodes
im having world of warcraft guild forum and we watch alot movies from http://www.warcraftmovies.com
they have alot movies whit direct stream
so what i wanted to do is put them on my forum but im not expirienced with bbcode
can any1 make 1 for me :D
here is example of movie
http://www.warcraftmovies.com/movieview.php?id=53953
User avatar
Acorn
Registered User
Posts: 398
Joined: Tue Sep 26, 2006 8:11 am
Location: UK
Contact:

Re: Custom BBCodes

Post by Acorn »

I have a bbcode which makes text wrap around an attached image, which is particularly important for my user blogs. It works on my 3.0.3 site, but has stopped working on a site that I have upgraded to 3.0.5 (although I can't see why there would be any difference.

This is the code:

Code: Select all

[attachmentwrap={TEXT1}]{TEXT2}[/attachmentwrap]

<div style="float:{TEXT1};margin: 2px 2px 2px 2px;"><img src="{TEXT2}</div>

[attachmentwrap=left|right]attachment[/attachment] - put attachment inline, then wrap with these tags and put right or left after =
It's really brilliant when it works - no details of the attachment, just the image with the text.

Does anyone have any idea why it might not be working now?
Getting braver all the time. :D
User avatar
leviatan21
Registered User
Posts: 2663
Joined: Fri Aug 10, 2007 7:22 am
Location: Buenos Aires, Argentina
Name: Gabriel

Re: Custom BBCodes

Post by leviatan21 »

Acorn wrote:Does anyone have any idea why it might not be working now?
The image tag is wrong, try this :

Code: Select all

<div style="float:{TEXT1}; margin: 2px;"><img src="{TEXT2}" alt="{L_IMAGE}" /></div>
BTW, the help line should be :

Code: Select all

 [attachmentwrap=left|right]image link[/attachmentwrap]
Excuse me for my poor English, I speak Spanish. | Image phpBB en Español
Locked

Return to “Custom BBCode Development and Requests”