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


Login with username, password and session length

Search

 
Advanced search

8054 Posts in 1860 Topics- by 2099 Members - Latest Member: roi
Calendar Script CommunityCustomizationHacks and Mods (Moderators: scott, DanO, Marty)auto link for http: and https:
Pages: [1]   Go Down
Print
Author Topic: auto link for http: and https:  (Read 472 times)
0 Members and 1 Guest are viewing this topic.
chipsterva
Guest
« on: November 21, 2005, 02:00:00 PM »

I'm a relative newbie to Perl, so am running into some problems figuring out how to handle this - we want to use both http: and https: in the auto-link feature.  I have browsed the forum here and on much2.com, and don't see anything on it.  How can I do this?  Thanks in advance.
Logged
DanO
Moderator
Full Member
*****

Karma: 13
Offline Offline

Posts: 235

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


WWW
« Reply #1 on: November 21, 2005, 05:06:00 PM »

You can try editing the HTML.pm file found in the /calendarscript/lib directory.  In the sub autoLink { subroutine, you can try changing the following line:

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

to something like:

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

    This code is un-tested, use at your own risk and always keep a backup of original file just in case.

Dan O.

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

Logged
chipsterva
Guest
« Reply #2 on: November 22, 2005, 07:04:00 AM »

Dan O., you are the man.  Works like a charm.  Thanks a million!
Logged
DanO
Moderator
Full Member
*****

Karma: 13
Offline Offline

Posts: 235

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


WWW
« Reply #3 on: November 22, 2005, 12:12:00 PM »

Glad to hear it.

Dan O.

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

Logged
Pages: [1]   Go Up
Print
Jump to: