![]() |
Png link auto embed(convert)
How can I automatically convert a picture when I add a link?
For example http://travian-reports.net/tr/img/154441a5f4e.png I do not want it to appear as a link. I find auto youtube embed(https://vborg.vbsupport.ru/showthread.php?t=261296) but ı dont find image link convert. |
Create a plugin hooked at "postbit_display_start" with the code:
PHP Code:
|
Mark to include more, png, gif, jpeg, etc ?
Thanks in advanced :) |
Quote:
Thanks in advanced |
Quote:
|
Quote:
|
Quote:
Plugins & Products -> Plugin Manager -> You must remember the title to see it, maybe at top. Read and i thing you will understand which is.. * If you press on the title you will see the code :) |
Quote:
--------------- Added [DATE]1487010990[/DATE] at [TIME]1487010990[/TIME] --------------- https://vborg.vbsupport.ru/external/2017/02/7.png --------------- Added [DATE]1487011022[/DATE] at [TIME]1487011022[/TIME] --------------- https://vborg.vbsupport.ru/external/2017/02/8.png --------------- Added [DATE]1487011282[/DATE] at [TIME]1487011282[/TIME] --------------- ok ı see. sory true? $content = preg_replace('/\[URL\](http.*?\.png)\[\/URL\]/i', 'https://vborg.vbsupport.ru/', $post['pagetext']); $content = preg_replace('/\[URL\](http.*?\.jpg)\[\/URL\]/i', 'https://vborg.vbsupport.ru/', $post['pagetext']); if ($content != $post['pagetext']) { global $vbulletin; $pagetext = $content; require_once(DIR . '/includes/class_bbcode.php'); $bbcode_parser = new vB_BbCodeParser($vbulletin, fetch_tag_list()); $post['pagetext_html'] = $bbcode_parser->parse($pagetext, $post['forumid'], 1); $post['pagetext_html'] = html_entity_decode($post['pagetext_html']); } |
This looks interesting ..
So, for clarity, if I create a plugin titled with some name and hooked at "postbit_display_start" with the code: Quote:
Regards, Doug |
What you would want for the first line is:
PHP Code:
|
Quote:
You are always so gracious and helpful on this site... :up: Regards, Doug |
Quote:
Code:
$content = preg_replace('/\[URL\](http.*?\.(png|jpg|gif))\[\/URL\]/i', 'https://vborg.vbsupport.ru/', $post['pagetext']); Thank you very much |
Quote:
|
Ok, I have "Cached Posts Lifespan" to zero (0)
so i will use the first line. Thanks Mark. |
Quote:
PHP Code:
|
Yes, Yes :)
--------------- Added [DATE]1487278112[/DATE] at [TIME]1487278112[/TIME] --------------- I forgot to ask, I want to recognize when link images turn to img, is there a way to put in code some title that I would like and to show at the bottom of the image? or attribute to see when hover image :D |
Ok, for my clarity and so I don't screw it up ... :)
Is this the code I need to use to create the plugin discussed? Quote:
Regards, Doug |
Quote:
PHP Code:
|
Quote:
Regards, Doug |
All times are GMT. The time now is 07:13 PM. |
Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
![]() |
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|