Customizing SMF > Tips and Tricks

Auto-show image links as pictures without using [img] tag in messages

<< < (2/5) > >>

~DS~:

--- Quote from: DoctorMalboro on July 11, 2010, 02:27:46 PM ---
--- Quote from: Duncan85 on July 11, 2010, 12:45:12 PM ---
--- Quote from: DoctorMalboro on July 11, 2010, 12:13:41 PM ---Isn't that a mod? ::)
--- End quote ---
Is it ? ^^
--- End quote ---
Isn't this the same function that AeMe has? or i'm just crazy? :P

--- End quote ---
I don't think AeMe embed images in a post...

~DS~:

--- Quote from: Delita Heiral on July 11, 2010, 02:44:22 PM ---
--- Quote from: DoctorMalboro on July 11, 2010, 02:27:46 PM ---
--- Quote from: Duncan85 on July 11, 2010, 12:45:12 PM ---
--- Quote from: DoctorMalboro on July 11, 2010, 12:13:41 PM ---Isn't that a mod? ::)
--- End quote ---
Is it ? ^^
--- End quote ---
Isn't this the same function that AeMe has? or i'm just crazy? :P

--- End quote ---
I don't think AeMe embed images in a post...

--- End quote ---
Nope it doesn't...

Duncan85 is there a way to disable (not to show) it?

--- Code: ---[noembed][/noembed]
--- End code ---
won't do


Kermit:
You mean not to show the images ? Then just not change the codes like i gave above  O:)

or maybe you want to make it like ,when there is an image link in message,it should be shown as like

Image

If yes,you can do this


--- Code: --- if (substr($message, 0, 1) == ' ')
$message = '&nbsp;' . substr($message, 1);

if (strpos($message, '<a href') !== false )
{
    //show up images without inserting them between [img] tags ;)
$message = preg_replace('~<a href="(.*?)(\.(?i)(jpg|jpeg|gif|png|bmp))"(.*?)>(.*?)(\.(?i)(jpg|jpeg|gif|png|bmp))</a>~i', '<a href="$1$2">Image</a> ', $message);
}
--- End code ---

~DS~:
Let's say it auto show the images, great, but what if some user rather not show but a normal link if they so decide?

Kermit:

--- Quote from: Delita Heiral on July 13, 2010, 10:53:01 AM ---Let's say it auto show the images, great, but what if some user rather not show but a normal link if they so decide?

--- End quote ---

It's a thing which would demand kinda long work,as this is just a little trick,i would rather not do it here,if you want ,you can create a topic in mod request board

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version