::: در حال بارگیری لطفا صبر کنید :::Loading , please wait ...

انجمن کدستانMoisrex

MoisrexMoisrex.rozblog.com
زمان جاریtime : سه شنبه 10 آذر 1405 - 3:54 بعد از ظهر
نام کاربریusername : پسوردpassword : یاor عضویتregister | رمز عبور را فراموش کردمForgot your password?
شما در سایت ما ثبت نام نکرده اید و یا وارد اکانت کاربری خود نشده اید. از شما خواهشمند هستیم You are not log in to site. Please وارد شویدlogin یاor ثبت نام کنیدregister .
heydarifard آفلاین



ارسال‌هاAsnwers : 579
عضویتRegistration date : 23 /9 /1392
حمایت کردهthanks : 241
حمایت شدهThanked : 90
پاسخAnswer 26 : ی کد php ساده می خوام

کد کاملش (همه فرمتهای تصویری ، صوتی ، ویدئویی) :

کد:
function SK_getMarkup($text, $link=true, $hashtag=true, $mention=true) { global $dbConnect; if ($link == true) { // Links $link_search = '/\[a\](.*?)\[\/a\]/i'; if (preg_match_all($link_search, $text, $matches)) { foreach ($matches[1] as $match) { $match_decode = urldecode($match); $match_url = $match_decode; if (!preg_match("/http(|s)\:\/\//", $match_decode)) { $match_url = 'http://' . $match_url; } $img_url_link = explode('.',$match_url); $end_img_url = end($img_url_link); $pasvand = array('jpg','JPG','png','PNG','gif','GIF','bmp','BMP','jpg/','JPG/','png/','PNG/','gif/','GIF/','bmp/','BMP/');$pasvand2 = array('ogg','mp3','OGG/','OGG/','MP3/','Mp3','mP3','Mp4','mP4');$pasvand3 = array('mp4','MP4','WMA','wma','Ogg','ogg','oGG','OGG','Avi','AVI','Mp4','mP4'); if(in_array($end_img_url,$pasvand)){ $text = str_replace('[a]'.$match.'[/a]', '<img src="'.strip_tags($match_url).'" alt="'.$match_decode.'" style="border-radius: 5px;border: 2px solid #ccc;" />', $text); }if(in_array($end_img_url,$pasvand2)){ $text = str_replace('[a]'.$match.'[/a]', '<center><audio autoplay="false" controls="loop" style="width: 60%!important;"> <source src="'.strip_tags($match_url).'" type="audio/ogg"> <source src="'.strip_tags($match_url).'" type="audio/mp3"> <source src="'.strip_tags($match_url).'" type="audio/mp4"> not support the '.$match_decode.' audio. </audio></center>', $text); }if(in_array($end_img_url,$pasvand3)){ $text = str_replace('[a]'.$match.'[/a]', '<center><video width="65%" height="300" autoplay="false"> <source src="'.strip_tags($match_url).'" type="video/mp4"> <source src="'.strip_tags($match_url).'" type="video/wma"> <source src="'.strip_tags($match_url).'" type="video/ogg"> <source src="'.strip_tags($match_url).'" type="video/avi"> not support the '.$match_decode.' audio. </video></center>', $text); }else{ $text = str_replace('[a]' . $match . '[/a]', '<a href="' . strip_tags($match_url) . '" target="_blank" rel="nofollow">' . $match_decode . '</a>', $text); } } } }

فقط ی سوال چکار کنم که توی HTML5 پخش اتوماتیک نباشه گذاشتم autoplay="false" ولی باز پخش اتوماتیکه :|

پنجشنبه 20 فروردین 1394 - 11:55
وب کاربرUser's blog ارسال پیامSend p.m. نقل قولReply سپاس گزارمThanks



moisrex
درباره ماAbout us لینک های ماOur links کلمات کلیدیKeywords
انجمن تخصصی کدستان ، ساخته شده توسط فردی با نام مستعار Moisrex می باشد.This forum designed by a person who called Moisrex.

ایمیلE-mail : Moisrex @ Gmail.com
کدستان,انجمن کدستان,کدنویسی,انجمن پشتیبانی,فروم,رزبلاگ,آموزش کدنویسی,درخواست کد
تمامی حقوق این انجمن مربوط به همین انجمن می باشد | طراحی قالبCopyright (c) By Moisrex , All rights reserved | Desiger : Moisrex