english 
Thread Options  Search this Thread  
Post: #1
17-12-2006 18:13 PM
x0r


Joined: 23-11-2006
Posts: 97
Country: Isla de Muerte
Male x0r is Offline now
Better [url] format function?
Hi xam! Do you think you could post the code to make links with http://www.somesite.com goto http://anonym.to/?http://www.somesite.com/ and links with http://www.mysite.com/page.php goto http://www.mysite.com/page.php?

Would be great!

Post: #2
17-12-2006 19:13 PM
FAB
Ex Verified Customer


Joined: 11-12-2006
Posts: 228
Country: Germany
Male FAB is Offline now
Better [url] format function?
Hi xam! Do you think you could post the code to make links with http://www.somesite.com goto http://anonym.to/?http://www.somesite.com/

this would be nice

Post: #3
17-12-2006 19:19 PM
x0r


Joined: 23-11-2006
Posts: 97
Country: Isla de Muerte
Male x0r is Offline now
Better [url] format function?
Nvm, fixed it.

Post: #4
17-12-2006 19:49 PM
xam
Team Leader


Joined: 01-02-2006
Posts: 11,515
Country: Belgium
Awards:  
Male xam is Offline now
Better [url] format function?
Open
globalfunctions.php

find
CODE:
$anonymurl = $BASEURL . "/redirector.php?url=" . $encoded_url;


replace with
CODE:
$anonymurl = "http://anonym.to/?" . $encoded_url;


Post: #5
18-12-2006 01:42 AM
x0r


Joined: 23-11-2006
Posts: 97
Country: Isla de Muerte
Male x0r is Offline now
Better [url] format function?
There is no $anonymurl in 1.3.9.

Post: #6
18-12-2006 02:25 AM
xam
Team Leader


Joined: 01-02-2006
Posts: 11,515
Country: Belgium
Awards:  
Male xam is Offline now
Better [url] format function?
Ahh, sorry its for v3.0.. do you still need it?

Post: #7
18-12-2006 09:38 AM
crlz


Joined: 13-11-2006
Posts: 62
Country: Finland
Male crlz is Offline now
Better [url] format function?
Xam, can you post it with 1.3.x?

Post: #8
18-12-2006 12:44 PM (This post was last modified: 18-12-2006 12:44 PM by x0r)
x0r


Joined: 23-11-2006
Posts: 97
Country: Isla de Muerte
Male x0r is Offline now
Better [url] format function?
Originally Posted by xam

Ahh, sorry its for v3.0.. do you still need it?

Yes please

Post: #9
18-12-2006 17:52 PM (This post was last modified: 18-12-2006 17:52 PM by xam)
xam
Team Leader


Joined: 01-02-2006
Posts: 11,515
Country: Belgium
Awards:  
Male xam is Offline now
Better [url] format function?
PHP:
function format_urls($s)
{
    return 
preg_replace(
        
"/(\A|[^=\]'\"a-zA-Z0-9])((http|ftp|https|ftps|irc):\/\/[^()<>\s]+)/i",
        
"\1<a href=\"http://anonym.to/?\2\">\2</a>"$s);



PHP:
// [url=http://www.example.com]Text[/url]
    
$s preg_replace(
        
"/\[url=([^()<>\s]+?)\]((\s|.)+?)\[\/url\]/i",
        
"<a href=\"http://anonym.to/?\1\">\2</a>"$s);

    
// [url]http://www.example.com[/url]
    
$s preg_replace(
        
"/\[url\]([^()<>\s]+?)\[\/url\]/i",
        
"<a href=\"http://anonym.to/?\1\">\1</a>"$s); 


That should work.

Post: #10
18-12-2006 19:43 PM
x0r


Joined: 23-11-2006
Posts: 97
Country: Isla de Muerte
Male x0r is Offline now
Better [url] format function?
Solved it another way, but spanks!

Post: #11
18-12-2006 21:19 PM (This post was last modified: 18-12-2006 21:21 PM by crlz)
crlz


Joined: 13-11-2006
Posts: 62
Country: Finland
Male crlz is Offline now
Better [url] format function?
It's getting that error when i go some topic:

Fatal error: Call to undefined function: format_urls() in /usr/local/psa/home/vhosts/findvdr.net/httpdocs/include/globalfunctions.php on line 264

Quick Reply
Decrease Size
Increase Size
Insert bold text Insert italic text Insert underlined text Align text to the left Align text to the centerr Align text to the right Justify text Insert quoted text Code Insert formatted PHP code Insert formatted SQL code
Colors
Insert hyperlink Insert image Insert email address
Smilies
Insert hidden text



Forum Jump: