Simple Machines Community Forum

Customizing SMF => Modifications and Packages => Mod Requests => Topic started by: Ghislain.Dejoie on December 29, 2016, 10:40:57 AM

Title: Embed smule.com BBCode
Post by: Ghislain.Dejoie on December 29, 2016, 10:40:57 AM
Hello,
I would like to give my registered members the opportunity to post their recorded recordings from smule.com
2 codes are recoverable
That of the address bar (example):
https://www.smule.com/recording/john-lennon-woman/561965069_892666490

The one to generate (example):
<iframe src="https://www.smule.com/recording/john-lennon-woman/561965069_892666490/frame" width="100%" height="125" frameborder="0"></iframe>

Could someone help me?
Thanks in advance
Title: Re: Embed smule.com BBCode
Post by: dougiefresh on December 29, 2016, 09:56:57 PM
This one looks easy (except for the regex expressions....)  I'll just model it on one of my other embedding mods....
Title: Re: Embed smule.com BBCode
Post by: dougiefresh on December 29, 2016, 10:17:28 PM
Half an hour worth of work, and DONE!!!  Embed SMule BBCode (http://www.xptsp.com/board/index.php?topic=760.0) mod!
Title: Re: Embed smule.com BBCode
Post by: Ghislain.Dejoie on December 30, 2016, 09:44:33 AM
Hello,
Congratulations for this work
(https://www.simplemachines.org/community/proxy.php?request=http%3A%2F%2Fclub-karaoke.org%2Fimages%2Fdivers%2Fveneration.jpg&hash=54376d8b94388cf8d573c85a5febd1190941ef5c)

It works well* with this type of link:
[smule]https://www.smule.com/recording/coeur-de-pirate-mistral-gagnant-fr/884746559_759522678[/smule]

But it does not work with this type of link:
[smule]https://www.smule.com/recording/patricia-kaas-mon-mec-%C3%A0-moi/884746559_777176584[/smule]

Probably because of %

You can see an example here:
http://club-karaoke.org/index.php?board=4.0

*When it works well, it cuts much of the visual but it is possible to start the reading.
I noted this detail (with Firebug) :
<div style="max-width: 100%px; height: 120px;"><div class="smule-wrapper"><iframe src="https://smule.com/recording/coeur-de-pirate-mistral-gagnant-fr/884746559_759522678/frame" scrolling="no" frameborder="0"></iframe></div></div>
Title: Re: Embed smule.com BBCode
Post by: dougiefresh on December 30, 2016, 10:10:47 AM
Uploaded v1.0.1 - December 30th, 2016
o Fixed several capitalization issues with settings and language settings.
o Fixed issue where URLs with percent sign weren't recognized properly.
o Fixed issue with HTML result so that px wasn't appended to 100%.




@Ghislain.Dejoie: I've addressed a few issues, in addition to the ones you brought up.  Hopefully this takes care of everything....
Title: Re: Embed smule.com BBCode
Post by: Ghislain.Dejoie on December 30, 2016, 11:17:27 AM
Phew! What reactivity!
Currently, (with Firebug) I find your code like this:
<div style="max-width: 100%; height: 125px;"><div class="smule-wrapper"><iframe src="https://smule.com/recording/france-gall-evidemment/469040380_880486539/frame" scrolling="no" frameborder="0"></iframe></div></div>

If you can change it to get it, the display is full and correct
<div><div class="smule-wrapper"><iframe src="https://smule.com/recording/france-gall-evidemment/469040380_880486539/frame" scrolling="no" frameborder="0" style="width: 100%; height: 125px;"></iframe></div></div>

width: 100% without max-

Little question :
Beginning with Simple Machines, before installing the new version, I uninstall the previous version and erase it.
Then "Maintenance" and empty the cache
Is it the right manipulation ?
Title: Re: Embed smule.com BBCode
Post by: Ghislain.Dejoie on December 30, 2016, 01:17:34 PM
Good evening,
In the "Subs-BBCode-SMule.php" file, I modified the code as below and it works

$tag['content'] = '<div><div class="smule-wrapper">' .
      '<iframe src="https://smule.com/' . $data .'/frame" scrolling="no" frameborder="' . $frameborder . '" style="width: ' . (empty($width) ? '100%;' : $width . 'px;') . ' height: 125px;"></iframe></div></div>';

I tested in:
Firefox
Safari
IE 11
Edge
Chrome
And there does not seem to be any problem
Title: Re: Embed smule.com BBCode
Post by: dougiefresh on December 30, 2016, 06:00:47 PM
Sorry, I'm at work right now.  When I get home, I'll make the change that you've suggested..

Regarding upgrading the mod, yes you must uninstall firat before installing the new version.  The rest is optional, but perhaps good practice....
Title: Re: Embed smule.com BBCode
Post by: Ghislain.Dejoie on December 31, 2016, 04:03:55 AM
Bizarre, strange, curious, mysterious, fantastic, supernatural
I open a new subject, I paste the address of a smule record (without adding anything, nor the famous BBcode smule) and the recording automatically appears !?
Title: Re: Embed smule.com BBCode
Post by: dougiefresh on December 31, 2016, 08:47:49 AM
Yeah, isn't auto-embed lovely?  To get around auto-embed, just enclose the link with [nobbc].
Title: Re: Embed smule.com BBCode
Post by: dougiefresh on January 07, 2017, 08:36:37 AM
Embed SMule BBCode (http://custom.simplemachines.org/mods/index.php?mod=4135) has been approved.  All support and bug reports should be placed in the mod's thread.  Thank you!