Page 1 of 2 12 LastLast
Results 1 to 10 of 14

Thread: Some BB code that you may or may not find useful

  1. #1
    Banned
    Join Date
    Feb 2012
    Location
    England
    Posts
    6,123

    Some BB code that you may or may not find useful

    This is for Invision Power Board, but it should easily translate over to vBulletin with a few tweaks. This code parses links so people don't need to manually use BB code at all.

    YouTube: -

    Media replacement match: -

    Code:
    http://(www.)?youtube.com/watch\?v=([\d\w-_]+?)(&\S+?)?
    Code: -

    Code:
    <object style="height: 390px; width: 640px"><param name="movie" value="http://youtube.com/v/$2?version=3" /><param name="allowFullScreen" value="true" /><param name="allowScriptAccess" value="always" /><embed src="http://youtube.com/v/$2?version=3" type="application/x-shockwave-flash" allowfullscreen="true" allowScriptAccess="always" width="640" height="360"></embed></object>
    YouTu.be (for when people use the "Share" links): -

    Media replacement match: -

    Code:
    http://(www.)?youtu.be/([\d\w-_]+?)$
    Code: -

    Code:
    <object width="640" height="390"><param name="movie" value="http://youtube.com/v/$2"></param><param name="wmode" value="transparent"></param><param name="flashvars" value="fs=1&autoplay=0&playerMode=embedded"></param><embed src="http://youtube.com/v/$2" type="application/x-shockwave-flash" wmode="transparent" width="640" height="390"></embed></object>
    Mixcloud: -

    Media replacement match: -

    Code:
    http://www.mixcloud.com/{1}/{2}/
    Code: -

    Code:
    <div> <object width="300" height="300"> 
    <param name="movie" value="http://www.mixcloud.com/media/swf/player/mixcloudLoader.swf"></param>
    <param name="allowFullScreen" value="true"></param> <param name="allowscriptaccess" value="always"></param> 
    <param name="flashVars" value="feed=http://www.mixcloud.com/$1/$2/?for_player=1"></param> 
    <embed src="http://www.mixcloud.com/media/swf/player/mixcloudLoader.swf" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" flashvars="feed=http://www.mixcloud.com/$1/$2/?for_player=1" width="300" height="300"></embed></object> 
    <div style="clear:both; height:3px;"></div> <p style="display:block; font-size:12px; font-family:Helvetica, Arial, sans-serif; margin:0; padding: 3px 4px 3px 4px; color:#999;"> 
    <a href="http://www.mixcloud.com/$1/$2/?utm_source=widget&amp;utm_medium=web&amp;utm_campaign=base_links&amp;utm_term=cloudcast_link" style="color:#02a0c7; font-weight:bold;">Click here</a> to see it on Mixcloud</p> 
    <div style="clear:both; height:3px;"></div> </div>
    SoundCloud: -

    Media replacement match: -

    Code:
    http://soundcloud.com/{1}/{2}
    Code: -

    Code:
    <object height="81" width="100%">  <param name="movie" value="http://player.soundcloud.com/player.swf?url=http%3A%2F%2Fsoundcloud.com%2F$1%2F$2"></param>  <param name="allowscriptaccess" value="always"></param>  <embed allowscriptaccess="always" height="81" src="http://player.soundcloud.com/player.swf?url=http%3A%2F%2Fsoundcloud.com%2F$1%2F$2" type="application/x-shockwave-flash" width="100%"></embed> </object> <span><a href="http://soundcloud.com/$1/$2">Listen on SoundCloud.com</a></span>

  2. #2
    you're speaking geek.

    I need to learn geek. Insteresting sounding language.
    Fighting for Stripe's love.
    [Echoik] 5:05 pm: Stripe loves me too.
    [sol] 5:05 pm: he loves me more, lol
    [Echoik] 5:09 pm: Eh. I don't think DJ loves you more
    [Echoik] 5:09 pm: And I have 2 reasons
    [Echoik] 5:09 pm: They're called boobs. ...
    [Kevin James] 5:09 pm: lol @ clueless echo ...

  3. #3
    Banned
    Join Date
    Feb 2012
    Location
    England
    Posts
    6,123
    Haha, well I noticed that members still need to manually type code to embed something here. If you can somehow implement the above, then just posting a YouTube, SoundCloud or Mixcloud link will automatically turn it into an embedded player, with a link underneath to the file.

  4. #4
    I am the flu swine's Avatar
    Join Date
    Feb 2012
    Location
    Under the sea
    Posts
    368
    Cool, so the whole point is that you make a script and set the variables to 1 & 2 (for soundcloud for instance) and then have the script put the 1 & 2 parts into the code where indicated?

    Just learning how to speak geek

  5. #5
    Banned
    Join Date
    Feb 2012
    Location
    England
    Posts
    6,123
    Yeah, well that's how it works in the forum software I use. You can set how the software parses certain links, so in this case, when it detects links from particular sites it'll automatically embed them with a player of a certain type and size, and it also includes a link underneath the embedded player. For regular forum users, it means you can just copy and paste a SoundCloud/Mixcloud/YouTube link into a post instead of having to manually type out BB code.

  6. #6
    I am the flu swine's Avatar
    Join Date
    Feb 2012
    Location
    Under the sea
    Posts
    368
    Interesting, first I've heard of this. So from a quick google search, I as a regular forum user could install something like pbpBB and set that to parse those links?

  7. #7
    Banned
    Join Date
    Feb 2012
    Location
    England
    Posts
    6,123
    Yeah man, you should be able to do this in any of the more popular forum software options.

    I like Invision Power Board cos it allows you to install plug-ins, kinda like extensions for a web browser. If one doesn't work or you don't like it, you can just bin it, but amongst other things it allows you to easily install the code required to automatically parse links for popular file hosting sites. You can also import code via XML.

  8. #8
    I am the flu swine's Avatar
    Join Date
    Feb 2012
    Location
    Under the sea
    Posts
    368
    Thanks for explaining that, Ill check it out.

  9. #9
    Banned
    Join Date
    Feb 2012
    Location
    England
    Posts
    6,123
    No probs.

    I would highly recommend Invision Power Board BTW. I don't know how it compares in terms of pricing compared to the others, but in terms of features/functionality it's the best I've used.

  10. #10
    I am the flu swine's Avatar
    Join Date
    Feb 2012
    Location
    Under the sea
    Posts
    368
    Yeah Im searching through them now and trying to really understand whats going on. Ill probably check out the phpbb or something of the sort first since its free then I can understand what Id want to pay for

    edit: listening to your dnb mix from 2004. pretty yummy. im following you on soundcloud now as "WillCool"

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
a