#56104
08/06/2003 6:39 PM
|
Joined: May 2001
Posts: 283
Member
|
Member
Joined: May 2001
Posts: 283 |
Since UBB already automatically hyperlinks full url's when posting a message, I was wondering if it's possible to do the same with email addresses. Ease of use is so important to many members and it's always easier, for them, when things can happen automatically. If I type [email protected] it sould come out as user@domain.com without me having to use the UBB Code. What do you think?
|
|
|
#56105
08/07/2003 1:44 AM
|
Joined: May 2001
Posts: 1,042 Likes: 7
Moderator
|
Moderator
Joined: May 2001
Posts: 1,042 Likes: 7 |
in ubb_lib.cgi # find: return ($check);
# add above: $check =~ s/(^|s)([^<>@]+)@([a-z0-9-_.]+)(.|,|))?/$1<a href="mailto:$2@$3">$2@$3</a>$4/si; Not tested, but that should work.
|
|
|
#56106
08/07/2003 1:57 AM
|
Joined: May 2001
Posts: 283
Member
|
Member
Joined: May 2001
Posts: 283 |
Close, but here's what I got when I put in my email address ( [email protected]): fishing.com The mailto: worked so when I clicked it I got my mail client come up with a message to fishing.com.
|
|
|
#56107
08/07/2003 2:03 AM
|
Joined: May 2001
Posts: 283
Member
|
Member
Joined: May 2001
Posts: 283 |
I added a backslash before the two @ at the end of the line and it seems to work now.
Sound right?
|
|
|
#56108
08/07/2003 2:08 AM
|
Joined: May 2001
Posts: 283
Member
|
Member
Joined: May 2001
Posts: 283 |
Oooh, there's a problem... It works when you post it, but if you edit the post it runs the process again making this:
|
|
|
#56109
08/08/2003 2:26 PM
|
Joined: May 2001
Posts: 283
Member
|
Member
Joined: May 2001
Posts: 283 |
Bump. Any more help available out there???
|
|
|
#56110
08/14/2003 4:13 PM
|
Joined: May 2001
Posts: 283
Member
|
Member
Joined: May 2001
Posts: 283 |
|
|
|
#56111
08/15/2003 1:21 AM
|
Joined: May 2001
Posts: 1,042 Likes: 7
Moderator
|
Moderator
Joined: May 2001
Posts: 1,042 Likes: 7 |
I have tried thinking why this isn't going through right, i'm still not sure, but i have a few ideas. Try replacing that above $check =~ with $check =~ s/(^|s)([^@[]+)@(S+).([a-z]{2,3})(.|,|))?/$1<a href="mailto:$2@$3.$4">$2@$3.$4</a>$5/si;
|
|
|
#56112
08/15/2003 1:42 AM
|
Joined: Jan 2003
Posts: 3,456 Likes: 2
Master Hacker
|
Master Hacker
Joined: Jan 2003
Posts: 3,456 Likes: 2 |
There was a compilation error while loading the UBB.classic libraries and data files:
syntax error at /home/httpd/vhosts/alforadmin.com/cgi-bin/ubb_lib.cgi line 1810, near "=~ =~" Compilation failed in require at ultimatebb.cgi line 139.
Please make sure that you uploaded the CGI and Variables files to the proper directory, permissions are set properly on the files, and that paths in the control panel are set correctly. I don't suggest trying that code
|
|
|
#56113
08/15/2003 4:18 AM
|
Joined: May 2001
Posts: 1,042 Likes: 7
Moderator
|
Moderator
Joined: May 2001
Posts: 1,042 Likes: 7 |
Oops! Had an extra =~, sorry. Fixed.
|
|
|
#56114
08/15/2003 5:35 AM
|
Joined: Jan 2003
Posts: 3,456 Likes: 2
Master Hacker
|
Master Hacker
Joined: Jan 2003
Posts: 3,456 Likes: 2 |
ok, this has to be the coolest bug ever. I post " [email protected]" it leaves that as regular text. It then adds [email]@.[/email] to EVERYONE'S sig! It's between the sig and the sig divider. If they don't have a sig, it makes their sig only [email]@.[/email] (note, the email tags were converted so it would email @.) http://www.alforadmin.com/cgi-bin/ultimatebb.cgi?ubb=get_topic;f=10;t=000011;p=2#000025 there's an example, but it shows up in all posts that have been replied to since I tried it. I'll leave it in so you can see it.
|
|
|
#56115
08/15/2003 6:23 AM
|
Joined: May 2001
Posts: 1,042 Likes: 7
Moderator
|
Moderator
Joined: May 2001
Posts: 1,042 Likes: 7 |
Argh...
Sorry, i don't have a test board to try this out. You put that into the auto_url sub, right? I'm gonna have to look at this closer...
|
|
|
#56116
08/15/2003 4:02 PM
|
Joined: Jan 2003
Posts: 3,456 Likes: 2
Master Hacker
|
Master Hacker
Joined: Jan 2003
Posts: 3,456 Likes: 2 |
sub auto_url { my $check = shift; $check =~ s/(^|s)(http://S+)(.|,|))?/$1<a href="$2" target="_blank">$2</a>$3/isg; $check =~ s/(^|s)(https://S+)(.|,|))?/$1<a href="$2" target="_blank">$2</a>$3/isg; $check =~ s/(^|s)(ftp://S+)(.|,|))?/$1<a href="$2" target="_blank">$2</a>$3/isg; $check =~ s/(^|s)(www.S+)(.|,|))?/$1<a href="http://$2" target="_blank">$2</a>$3/isg; $check =~ s/<a href="(.+?)." target="_blank">(.+?).</a>/<a href="$1" target="_blank">$2</a>./si; $check =~ s/(^|s)([^@[]+)@(S+).([a-z]{2,3})(.|,|))?/$1<a href="mailto:$2@$3.$4">$2@$3.$4</a>$5/si; return ($check); } # end auto_url that's what I have now. (the error was happening before I installed the other hack you did(removing the period)
|
|
|
#56117
08/25/2003 10:03 PM
|
Joined: May 2001
Posts: 1,042 Likes: 7
Moderator
|
Moderator
Joined: May 2001
Posts: 1,042 Likes: 7 |
Finally, got a test board up and tested this out. $check =~ s/(^|s)([^<>@]+)@([a-z0-9-_.]+)(.|,|))?/$1<a href="mailto:$2@$3">$2@$3</a>$4/si; Probably should put that above the url/period one, jic.
|
|
|
#56118
08/25/2003 10:45 PM
|
Joined: Jan 2003
Posts: 3,456 Likes: 2
Master Hacker
|
Master Hacker
Joined: Jan 2003
Posts: 3,456 Likes: 2 |
ummm... one more problem. If I have a line break before the email, it becomes I don't think that's right also, it won't convert more than one email per post :-/
|
|
|
#56119
08/26/2003 1:09 AM
|
Joined: May 2001
Posts: 1,042 Likes: 7
Moderator
|
Moderator
Joined: May 2001
Posts: 1,042 Likes: 7 |
Whoops, didn't take them into account. Here's a better patch. $check =~ s/(^|s)([^<>@nrs]+)@([a-z0-9-_.nrs]+)(.|,|))?/$1<a href="mailto:$2@$3">$2@$3</a>$4/si;
|
|
|
#56120
08/26/2003 3:28 PM
|
Joined: Jan 2003
Posts: 3,456 Likes: 2
Master Hacker
|
Master Hacker
Joined: Jan 2003
Posts: 3,456 Likes: 2 |
ok, couple more problems.
any line breaks after the email get added to it. also, it'll sometime take the next line and add it to the link
http://www.alforadmin.com/cgi-bin/ultimatebb.cgi?ubb=get_topic;f=10;t=000014;p=1#000005 < an example
|
|
|
#56121
08/26/2003 3:59 PM
|
Joined: Jan 2000
Posts: 5,073
Admin Emeritus
|
Admin Emeritus
Joined: Jan 2000
Posts: 5,073 |
Try processing it and turning it into an [email] tag set, then let the regular processor take it from there...
UBB.classic: Love it or hate it, it was mine.
|
|
|
Donate to UBBDev today to help aid in Operational, Server and Script Maintenance, and Development costs.
Please also see our parent organization VNC Web Services if you're in the need of a new UBB.threads Install or Upgrade, Site/Server Migrations, or Security and Coding Services.
|
|
Posts: 1,157
Joined: July 2001
|
|
Forums63
Topics37,573
Posts293,925
Members13,849
|
Most Online5,166 Sep 15th, 2019
|
|
Currently Online
Topics Created
Posts Made
Users Online
Birthdays
|
|
|
|