News:

Wondering if this will always be free?  See why free is better.

Main Menu

[soundcloud] BBcode tags :)

Started by Sentinel [AF], January 29, 2010, 04:39:10 AM

Previous topic - Next topic

Sentinel [AF]

This is for SMF 2.X

I shall include code for latest version of smf 1 when I remember what I did.

Below is code to install both single track embeds & soundcloud trackset/playlist bbc code and icons.
Also included in the attachment is the bbc icons. (upload the images folder inside to each of your themes folders)

After you've done modifying the files and uploaded the newly edited ones & the bbc icons go to admin > maintenance & clear cache.

For working examples, the bbc codes and other info: LINK

examples:

[cloudset]http://soundcloud.com/artist/sets/setname[/cloudset] - adds a soundcloud set

[cloudset]http://soundcloud.com/afmeplease/sets/none-label-stuff-my-own-cheesy-whatsits[/cloudset]

Code (Subs.php - Find) Select

array(
'tag' => 'img',
'type' => 'unparsed_content',
'parameters' => array(
'alt' => array('optional' => true),
'width' => array('optional' => true, 'value' => ' width="$1"', 'match' => '(\d+)'),
'height' => array('optional' => true, 'value' => ' height="$1"', 'match' => '(\d+)'),
),


Code (Subs.php - Add Before) Select

array(
'tag' => 'soundcloud',
'type' => 'unparsed_content',
'content' => '<object height="81" width="100%"> <param name="movie" value="http://player.soundcloud.com/player.swf?url=$1&amp;show_comments=true&amp;auto_play=false"></param> <param name="allowscriptaccess" value="always"></param> <embed allowscriptaccess="always" height="81" src="http://player.soundcloud.com/player.swf?url=$1&amp;show_comments=true&amp;auto_play=false" type="application/x-shockwave-flash" width="100%"></embed> </object> <span><br/><br/></span>',
'block_level' => true,
),
array(
'tag' => 'cloudset',
'type' => 'unparsed_content',
'content' => '<object height="225" width="100%"> <param name="movie" value="http://player.soundcloud.com/player.swf?url=$1&"></param> <param name="allowscriptaccess" value="always"></param> <embed allowscriptaccess="always" height="225" src="http://player.soundcloud.com/player.swf?url=$1&" type="application/x-shockwave-flash" width="100%"></embed> </object>  <span><br/><br/></span> ',
'block_level' => true,
),


Code (Subs-Editor.php - Find) Select

array(
'image' => 'img',
'code' => 'img',
'before' => '[img]',
'after' => '[/img]',
'description' => $txt['image']
),


Code (Subs-Editor.php - Add Before) Select

array(
'image' => 'soundcloud',
'code' => 'soundcloud',
'before' => '[soundcloud]',
'after' => '[/soundcloud]',
'description' => $txt['soundcloud']
),
array(
'image' => 'cloudset',
'code' => 'cloudset',
'before' => '[cloudset]',
'after' => '[/cloudset]',
'description' => $txt['cloudset']
),


Code (Modifications.english.php - Find) Select

?>


Code (Modifications.english.php - Replace with) Select

$txt['soundcloud'] = 'Soundcloud (embeds single track)';
$txt['cloudset'] = 'Soundcloud (embeds a track set)';

?>



Sentinel [AF]

#1
This code is for SMF 1.

It does same as above code.

Code (Subs.php - Find) Select

array(
'tag' => 'white',
'before' => '<span style="color: white;">',
'after' => '</span>',
),


Code (Subs.php - Add Underneath) Select

array(
'tag' => 'soundcloud',
'type' => 'unparsed_content',
'content' => '<object height="81" width="100%"> <param name="movie" value="http://player.soundcloud.com/player.swf?url=$1&amp;show_comments=true&amp;auto_play=false"></param> <param name="allowscriptaccess" value="always"></param> <embed allowscriptaccess="always" height="81" src="http://player.soundcloud.com/player.swf?url=$1&amp;show_comments=true&amp;auto_play=false" type="application/x-shockwave-flash" width="100%"></embed> </object> <span><br/><br/></span>',
'block_level' => true,
),
         array(
            'tag' => 'cloudset',
            'type' => 'unparsed_content',
            'content' => '<object height="225" width="100%"> <param name="movie" value="http://player.soundcloud.com/player.swf?url=$1&"></param> <param name="allowscriptaccess" value="always"></param> <embed allowscriptaccess="always" height="225" src="http://player.soundcloud.com/player.swf?url=$1&" type="application/x-shockwave-flash" width="100%"></embed> </object>  <span><br/><br/></span> ',
            'block_level' => true,
         ),


Code (default > Post.template.php - Find) Select

'img' => array('code' => 'img', 'before' => '[img]', 'after' => '[/img]', 'description' => $txt[435]),


Code (default > Post.template.php - Add Above) Select

'soundcloud' => array('code' => 'soundcloud', 'before' => '[soundcloud]', 'after' => '[/soundcloud]', 'description' => $txt['soundcloud']),
'cloudset' => array('code' => 'cloudset', 'before' => '[cloudset]', 'after' => '[/cloudset]', 'description' => $txt['cloudset']),


Code (Modifications.english.php - Find) Select

?>


Code (Modifications.english.php - Replace With) Select

$txt['soundcloud'] = 'Soundcloud (embeds single track)';
$txt['cloudset'] = 'Soundcloud (embeds a track set)';

?>


BBC icons are included in images.rar in post above.
I can't see any other files that I edited for this but the icons should show up providing you upload them to each themes (images > bbc) folder.

Let us know if they don't.

Phil Serna

www.misc-content.com
Helping you get through your work day.

Sentinel [AF]

I honestly don't know.

look on here how to add bbc tags to SMF 1.x ...

then just use my code :)

And errr sorry about lack of reply to your PM - I've just upgraded to W7 after fresh install and I didn't remember the username I used to sign up here.

And it's about time they approved this - only took about 1 month - haha ;)

Sentinel [AF]


Phil Serna

Sh*t I have no idea what I am looking at... no worries on the PM.
www.misc-content.com
Helping you get through your work day.

Sentinel [AF]

haha check pm I have no clue either yet not used SMF 1.X in what 2 years or so.

Smartflight


Sentinel [AF]


Smartflight

Oops..didn't update it! Damn
Working now.

Sentinel [AF]


Matthew K.

I have contacted you with the possibility of turning this into a mod and helping to further develop it.

Labradoodle-360

Sentinel [AF]


Sentinel [AF]

updated code made them much simpler & easier to use :)

check first & second post for the codes for single track & track sets.

Sentinel [AF]

updated for latest version of smf check first post !

will add code for smf 1 to second post soon.

Sentinel [AF]

updated added code for latest version of SMF 1 to second post !!!

maxklr

How about making it a MOD that installs like the ones on the modification section of this site? I really don't want to mess with the code!

Sentinel[AF]

one of the mod coders on here was supposed to be turning it into a mod.

but I can't access my account as I seem to have forgotten the bloody password which is daft considering I use variations of same pass usually - haha.

So I've no idea what's happening with the mod or any other bits of code I've wrote.

NanoSector

I'm gonna pack it into a mod (2.0 code, may do 1.X code later).
My Mods / Mod Builder - A tool to easily create mods / Blog
"I've heard from a reliable source that the Answer is 42. But, still no word on what the question is."

NanoSector

2.0 mod

Fixed an error while I was at it.
My Mods / Mod Builder - A tool to easily create mods / Blog
"I've heard from a reliable source that the Answer is 42. But, still no word on what the question is."

Advertisement: