Simple Machines Community Forum

Customizing SMF => SMF Coding Discussion => Topic started by: patrikmuse on March 23, 2006, 04:24:18 AM

Title: anonym.to
Post by: patrikmuse on March 23, 2006, 04:24:18 AM
is possible to add the anonym.to in SMF 1.1 RC2?? (sorry for my bad english  :( )

8)
Title: Re: anonym.to
Post by: Kindred on March 23, 2006, 08:02:20 AM
do you mean make all [ url] links use anonymn.to/?link ??

if so... then yes, add the code into the url tag processing function in subs.php
Title: Re: anonym.to
Post by: patrikmuse on March 23, 2006, 10:47:03 AM
can you explain me precisely (im new with php :D )
Title: Re: anonym.to
Post by: Kindred on March 23, 2006, 11:01:29 AM
find

$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);



I'm not so hot on pregreplace myself... but that's the line that you're going to modify (or add another pregreplace after)
Title: Re: anonym.to
Post by: patrikmuse on April 20, 2006, 03:10:13 AM
Any news?  :-[ :-[ :-[
Title: Re: anonym.to
Post by: Sheepy on April 20, 2006, 05:03:27 AM
Read this.
http://www.php.net/manual/en/reference.pcre.pattern.syntax.php

Read the line given by Kindred.

Then do it yourself.  This is a good chance for you to practice on regular expression, something you'll find useful in you future PHP experience.