Auto embed image phpbb

Întrebări / Probleme / Moduri / Tutoriale
Post Reply
User avatar
tataieee
Administrator
Posts: 3848
Joined: 17 Sep 2014, 17:52
Nume Real: Alexandru Costin
Nivel cunoştinţe IT: 10
Location: Giurgiu; România
Contact:

20 Feb 2015, 08:44

Acest snippet afiseaza imaginile fara a deschide tag-ul [ img ].
Autor: 4-Seven Image Deschide: viewtopic.php
Cauta:

Code: Select all

// Parse the message and subject
$message = censor_text($row['post_text']);
Adauga dupa:

Code: Select all

   // Auto Image Embed / 4seven / 2011
   $matches = array();
   preg_match_all("#http://[a-z0-9\-\.\/]+\.(?: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
*Email: w.tataieee@gmail.com
*PayPal: w.tataieee@yahoo.com
Post Reply

Return to “phpBB 3.1.x”