[ABD] s9e/mediaembed - Embed videos and third-party content without a single BBCode

Any abandoned Extensions will be moved to this forum.

WARNING: Extensions in this forum are not currently being supported or maintained by the original Extension author. Proceed at your own risk.
Forum rules
IMPORTANT: Extension Development Forum rules

WARNING: Extensions in this forum are not currently being supported nor updated by the original Extension author. Proceed at your own risk.
Locked
User avatar
JoshyPHP
Code Contributor
Posts: 1200
Joined: Mon Jul 11, 2011 12:28 am

Re: [BETA] s9e/mediaembed - Embed videos and third-party content without a single BBCode

Post by JoshyPHP »

poenn wrote:Is it possible to disable some of its supported sites?
It's not possible, sorry. If you want to post a link without it being transformed you can use the URL BBCode and it shouldn't be replaced with an embedded product.
I wrote the thing that does BBCodes in 3.2+.
poenn
Registered User
Posts: 34
Joined: Thu Oct 30, 2014 8:40 am

Re: [BETA] s9e/mediaembed - Embed videos and third-party content without a single BBCode

Post by poenn »

Thanks, I could do that, but it’s next to impossible to educate all users to not just paste the link into the post like they’re used to. There were already a few occurrences with threads of confused users which were unaware that their adblockers prevented them to see the links, be it from other users or even from themselves.

I wouldn’t have a problem with editing a config file and even doing it again with every update would be ok. Would this be possible or is it completely hardcoded?
User avatar
JoshyPHP
Code Contributor
Posts: 1200
Joined: Mon Jul 11, 2011 12:28 am

Re: [BETA] s9e/mediaembed - Embed videos and third-party content without a single BBCode

Post by JoshyPHP »

Then you can edit listener.php, look around line 88 and insert the following before $xml = MediaPack::parse($m[1]);

Code: Select all

if (!isset(MediaPack::$parser))
{
    MediaPack::$parser = MediaPack::getParser();
}
MediaPack::$parser->disableTag('AMAZON'); 
I wrote the thing that does BBCodes in 3.2+.
poenn
Registered User
Posts: 34
Joined: Thu Oct 30, 2014 8:40 am

Re: [BETA] s9e/mediaembed - Embed videos and third-party content without a single BBCode

Post by poenn »

Thanks, you are great! Will do so tomorrow morning and let you know. ;)
User avatar
2600
I've Been Banned!
Posts: 2567
Joined: Fri Nov 14, 2014 5:14 pm
Location: Area-51

Re: [BETA] s9e/mediaembed - Embed videos and third-party content without a single BBCode

Post by 2600 »

In the bundle.php Amazon is listed there, but I'm not sure how to modify with breaking the code.
Morpheus: Unfortunately, no one can be told what The Matrix is. You'll have to see it for yourself.
Hack me.
Consider a canary token.
The nature of my chosen username
:ugeek:
User avatar
JoshyPHP
Code Contributor
Posts: 1200
Joined: Mon Jul 11, 2011 12:28 am

Re: [BETA] s9e/mediaembed - Embed videos and third-party content without a single BBCode

Post by JoshyPHP »

I've just uploaded an update: https://github.com/s9e/phpbb-ext-mediae ... 151024.zip

In this version, if you want to disable a site by editing the source, you'll have to replace line 88 with the following:

Code: Select all

MediaPack::getCachedParser()->disableTag('AMAZON');
$xml = MediaPack::parse($m[1]); 
With that said, this is not a method that I can support.
John connor wrote:In the bundle.php Amazon is listed there, but I'm not sure how to modify with breaking the code.
As I posted above, it's possible to edit listener.php (not bundle.php) but you should not edit any file if you're not sure.
I wrote the thing that does BBCodes in 3.2+.
poenn
Registered User
Posts: 34
Joined: Thu Oct 30, 2014 8:40 am

Re: [BETA] s9e/mediaembed - Embed videos and third-party content without a single BBCode

Post by poenn »

Thanks a lot for your support, JoshyPHP,

I tried with the updated version from github right from the start, but it does not work. Amazon URLs are still shown with images and buy buttons and therefore blocked if AdBlock is enabled.

Here’s an excerpt from listener.php, lines 84 to 94, with the changes not indented:

Code: Select all

		return preg_replace_callback(
			'(<!-- m -->.*?href="([^"]+).*?<!-- m -->)',
			function ($m)
			{
MediaPack::getCachedParser()->disableTag('AMAZON');
$xml = MediaPack::parse($m[1]); 
				return ($xml[1] === 'r')
					? '<!-- s9e:mediaembed:' . base64_encode($xml) . ' -->' . $m[0]
					: $m[0];
			},
			$text
Did I mess up somewhere? I double-checked the changes, emptied the phphBB cache and even disabled/enabled the extension, just to make sure.
User avatar
JoshyPHP
Code Contributor
Posts: 1200
Joined: Mon Jul 11, 2011 12:28 am

Re: [BETA] s9e/mediaembed - Embed videos and third-party content without a single BBCode

Post by JoshyPHP »

I should mention this does not apply retroactively. You'd have to edit/reparse old posts for that.
I wrote the thing that does BBCodes in 3.2+.
poenn
Registered User
Posts: 34
Joined: Thu Oct 30, 2014 8:40 am

Re: [BETA] s9e/mediaembed - Embed videos and third-party content without a single BBCode

Post by poenn »

Ah, thanks. Got it! I was under the impression that it was retroactive. Thanks again for your outstanding support! ;)
Difadon
Registered User
Posts: 55
Joined: Wed Nov 06, 2013 3:36 pm
Location: Špindlerův Mlýn
Name: Jan Nejedlý
Contact:

Re: [BETA] s9e/mediaembed - Embed videos and third-party content without a single BBCode

Post by Difadon »

Hello,

Maybe is greaf if you add acp control (for allow/disable websites).

You can add support for some czech webpage?

http://aukro.cz
http://stream.cz

Next page for support:
https://www.facebook.com/groups/1646523375626923/
https://www.facebook.com/Difadon
Swen
Registered User
Posts: 101
Joined: Sun Oct 04, 2015 5:44 pm

Re: [BETA] s9e/mediaembed - Embed videos and third-party content without a single BBCode

Post by Swen »

Amazing. Thanks for that. Go ahead with development!
Regards Swen
Pond Life
Registered User
Posts: 388
Joined: Sat Jan 20, 2007 1:55 am

Re: [BETA] s9e/mediaembed - Embed videos and third-party content without a single BBCode

Post by Pond Life »

JoshyPHP wrote:I've just uploaded an update: https://github.com/s9e/phpbb-ext-mediae ... 151024.zip

In this version, if you want to disable a site by editing the source, you'll have to replace line 88 with the following:

Code: Select all

MediaPack::getCachedParser()->disableTag('AMAZON');
$xml = MediaPack::parse($m[1]); 
What would the correct syntax be for disabling more than one site? For example, if I wanted to disable amazon, facebook and foxnews?
Never argue with idiots, they will drag you down to their level and beat you with experience.
User avatar
JoshyPHP
Code Contributor
Posts: 1200
Joined: Mon Jul 11, 2011 12:28 am

Re: [BETA] s9e/mediaembed - Embed videos and third-party content without a single BBCode

Post by JoshyPHP »

Difadon wrote:Maybe is greaf if you add acp control (for allow/disable websites).
That would require more work than I can provide at the moment. To be honest, unless someone wants to sponsor its development I don't think I'll ever have time to create a UI for this extension.
Difadon wrote:You can add support for some czech webpage?
Sorry, I have to focus only on the most popular sites at the moment.
Pond Life wrote:What would the correct syntax be for disabling more than one site? For example, if I wanted to disable amazon, facebook and foxnews?
Just repeat the first line for each site.

Code: Select all

MediaPack::getCachedParser()->disableTag('FACEBOOK');
MediaPack::getCachedParser()->disableTag('FOXNEWS');
 
I wrote the thing that does BBCodes in 3.2+.
Pond Life
Registered User
Posts: 388
Joined: Sat Jan 20, 2007 1:55 am

Re: [BETA] s9e/mediaembed - Embed videos and third-party content without a single BBCode

Post by Pond Life »

JoshyPHP wrote:Just repeat the first line for each site.

Code: Select all

MediaPack::getCachedParser()->disableTag('FACEBOOK');
MediaPack::getCachedParser()->disableTag('FOXNEWS');
Thank you.
Never argue with idiots, they will drag you down to their level and beat you with experience.
User avatar
Spaldo
Registered User
Posts: 53
Joined: Sun Nov 07, 2004 9:28 pm

Re: [BETA] s9e/mediaembed - Embed videos and third-party content without a single BBCode

Post by Spaldo »

Hi, I have updated from phpbb 3.0 to 3.1

In doing so, I have switched over to this new extension and it is great.

However, I was wondering if anyone has suggestions for how I can deal with all the old threads with the [video] phpbb code?

I would like these videos to be displayed with the old code, but, it isn't working at the moment with the code wrapped around the link.

Thanks
Image
Locked

Return to “Abandoned Extensions”