s9e Media Sites

s9e Media Sites 2.15.6

No permission to download
Media Sites requires php8 now but XF2.1 does not work with php8, so can I find out the last non php8 version of Media Sites? Thanks!
 
Identified a small bug - when the view url contains smiley shortcodes, it inserts the smileys into the URL:
1693207503502.webp
 
Identified a small bug - when the view url contains smiley shortcodes, it inserts the smileys into the URL:
That's a bit of a hard one to prevent (especially if the shortcode is entirely made of alphanumericals) because I'd have to URL-encode so much of the URL that it would look suspicious. What I'd recommend is to wrap the URL to force it to be rendered as plain text like so: [plain]{$url}[/plain]
 
I'm considering it. The issue is that the add-on currently uses the same string as the similar XenForo option autoEmbedMedia.linkBbCode which doesn't use [plain] by default. I'm copying its value so that it looks familiar and if people customized the XenForo option it carries over to the add-on's.

Another possibility would be to dynamically insert the [plain] BBCode either when updating the option's value, or when the URL is displayed.
 
This is something that has to do with the Add a link when a custom [URL] BBCode is displayed as embedded media option? So we change [i][size=2][url={$url}]View: {$url}[/url][/size][/i] to [i][size=2][url={$url}]View: [plain]{$url}[/plain][/url][/size][/i]?
 
  • Like
Reactions: Xon
Yes, there are various ways to do that. Two of them are listed in the FAQ, via CSS in your extra.less template or via an option for full-width embeds. Here's a couple of examples of possible CSS, which you can tweak to your convenience:
Code:
[data-s9e-mediaembed="youtube"] { width: 1280px !important; }
[data-s9e-mediaembed]:not([style]) { width: 1280px !important; }
The first one changes only YouTube embeds, the other changes all embeds that use the default dimensions, 640 × 360. If you're trying to achieve something else but you're unsure about the CSS, you can ask here.

Thirdly, you can also theoretically edit the template of each embed but that's generally not needed, and generally not a good idea.
 
Yes, there are various ways to do that. Two of them are listed in the FAQ, via CSS in your extra.less template or via an option for full-width embeds. Here's a couple of examples of possible CSS, which you can tweak to your convenience:
Code:
[data-s9e-mediaembed="youtube"] { width: 1280px !important; }
[data-s9e-mediaembed]:not([style]) { width: 1280px !important; }
The first one changes only YouTube embeds, the other changes all embeds that use the default dimensions, 640 × 360. If you're trying to achieve something else but you're unsure about the CSS, you can ask here.

Thirdly, you can also theoretically edit the template of each embed but that's generally not needed, and generally not a good idea.

Thanks so much! I really appreciate it! I just pasted your code, tweaked to a width of 900px, and everything looks perfect! Thanks for giving me the tips on how to customize further if I need to! You rock!
 
Last edited:
PHP:
Error: Call to undefined function s9e\MediaSites\curl_exec() src/addons/s9e/MediaSites/Parser.php:600
So this addon requires the PHP curl_exec function in order to grab Giphy contents?
 
It does use curl_exec() for anything that requires scraping, unless you edit your config file and configure it to use Guzzle instead with this change:
PHP:
$config['http']['s9e.client'] = 'guzzle';

I thought ext/curl was a requirement for installing XenForo, isn't it?
 
I thought ext/curl was a requirement for installing XenForo, isn't it?
I got this:
PHP:
disable_functions = show_source,system,shell_exec,passthru,phpinfo,allow_url_fopen,curl_exec,curl_multi_exec

And XenForo® 2 system requirements test result
1693664388578.webp
 
Yeah, I checked XenForo's installer and it does test whether ext/curl is enabled but it doesn't test whether individual functions are, that's why it doesn't notice the lack of curl_exec(). Switching to Guzzle will make it fail with an exception rather than a PHP error. Exceptions thrown during scraping are caught and discarded by the add-on. (they're logged if the board is in debug mode)
 
  • Like
Reactions: rdn
I don't remember off the top of my head whether the files could work on PHP 7.4. The main reason for the bump is that PHP 7.4 has been removed from my Linux distribution and I wouldn't be able to test whether the add-on works on it.
 
JoshyPHP updated s9e Media Sites with a new update entry:

Added web scraping selector

An option has been added to select how scraping is performed; It has four options: auto (default), native cURL calls, XenForo's client (Guzzle), or disabled. The default value is fine for the overwhelming majority of users so you don't have to care about it unless you use a special configuration for your network, in which case you should select the default XenForo client. Disabling scraping may prevent some content from being embedded.

The current default is to use native cURL calls because...

Read the rest of this update entry...
 
Top Bottom