Advertisement:

Author Topic: Embed smule.com BBCode  (Read 1458 times)

Offline Ghislain.Dejoie

  • Semi-Newbie
  • *
  • Posts: 18
Embed smule.com BBCode
« 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 [nofollow]

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

Could someone help me?
Thanks in advance

Offline dougiefresh

  • SMF Hero
  • ******
  • Posts: 2,134
    • XPtsp.com Community
Re: Embed smule.com BBCode
« Reply #1 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....
NOTICE:  My website is back up!

My Free Simple Machines mods on XPtsp.com and Simple Machines Customization Site!
My mods are being uploaded and are available at GitHub as well!

Offline dougiefresh

  • SMF Hero
  • ******
  • Posts: 2,134
    • XPtsp.com Community
Re: Embed smule.com BBCode
« Reply #2 on: December 29, 2016, 10:17:28 PM »
Half an hour worth of work, and DONE!!!  Embed SMule BBCode mod!
NOTICE:  My website is back up!

My Free Simple Machines mods on XPtsp.com and Simple Machines Customization Site!
My mods are being uploaded and are available at GitHub as well!

Offline Ghislain.Dejoie

  • Semi-Newbie
  • *
  • Posts: 18
Re: Embed smule.com BBCode
« Reply #3 on: December 30, 2016, 09:44:33 AM »
Hello,
Congratulations for this work


It works well* with this type of link:
Code: [Select]
[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:
Code: [Select]
[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 [nofollow]

*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 [nofollow]" scrolling="no" frameborder="0"></iframe></div></div>

Offline dougiefresh

  • SMF Hero
  • ******
  • Posts: 2,134
    • XPtsp.com Community
Re: Embed smule.com BBCode
« Reply #4 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....
NOTICE:  My website is back up!

My Free Simple Machines mods on XPtsp.com and Simple Machines Customization Site!
My mods are being uploaded and are available at GitHub as well!

Offline Ghislain.Dejoie

  • Semi-Newbie
  • *
  • Posts: 18
Re: Embed smule.com BBCode
« Reply #5 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 [nofollow]" 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 [nofollow]" 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 ?

Offline Ghislain.Dejoie

  • Semi-Newbie
  • *
  • Posts: 18
Re: Embed smule.com BBCode
« Reply #6 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/ [nofollow]' . $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

Offline dougiefresh

  • SMF Hero
  • ******
  • Posts: 2,134
    • XPtsp.com Community
Re: Embed smule.com BBCode
« Reply #7 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....
NOTICE:  My website is back up!

My Free Simple Machines mods on XPtsp.com and Simple Machines Customization Site!
My mods are being uploaded and are available at GitHub as well!

Offline Ghislain.Dejoie

  • Semi-Newbie
  • *
  • Posts: 18
Re: Embed smule.com BBCode
« Reply #8 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 !?

Offline dougiefresh

  • SMF Hero
  • ******
  • Posts: 2,134
    • XPtsp.com Community
Re: Embed smule.com BBCode
« Reply #9 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].
NOTICE:  My website is back up!

My Free Simple Machines mods on XPtsp.com and Simple Machines Customization Site!
My mods are being uploaded and are available at GitHub as well!

Offline dougiefresh

  • SMF Hero
  • ******
  • Posts: 2,134
    • XPtsp.com Community
Re: Embed smule.com BBCode
« Reply #10 on: January 07, 2017, 08:36:37 AM »
Embed SMule BBCode has been approved.  All support and bug reports should be placed in the mod's thread.  Thank you!
NOTICE:  My website is back up!

My Free Simple Machines mods on XPtsp.com and Simple Machines Customization Site!
My mods are being uploaded and are available at GitHub as well!