News:

Bored?  Looking to kill some time?  Want to chat with other SMF users?  Join us in IRC chat or Discord

Main Menu

Spotify Embed BBCode

Started by iamcody, May 08, 2015, 10:23:37 AM

Previous topic - Next topic

iamcody

Link to Mod

I really haven't seen a Spotify Embed BBCode around the forum yet (I have not seen any topics), so I decided to make a small, simple, mod.

This is actually my very first mod that I've made for SMF, not entirely sure if it's bug free, If you find a bug let me know.

If anybody wants to improve on the mod, or fix general bugs, I ask that they be posted into the thread (the bug fixes) so they can be implied to the mod for later updates, instead of repeating the bugs over and over

But please note, I've made this mod with SMF 2.1 BETA. But it should work with the current non-beta version. If it doesn't, I'll make it work for the non-beta version of SMF.

I'll accept any kind of feedback, as this is my first mod, and I barely know how to make mods.

Change Log
1.1
- Sorted out a few errors when installing the mod
1.0
- Initial Release

wolf39us

I'm showing a couple of problems.

First the adjustment here


Code: (Find) [Select]

'<img>'

Code: (Replace) [Select]

'<img><object><embed><iframe>'


Failed... There was not any line containing just <img> in this file.


Second issue I came across was this mod


Code: (Find) [Select]

array(
'code' => 'horizontalrule',
'description' => $editortxt['horizontal_rule']
),

Code: (Add After) [Select]

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



On my "Subs-Editor.php" I am showing a different line

array(
'image' => 'hr',
'code' => 'hr',
'before' => '[hr]',
'description' => $txt['horizontal_rule']
),



I can make the mods myself, but I try not to manually mod on my server live.


iamcody

#2
Quote from: wolf39us on August 17, 2015, 06:27:51 PM
I'm showing a couple of problems.

First the adjustment here


Code: (Find) [Select]

'<img>'

Code: (Replace) [Select]

'<img><object><embed><iframe>'


Failed... There was not any line containing just <img> in this file.


Second issue I came across was this mod


Code: (Find) [Select]

array(
'code' => 'horizontalrule',
'description' => $editortxt['horizontal_rule']
),

Code: (Add After) [Select]

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



On my "Subs-Editor.php" I am showing a different line

array(
'image' => 'hr',
'code' => 'hr',
'before' => '[hr]',
'description' => $txt['horizontal_rule']
),



I can make the mods myself, but I try not to manually mod on my server live.

Yeah, Sorry about that haha.. I made this with the SMF BETA and I guess half of the stuff in the BETA version isn't in the latest non-beta build. I'll fix them.

Sorry for the such late reply though.

Regarding the line without <img> the downloaded SMF package non-beta has the following:

if ($smcFunc['htmltrim'](strip_tags(parse_bbc($_POST['message'], false), '<img>')) === '' && (!allowedTo('admin_forum') || strpos($_POST['message'], '[html]') === false))


and


if ($smcFunc['htmltrim'](strip_tags(parse_bbc($_POST['message'], false), '<img>')) === '')


I don't know why you're getting errors there.

Advertisement: