Soundcloud BBcode

Started by Blipsqueak, February 09, 2012, 12:54:14 PM

Previous topic - Next topic

Blipsqueak

Link to Mod

This is a BBC mod which adds Soundcloud song and cloudset posting abilities.

Usage:
[soundcloud]<song url>[/soundcloud]
[cloudset]<set url>[/cloudset]


Change Log:
1.7 - Switched from Flash to HTML5
1.6 - Support for 2.x
1.5 - Bugs fixed for release.
1.4 - Added support for posting only a soundcloud or soundset with no text avoiding blank message error.
1.3 - XHTML Compliant
1.2 - Fixed installation - previously required a youtube bbc mod.

This modification is licensed under a CC BY

musicus

I need this addon for SMF 2.0.2



lhz

It would be nice to have this mod on 2.0.2.

Thanks.

Blipsqueak

If I find some time I'll make it compatible with 2.x.  I'm not promising that it will be very soon but I'll post here with status updates.

Inti31

#4
Hey, this is not a big deal - it runs fine in 2.0.2

have a look: http://inti31.cwsurf.de/_smf1/index.php?topic=2.0

if you want to try it:
username: Test
password: 12345678


<file name="$sourcedir/Subs.php">
<operation>
<search position="after"><![CDATA[
array(
'tag' => 'white',
'before' => '<span style="color: white;" class="bbc_color">',
'after' => '</span>',
),
]]></search>
<add><![CDATA[
array(
'tag' => 'soundcloud',
'type' => 'unparsed_content',
'content' => '<!--[if !IE]> -->
  <object type="application/x-shockwave-flash" data="http://player.soundcloud.com/player.swf?url=$1&amp;show_comments=true&amp;auto_play=false" width="100%" height="81">
<!-- <![endif]-->
<!--[if IE]>
  <object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0" width="100%" height="81">
<param name="movie" value="http://player.soundcloud.com/player.swf?url=$1&amp;show_comments=true&amp;auto_play=false" />
<!--><!-- http://Validifier.com -->
  </object>
<!-- <![endif]-->',
'block_level' => true,
),
array(
'tag' => 'cloudset',
        'type' => 'unparsed_content',
        'content' => '<!--[if !IE]> -->
  <object type="application/x-shockwave-flash" data="http://player.soundcloud.com/player.swf?url=$1&amp;" width="100%" height="225">
<!-- <![endif]-->
<!--[if IE]>
  <object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0" width="100%" height="225">
<param name="movie" value="http://player.soundcloud.com/player.swf?url=$1&amp;" />
<!--><!-- http://Validifier.com -->
  </object>
<!-- <![endif]-->',
        'block_level' => true,
        ),
]]></add>

</file>
<file name="$sourcedir/Subs-Editor.php">
<operation>
<search position="after"><![CDATA[
array(
'image' => 'img',
'code' => 'img',
'before' => '[img]',
'after' => '[/img]',
'description' => $txt['image']
),
]]></search>
<add><![CDATA[
array(
'image' => 'soundcloud',
'code' => 'soundcloud',
'before' => '[soundcloud]',
'after' => '[/soundcloud]',
'description' => $txt['soundcloud']
),
array(
'image' => 'cloudset',
'code' => 'cloudset',
'before' => '[cloudset]',
'after' => '[/cloudset]',
'description' => $txt['cloudset']
),
]]></add>
</operation>
</file>
<file name="$themedir/languages/Modifications.english.php">
               <operation>
                       <search position="end" />
                       <add><![CDATA[
$txt['soundcloud'] = 'Soundcloud (Single track einfügen)';
$txt['cloudset'] = 'Soundcloud (Trackset einfügen)';
]]></add>
               </operation>
       </file>

<file name="$themedir/languages/Modifications.german-utf8.php" error="skip">
               <operation>
                       <search position="end" />
                       <add><![CDATA[
$txt['soundcloud'] = 'Soundcloud (Single Track einf&uuml;gen)';
$txt['cloudset'] = 'Soundcloud (Trackset einf&uuml;gen)';
]]></add>
               </operation>
       </file>


thanx for that and also thx that i could play a little bit...

cheers inti31
my forum
my testforum


my mods - which I only made them work for 2.0 Gold:
Topics Filter v3.2 SMF 2.0 Gold
MemberNumber

loplo

Inti31 can you be more specific? What do we have to do with the code you provided.

Inti31

#6
Hi!

Have you ever extracted/looked into a mod you downloaded?

