Simple Machines Community Forum

SMF Support => SMF 2.0.x Support => Topic started by: Jeet Chowdhury on February 10, 2011, 07:21:44 AM

Title: rtsp link
Post by: Jeet Chowdhury on February 10, 2011, 07:21:44 AM
if i posting rtsp://192.168.1.1/abc.sdp link it becoming http://rtsp://192.168.1.1/abc.sdp anyway to fix it?
Title: Re: rtsp link
Post by: Illori on February 10, 2011, 07:33:29 AM
are you using url tags or just posting the link without?
Title: Re: rtsp link
Post by: Jeet Chowdhury on February 10, 2011, 07:37:14 AM
i'm using url tag want to show them as clickable link like this,

[url=rtsp://x.x.x.x:554/video.sdp]HIGH QUALITY[/url]
Title: Re: rtsp link
Post by: Illori on February 10, 2011, 07:42:49 AM
the url tag as far as i know will always add http to the link as it expects a working html website.
Title: Re: rtsp link
Post by: Jeet Chowdhury on February 10, 2011, 07:47:52 AM
what can i do for rtsp links...
Title: Re: rtsp link
Post by: Illori on February 10, 2011, 07:50:50 AM
you will need some type of mod or to edit the code manually to add a new tag to support that url.
Title: Re: rtsp link
Post by: Jeet Chowdhury on February 10, 2011, 07:58:42 AM
i have edited subs.php to,

// Only do this if the preg survives.
                        if (is_string($result = preg_replace(array(
                            '~(?<=[\s>\.(;\'"]|^)((?:http|https:rtsp)://[\w\-_%@:|]+(?:\.[\w\-_%]+)*(?::\d+)?(?:/[\w\-_\~%\.@,\?&;=#(){}+:\'\\\\]*)*[/\w\-_\~%@\?;=#}\\\\])~i',
                            '~(?<=[\s>\.(;\'"]|^)((?:ftp|ftps)://[\w\-_%@:|]+(?:\.[\w\-_%]+)*(?::\d+)?(?:/[\w\-_\~%\.@,\?&;=#(){}+:\'\\\\]*)*[/\w\-_\~%@\?;=#}\\\\])~i',
                            '~(?<=[\s>(\'<]|^)(www(?:\.[\w\-_]+)+(?::\d+)?(?:/[\w\-_\~%\.@,\?&;=#(){}+:\'\\\\]*)*[/\w\-_\~%@\?;=#}\\\\])~i'


and subs-post.php to

// [url]http://...[/url]
        array(
            'tag' => 'url',
            'protocols' => array('http', 'https', 'rtsp'),
            'embeddedUrl' => true,
            'hasEqualSign' => false,
        ),
        // [url=http://...]name[/url]
        array(
            'tag' => 'url',
            'protocols' => array('http', 'https', 'rtsp'),
            'embeddedUrl' => true,
            'hasEqualSign' => true,
        ),



but not working.
Title: Re: rtsp link
Post by: Jeet Chowdhury on February 10, 2011, 08:35:01 AM
ok can anyone help me to create a redirector.php file. support if i give a link though this file like this,

redirect.php?rtsp://blabla.com/abc.sdp

then in the page there will be a link where if someone click he will goto that rtsp link.


i made one

<?php
$url 
$_REQUEST['url'];
header("Location: {$url}");
exit();
?>



but i want to put this code in a link when people click the link this will open.
Title: Re: rtsp link
Post by: Jokerâ„¢ on March 04, 2011, 09:49:11 AM
Try these edits (make backup of files before editing them)

Go to

Sources\Subs-Post.php

Find:
// [url]http://...[/url]
array(
'tag' => 'url',
'protocols' => array('http', 'https'),
'embeddedUrl' => true,
'hasEqualSign' => false,
),
// [url=http://...]name[/url]
array(
'tag' => 'url',
'protocols' => array('http', 'https'),
'embeddedUrl' => true,
'hasEqualSign' => true,
),
// [iurl]http://...[/iurl]
array(
'tag' => 'iurl',
'protocols' => array('http', 'https'),
'embeddedUrl' => true,
'hasEqualSign' => false,
),
// [iurl=http://...]name[/iurl]
array(
'tag' => 'iurl',
'protocols' => array('http', 'https'),
'embeddedUrl' => true,
'hasEqualSign' => true,
),


Replace it with:
// [url]http://...[/url]
array(
'tag' => 'url',
'protocols' => array('http', 'https', 'rtsp'),
'embeddedUrl' => true,
'hasEqualSign' => false,
),
// [url=http://...]name[/url]
array(
'tag' => 'url',
'protocols' => array('http', 'https', 'rtsp'),
'embeddedUrl' => true,
'hasEqualSign' => true,
),
// [iurl]http://...[/iurl]
array(
'tag' => 'iurl',
'protocols' => array('http', 'https', 'rtsp'),
'embeddedUrl' => true,
'hasEqualSign' => false,
),
// [iurl=http://...]name[/iurl]
array(
'tag' => 'iurl',
'protocols' => array('http', 'https', 'rtsp'),
'embeddedUrl' => true,
'hasEqualSign' => true,
),



Sources\Post.php

Find:
if (is_string($result = preg_replace(array(
'~(?<=[\s>\.(;\'"]|^)((?:http|https)://[\w\-_%@:|]+(?:\.[\w\-_%]+)*(?::\d+)?(?:/[\w\-_\~%\.@,\?&;=#(){}+:\'\\\\]*)*[/\w\-_\~%@\?;=#}\\\\])~i',
'~(?<=[\s>\.(;\'"]|^)((?:ftp|ftps)://[\w\-_%@:|]+(?:\.[\w\-_%]+)*(?::\d+)?(?:/[\w\-_\~%\.@,\?&;=#(){}+:\'\\\\]*)*[/\w\-_\~%@\?;=#}\\\\])~i',
'~(?<=[\s>(\'<]|^)(www(?:\.[\w\-_]+)+(?::\d+)?(?:/[\w\-_\~%\.@,\?&;=#(){}+:\'\\\\]*)*[/\w\-_\~%@\?;=#}\\\\])~i'
),


Replace it with:
// Only do this if the preg survives.
if (is_string($result = preg_replace(array(
'~(?<=[\s>\.(;\'"]|^)((?:http|https|rtsp)://[\w\-_%@:|]+(?:\.[\w\-_%]+)*(?::\d+)?(?:/[\w\-_\~%\.@,\?&;=#(){}+:\'\\\\]*)*[/\w\-_\~%@\?;=#}\\\\])~i',
'~(?<=[\s>\.(;\'"]|^)((?:ftp|ftps)://[\w\-_%@:|]+(?:\.[\w\-_%]+)*(?::\d+)?(?:/[\w\-_\~%\.@,\?&;=#(){}+:\'\\\\]*)*[/\w\-_\~%@\?;=#}\\\\])~i',
'~(?<=[\s>(\'<]|^)(www(?:\.[\w\-_]+)+(?::\d+)?(?:/[\w\-_\~%\.@,\?&;=#(){}+:\'\\\\]*)*[/\w\-_\~%@\?;=#}\\\\])~i'
),