View Single Post
  #15  
Old 12th July 2014, 19:08
mpx mpx is offline
Senior Member
 
Join Date: Jun 2009
P2P
Posts: 39
Default
i try http and https

Click the image to open in full size.

@DND slso your code doesnt work (look screen)

Bump: I finally managed to solve the problem

Solution
Functions.php - find this:
Code:
function format_urls($text, $newWindow = false) {
	return preg_replace("/((https?|ftp|gopher|news|telnet|mms|rtsp):\/\/[^()\[\]<>\s]+)/ei",
	"formatUrl('\\1', ".($newWindow==true ? 1 : 0).", '', 'faqlink')", $text);
I changed this code in
Code:
function format_urls($s)
{
        return preg_replace(
            "/(\A|[^=\]'\"a-zA-Z0-9])((http|ftp|https|ftps|irc):\/\/[^()<>\s]+)/i",
            "\\1<a target=_blank href=\"http://anonym.to?\\2\">\\2</a>", $s);
}
And then I add this youtube BB code:
Example: [video=https://www.youtube.com/watch?v=njU1O1jCTHY]
Code:
	$s = preg_replace("/\[video=[^\s'\"<>]*youtube.com.*v=([^\s'\"<>]+)\]/ims", "<object width=\"640\" height=\"480\"><param name=\"movie\" value=\"http://www.youtube.com/v/\\1\"></param><embed src=\"http://www.youtube.com/v/\\1\" type=\"application/x-shockwave-flash\" width=\"640\" height=\"480\"></embed></object>", $s);
I hope that someone will help if they have similar problems
Reply With Quote
The Following 2 Users Say Thank You to mpx For This Useful Post:
Johnny Utah (28th January 2016), nicukent (27th January 2016)