Auto Image EmbedShow images in posts by just posting an image link
Instructionopenposting.php
findCode:
if (!sizeof($error))
{
after addCode:
$matches = array();
preg_match_all("#http://(.*?)\.(?:jpe?g|png|gif)#i" , $preview_message , $matches);
foreach ($matches[0] as $img_matches){
if(!empty($img_matches)){
$preview_message = preg_replace('#<a class="postlink(.*?)" href="' . $img_matches . '"(.*?)</a>#i',
'<img src="' . $img_matches . '" alt="" />',
$preview_message);
}}
openviewtopic.php
findCode:
$message = censor_text($row['post_text']);
after addCode:
$matches = array();
preg_match_all("#http://(.*?)\.(?:jpe?g|png|gif)#i" , $message , $matches);
foreach ($matches[0] as $img_matches){
if(!empty($img_matches)){
$message = preg_replace('#<a class="postlink(.*?)" href="' . $img_matches . '"(.*?)</a>#i',
'<img src="' . $img_matches . '" alt="" />',
$message);
}}