Simple Machines Community Forum

Customizing SMF => SMF Coding Discussion => Aiheen aloitti: otario - helmikuu 06, 2005, 10:11:58 IP

Otsikko: Aditional protocols | ed2k links
Kirjoitti: otario - helmikuu 06, 2005, 10:11:58 IP
Hello,

I've been trying to get my smf board to accept ed2k links, at least in <a href> statements, but either it doesn't link at all or it links with a http:// prefix or it links only until the first tube (|). Can someone help me with this, I've got few experience with php and am having a really difficult time with this. I get the chills just from looking at that preg_replace() on line 780...

Thanks in advance :)

PS: subs.php line 989
$message = preg_replace('~&lt;a\s+href=(?:&quot;)?(?:\[url\])?((?:http://|ftp:/\|https://|ftps://|mailto:).+?) (...)
Shouldn't it be ftp:// ?
Otsikko: Re: Aditional protocols | ed2k links
Kirjoitti: [Unknown] - helmikuu 14, 2005, 01:26:58 AP
Sorry, that's been fixed.

-[Unknown]
Otsikko: Re: Aditional protocols | ed2k links
Kirjoitti: gandyman - huhtikuu 01, 2005, 04:32:54 IP
Hello ppl

I have the same problem ????
Its impossible to make an active ed2k link.

I see the answer is ,, solved,,
but ? how what why ??
What must I do.?

and yes I have the latest version from MSF  ;D

I use it very short now but its most impressive end best looking forum program I ever seen.

thx for creating it 
Otsikko: Re: Aditional protocols | ed2k links
Kirjoitti: EkSeS - heinäkuu 10, 2005, 08:18:32 IP
Hi,

Have  try to add ed2k tags in Subs.php

(?:http|https|ftp|ftps|irc|ed2k|ed2k://|[EDK]ed2k://|file|)://


doesn't match.  ::)


Otsikko: Re: Aditional protocols | ed2k links
Kirjoitti: ufuk.exe - helmikuu 09, 2006, 09:30:47 AP
There should be a way to add them to SMF to be supported without a mod,

maybe there is a way to disable protocol check.. by removing the whole line.

So that even if someone types

telnet://127.0.0.1 (http://telnet://127.0.0.1)
it does not automatically put html in front of it...


<a href="telnet://telnet.link">Telnet Link A HREF </a>

Otsikko: Re: Aditional protocols | ed2k links
Kirjoitti: 7mSeni - helmikuu 10, 2006, 12:45:18 AP
Find (subs.php):
$data = preg_replace(array('~(?<=[\s>\.(;\'"]|^)((?:http|https|ftp|ftps)://[\w\-_%@:|]+(?:\.[\w\-_%]+)*(?::\d+)?(?:/[\w\-_\~%\.@,\?&;=#+:\'\\\\]*|[\(\{][\w\-_\~%\.@,\?&;=#(){}+:\'\\\\]*)*[/\w\-_\~%@\?;=#}\\\\])~i', '~(?<=[\s>(\'<]|^)(www(?:\.[\w\-_]+)+(?::\d+)?(?:/[\w\-_\~%\.@,\?&;=#+:\'\\\\]*|[\(\{][\w\-_\~%\.@,\?&;=#(){}+:\'\\\\]*)*[/\w\-_\~%@\?;=#}\\\\])~i'), array('[url]$1[/url]', '[url=http://$1]$1[/url]'), $data);

add: |ed2k


Otsikko: Re: Aditional protocols | ed2k links
Kirjoitti: Dannii - helmikuu 10, 2006, 01:40:28 AP
shouldn't be too hard to make a mod for a BBCode which doesn't parse the protocol. I'll think about it.
Otsikko: Re: Aditional protocols | ed2k links
Kirjoitti: ufuk.exe - helmikuu 10, 2006, 11:17:31 AP
already done,
check this topic:
http://www.simplemachines.org/community/index.php?topic=68117.new;topicseen#new