[Snippet] Auto Image Embed
Auto Image Embed
Show images in posts by just posting an image link

Instruction
open
posting.php
find
after add
open
viewtopic.php
find
after add
Show images in posts by just posting an image link

Instruction
open
posting.php
find
- Code: Select all
if (!sizeof($error))
{
after add
- Code: Select all
// Auto Image Embed / 4seven / 2011
$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);
}}
// Auto Image Embed / 4seven / 2011
open
viewtopic.php
find
- Code: Select all
// Parse the message and subject
$message = censor_text($row['post_text']);
after add
- Code: Select all
// Auto Image Embed / 4seven / 2011
$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);
}}
// Auto Image Embed / 4seven / 2011