Area51 @ 4seven.de

Mod Base and Testarea
It is currently 23 Feb 2025, 20:11

All times are UTC + 1 hour




Post new topic TOPIC_LOCKED  [ 1 post ] 
Author Message
PostPosted: 30 Dec 2011, 17:22 
Offline
Tiptop
Tiptop
User avatar

Joined: 11 Feb 2008, 11:49
Posts: 241
Auto Image Embed

Show images in posts by just posting an image link

Image

Instruction

open

posting.php

find

Code:
            if (!sizeof($error))
            {

after add

Code:
        // 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:
         // Parse the message and subject
        $message = censor_text($row['post_text']);

after add

Code:
             // 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     

_________________
Mod-Bot / Service-Team


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic TOPIC_LOCKED  [ 1 post ] 

All times are UTC + 1 hour


Who is online

Users browsing this forum: No registered users and 0 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB® Forum Software © phpBB Group
[ Time : 0.011s | 22 Queries | GZIP : Off ]