Bravo List

Bravo List (http://www.bvlist.com/index.php)
-   Community Cafe (http://www.bvlist.com/forumdisplay.php?f=18)
-   -   nexusphp 1.5 beta (http://www.bvlist.com/showthread.php?t=7805)

mpx 11th July 2014 18:37

Quote:

Originally Posted by xrol (Post 34377)
Can anyone help me add [youtube=link] tag?
And why the imdb mode dosent work on any version?

i try this youtube codes:

PHP Code:

 $s preg_replace("/\[video=[^\s'\"<>]*youtube.com.*v=([^\s'\"<>]+)\]/ims""<object         width=\"500\"         height=\"410\"><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=\"425\"         height=\"355\"></embed></object>"$s);
 
$s preg_replace("/\[youtube\]http:\/\/www\.youtube\.com\/watch\?v=((\s|.)+?)\[\/youtube\]/i""<object width=\"480\" height=\"300\"><param name=\"movie\" value=\"http://www.youtube.com/v/\\1&hl=en&fs=1\"></param> <param name=\"allowFullScreen\" value=\"true\"></param><param name= \"allowscriptaccess\" value=\"always\"></param><embed src=\"http://www.youtube.com/v/\\1&hl=en&fs=1\" type=\"application/x-shockwave-flash\" allowscriptaccess=\"always\" allowfullscreen=\"true\" width=\"480\" height=\"300\"></embed></object>"$s);

 
$s preg_replace("/\[youtube\]http:\/\/www\.youtube\.com\/watch\?v=((\s|.)+?)\[\/youtube\]/i""<iframe width=\"640\" height=\"360\" src=\"//www.youtube.com/embed/\\1?rel=0\" frameborder=\"0\" allowfullscreen></iframe>"$s); 

but none of them doesnt work

firefly007 11th July 2014 20:16

Code:

$s = preg_replace("/\[video=\bhttps?:\/\/www\.youtube\.com\/watch\?v=([\w\d]+?)\]/i","", $s);
Usage

[video=https://www.youtube.com/watch?v=IfR_DOb1TLI]

mpx 12th July 2014 17:58

Quote:

Originally Posted by firefly007 (Post 44789)
Code:

$s = preg_replace("/\[video=\bhttps?:\/\/www\.youtube\.com\/watch\?v=([\w\d]+?)\]/i","", $s);
Usage

[video=https://www.youtube.com/watch?v=IfR_DOb1TLI]

Hi,

doesnt work

http://shrani.si/f/38/7a/rgpDloJ/untitled.png

DND 12th July 2014 18:16

did u tried to use http instead of https for youtube?

or use this

Code:

            $s = preg_replace("/\[video=[^\s'\"<>]*youtube.com.*v=([^\s'\"<>]+)\]/ims", "", $s);

mpx 12th July 2014 19:08

i try http and https

http://shrani.si/f/3C/Kl/4mJiVhYp/untitled.png

@DND slso your code doesnt work (look screen)

Bump: I finally managed to solve the problem :gum:

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\\2", $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", "", $s);
I hope that someone will help if they have similar problems :sun:

batuo76 29th March 2019 12:16

Please help!
I want to ask why when I try to log in nexusphp, give me that error: Error Errno 0 SQL.
This is on my localhost.


All times are GMT +2. The time now is 06:34.

Powered by vBulletin® Version 3.8.11 Beta 3
Copyright ©2000 - 2024, vBulletin Solutions Inc.