Welcome, Guest. Please login or register.
Did you miss your activation email?


Login with username, password and session length

Search

 
Advanced search

8040 Posts in 1853 Topics- by 2099 Members - Latest Member: roi
Pages: [1]   Go Down
Print
Author Topic: AUTOLINK  (Read 408 times)
0 Members and 1 Guest are viewing this topic.
entire
New Member
*

Karma: 0
Offline Offline

Posts: 0


WWW
« on: May 05, 2003, 02:14:00 PM »

I am just getting to grips with things and am very pleased with the script whilst I am evaluating it.

In Calendar Settings you can enable Auto Link which means if someone adds an http:// address in their posting this becomes a clickable link when viewed.

What I would really like is the same function for an email address, is this possible.

By enabling HTML I realise users can createc their own tags to enable this however I am not keen on allowing HTML.

Any suggestions or help appreciated.

Thanks


Graham

Logged
DanO
Moderator
Full Member
*****

Karma: 13
Offline Offline

Posts: 227

Please don't PM me. Post in the open forum.


WWW
« Reply #1 on: May 05, 2003, 05:04:00 PM »

** What I would really like is the same function for an email address, is this possible. **

Look in the HTML.pm file located in the "lib" directory. Find the subroutine "sub autoLink" and after the line:

$text =~ s#(^|\s)(http://\S*)#$1<A HREF="$2" $target>$2</A>#gs;

try adding:

$text =~ s#(\S+@\W+\S+)#<A HREF="mailto:$1">$1</a>#gs;

That should make an email link of any string that contains an "@" symbol. It's not perfect but should work for most.

Dan O.
Unofficial CalendarScript - Mods and Plugins site

------------------

Logged
entire
New Member
*

Karma: 0
Offline Offline

Posts: 0


WWW
« Reply #2 on: May 06, 2003, 01:59:00 AM »

Thanks very much for that.

Graham

------------------

Logged
DanO
Moderator
Full Member
*****

Karma: 13
Offline Offline

Posts: 227

Please don't PM me. Post in the open forum.


WWW
« Reply #3 on: May 06, 2003, 08:48:00 PM »

Did it work?

Dan O.

------------------

Logged
entire
New Member
*

Karma: 0
Offline Offline

Posts: 0


WWW
« Reply #4 on: May 08, 2003, 02:20:00 AM »

DanO

Sorry mate yours did not work but having trawled through the previous topics I found some one had posted the following which does work for me:

$text =~ s#(^|[^\w-])([\w.-]*@[\w.-]+(\.[\w-]+)+)#$1<A HREF="mailto:$2">$2</A>#gs;

Thanks for your help

Graham

------------------

Logged
King-Kong
Guest
« Reply #5 on: October 08, 2003, 10:48:00 AM »

That worked great for me too! thanks!
Logged
Pages: [1]   Go Up
Print
Jump to: