|
#11
|
|||
|
|||
That's what you are checking, https or http.
Bump: Lets backup a bit, my initial response was mostly correct, with one exception. You do not check the $_SERVER['REQUEST_SCHEME'] of the image, that is for the request. Here is a simple example, I have not tested it, but should work. You would add this after all images have been processed in format_comment(). Code:
if (empty($_SERVER['REQUEST_SCHEME']) || $_SERVER['REQUEST_SCHEME'] === 'https') { preg_match_all('/<img.*?src=["|\']http:.*?["|\'].*?>/s', $s, $matches); foreach ($matches[0] as $match) { preg_match('/<img(.*?)src=["|\'](http:.*?)["|\'](.*?)>/s', $match, $links); $dummy_image = " <a href='{$links[2]}'> <img{$links[1]}alt='Dummy Image' src='dummy.image.png'{$links[3]}> </a>"; $s = str_replace($match, $dummy_image, $s); } } Last edited by darkalchemy; 20th December 2018 at 17:59. |
#12
|
|||
|
|||
Thx m8. Its working but now i need to figure out how to make it work for avatars and to load the image when a user clicks on the replaced image. I have the href working but it wont load in the current window/description body of the torrent description.
|
#13
|
|||
|
|||
you'll need javascript for that, to load and replace the image
|
#14
|
|||
|
|||
Yeah ive been reading up on it but im hopeless with javascript atm lol, just need to read up more on it and i should be able to work it out. The avatars though aren't looking as simple as the avatars use a variable with a query.
PHP Code:
By adding https://images.weserv.nl/?url=ssl: to the start of the url and stripping the http:// the embeded link becomes https://images.weserv.nl/?url=ssl:images2.imagebam.com/2f/9d/32/b55ec21038500004.png but I'm struggling to get it working in globalstar.. This.. PHP Code:
PHP Code:
Any help would be great and much appreciated. Bump: [QUOTE=Tedmorris;53047]Yeah ive been reading up on it but im hopeless with javascript atm lol, just need to read up more on it and i should be able to work it out. The avatars though aren't looking as simple as the avatars use a variable with a query. PHP Code:
|
Tags |
content , external , images , mixed |
|
|