You've to extract this mod - use 7zip for extracting.
now you see some files - now open install.xml with eg notepad++.

the attached code is all what is necessary.
When done, open package-info.xml and modify the <install> and <uninstall> and add 2.0.2 version to it...
<install for="2.0 - 2.99">

then simple zip all files again, copy the new zip over into ./packages and try installing it by using the packet manager...

else you could do all manually - I wrote everything into the code  what is to do

quick explanation how to read an install.xml (it could have also other names), it has just be the correct name in package-info.xml, which is the "setup.exe" to say it in other words  :P - it is not difficult...

in short: look for syntax in a file and add before/after another syntax- or replace the syntax.

scheme:

example:
<file name="$sourcedir/file.php">
<operation>
<search position="before/after/replace"><![CDATA[abc]]></search>
<add><![CDATA[def]]></add>
</operation>
</file>

this example looks in file.php for syntax: abc
if the position is after, file php looks after that:

def
abc


is it before:

abc
def


replace:

def

simple, I know - that it how you should read it
only thing to know: You to specify <search> EXACT
if you look for "abc"  in the file.php, but abc has a space or a tab in front of ("<space>abc" or "<tab>abc") - you will get an error, also if you look for abc and file.php contains ABC - you will get an error.

if you don't want the german-modification

just remove this block

<file name="$themedir/languages/Modifications.german-utf8.php" error="skip">
               <operation>
                       <search position="end" />
                       <add><![CDATA[
$txt['soundcloud'] = 'Soundcloud (Single Track einf&uuml;gen)';
$txt['cloudset'] = 'Soundcloud (Trackset einf&uuml;gen)';
]]></add>
               </operation>
       </file>


this example will just add the 2 $txt-strings to the end of Modifications.german.php

So it is just 3 files which you have modify
Subs.php / Subs-Editor.php / Modifications.english.php - okay, and the icons you've to copy

maybe it helps you
my forum
my testforum


my mods - which I only made them work for 2.0 Gold:
Topics Filter v3.2 SMF 2.0 Gold
MemberNumber

loplo

Thanks for your explanation.
I'll give it a shot later today.

loplo

It's working.
I had to edit manually Subs.php, because I have aveva too and there was a conflict.

Inti31

glad that my little introduction was helpful for you and that it is now working - it was not so difficult, was it?
my forum
my testforum


my mods - which I only made them work for 2.0 Gold:
Topics Filter v3.2 SMF 2.0 Gold
MemberNumber

loplo

Not at all, I just had to understand the way it works.
"Danke" again.

MESWEB

This is the my version 2.0 is working on SMF 2.0.2
installed and working fine
check my site to proof

yoump3.pl

Blipsqueak

I've added support for 2.0 to the package.  Single package works with 1.x and 2.x.

http://custom.simplemachines.org/mods/index.php?mod=3247

MESWEB

Is there any chance to embedding local or other links with this player?

Blipsqueak

Doubtful.  This is simply for music on the soundcloud site.  There are plenty of media plugins that can play mp3s and the like.

LOVELORD

Mod not work.. Show that truck is unaviable.. But track is online and i can listen them

Blipsqueak

What song?  Post the link here.

Leemy

Hi Greg, thanks for the mod. Two things

1. Although the song url itself works on soundcloud, I tried two different soundcloud links but neither works, I get a "This track is not currently available" instead , see http://bhangrateamsforum.com/discuss/bhangra-mixes-and-music/***cornell-bhangra-wbbc-2013-mix***/msg215658/#msg215658

2. Any change this could be auto-embedded, similar to youtube on AEVA? That is, when a soundcloud link is posted, it automatically creates the bbcode? I guess that's a completely different approach.

Blipsqueak

1) Hmm,

I can not recreate the problem. It looks like you tried to embed the following song. It is working for me just fine. Do you have the latest version of the plugin?  I know we fixed a regular expression issue at one point.

Song:
[soundcloud]https://soundcloud.com/cornellbhangra/cornell-bhangra-wbbc-2013[/soundcloud]

Set:
[cloudset]https://soundcloud.com/cornellbhangra[/cloudset]


Could you post the actual BB Code from your post?

2) I will look into auto embedding. I agree that would be cool. If I can figure that out I will just add a toggle setting somewhere to enable that.

Leemy

Correct. I just figured it out: I copied the hyperlink in the the WYSIWYG editor, so while the text looked identical, it's actually a full hyperlink, with <a> tags and all I guess. Once I removed formatting, to only be plain text, it works. Is the mod able to trim down to that, potentially?

Advertisement: