Simple Machines Community Forum

SMF Support => SMF 2.0.x Support => Topic started by: Dhayzon on March 19, 2017, 12:17:44 PM

Title: how to modifi url link
Post by: Dhayzon on March 19, 2017, 12:17:44 PM
how to  auto modify URL link ?

example here

http://www.simplemachines.org (http://www.simplemachines.org)
[url=http://www.simplemachines.org]http://www.simplemachines.org[/url]
to

this  is an url , click here (http://www.simplemachines.org)
[url=http://www.simplemachines.org]this  is an url , click here[/url]


array(
'tag' => 'url',
'type' => 'unparsed_equals',
'before' => '<a href="$1" class="bbc_link" target="_blank">',
'after' => '</a>',
'validate' => create_function('&$tag, &$data, $disabled', '
if (strpos($data, \'http://\') !== 0 && strpos($data, \'https://\') !== 0)
$data = \'http://\' . $data;
'),
'disallow_children' => array('email', 'ftp', 'url', 'iurl'),
'disabled_after' => ' ($1)',
),


            'before' => '<a href="$1" class="bbc_link" target="_blank">',
                                             this  is an url , click here
            'after' => '</a>',
Title: Re: how to modifi url link
Post by: Kindred on March 19, 2017, 12:39:34 PM
http://custom.simplemachines.org/mods/index.php?mod=3832
Title: Re: how to modifi url link
Post by: Dhayzon on March 19, 2017, 01:37:20 PM
it  don't work in wap or print , it use javascript, :( I'll keep looking
Title: Re: how to modifi url link
Post by: Arantor on March 19, 2017, 06:38:05 PM
It won't work in print mode, because that would be insane to never let people see the URLs they're going to when you print it out.

As for WAP mode, that's also kind of the specification - and the mod only uses JavaScript when posting, not in the forum display.
Title: Re: how to modifi url link
Post by: Dhayzon on March 20, 2017, 09:18:26 AM
is possible filter content bbcode?   [tag=url] Filter http:// or img with replace function[/tag] for example

[tag=http://url]aks blablalbalblab  http://other url[/tag] 

to

[tag=http://url]http://otherurl[/tag]   
Title: Re: how to modifi url link
Post by: Kindred on March 20, 2017, 10:27:55 AM
what??

and why??

???