Author |
Topic |
|
fatum
Junior Member
Belgium
281 Posts |
Posted - 04 February 2003 : 08:11:19
|
When typing a url at the end of the sentence, a lot of people end with a dot. Because of this the url will also contain a dot in the end. Example: http://www.boves.be.
A partial solution is to change the inc_func_common.asp file:
<script language="javascript1.2" runat="server">
function edit_hrefs(sURL, iType) {
sOutput = new String(sURL);
intAddDot = 0;
if ((sOutput.charAt(sOutput.length-1)) == ".") {
sOutput = sOutput.substring(0,sOutput.length-1);
intAddDot = 1;
}
if (iType == 1) {
sOutput = sOutput.replace(/\b(http\:\/\/[\w+\.]+[\w+\.\:\/\@\_\?\=\&\-\'\#\%\~\;\,\$\!\+\*]+)/gi,
"<a href=\"$1\" target=\"_blank\">$1<\/a>");
} else if (iType == 2) {
sOutput = sOutput.replace(/\b(https\:\/\/[\w+\.]+[\w+\.\:\/\@\_\?\=\&\-\'\#\%\~\;\,\$\!\+\*]+)/gi,
"<a href=\"$1\" target=\"_blank\">$1<\/a>");
} else if (iType == 3) {
sOutput = sOutput.replace(/\b(www\.[\w+\.\:\/\@\_\?\=\&\-\'\#\%\~\;\,\$\!\+\*]+)/gi,
"<a href=\"http://$1\" target=\"_blank\">$1<\/a>");
} else if (iType == 4) {
sOutput = sOutput.replace(/\b([\w+\-\'\#\%\.\_\,\$\!\+\*]+@[\w+\.?\-\'\#\%\~\_\.\;\,\$\!\+\*]+\.[\w+\.?\-\'\#\%\~\_\.\;\,\$\!\+\*]+)/gi,
"<a href=\"mailto\:$1\">$1<\/a>");
} else if (iType == 5) {
sOutput = sOutput.replace(/\b(ftp\:\/\/[\w+\.]+[\w+\.\:\/\@\_\?\=\&\-\'\#\%\~\;\,\$\!\+\*]+)/gi,
"<a href=\"$1\" target=\"_blank\">$1<\/a>");
} else if (iType == 6) {
sOutput = sOutput.replace(/\b(file\:\/\/\/[\w+\:\/\\]+[\w+\/\w+\.\:\/\\\@\_\?\=\&\-\'\#\%\~\;\,\$\!\+\*]+)/gi,
"<a href=\"$1\" target=\"_blank\">$1<\/a>");
}
if (intAddDot == 1) {
sOutput = sOutput + ".";
}
return sOutput;
}
</script>
But this doesn't solve the problem always. Hopefully someone with a better understanding of the code then me can fix this |
New Dutch testsite coming soon || Dutch Language file Running: Snitz v3.4.03 on MySQL (MyODBC 2.50)
|
Edited by - fatum on 04 February 2003 09:39:13 |
|
RichardKinser
Snitz Forums Admin
USA
16655 Posts |
Posted - 04 February 2003 : 08:49:48
|
sorry, don't see this as a bug. Just don't put a period after a url. Also, messing around with the edit_hrefs function will almost always break something that is working now. |
|
|
Nikkol
Forum Moderator
USA
6907 Posts |
|
fatum
Junior Member
Belgium
281 Posts |
Posted - 04 February 2003 : 09:41:16
|
lol @Nikkol but I've seen it a few times here on the site, people that are typing just put a dot there, force of habit.
It's true that it's not a real bug, and it's true that changing the edit_hrefs function is risky, but I'm hoping that someone can come up with a better (like in working ) solution |
New Dutch testsite coming soon || Dutch Language file Running: Snitz v3.4.03 on MySQL (MyODBC 2.50)
|
|
|
ruirib
Snitz Forums Admin
Portugal
26364 Posts |
|
VodkaFish
Average Member
USA
654 Posts |
Posted - 04 February 2003 : 10:43:01
|
My users do this constantly. I think if you run a forum for non-tech saavy people, you run into things that aren't problems, but yet... are It's not a true bug, but if a good solution for this ever came out, I think it'd be something nice to implement. |
v ø d k â f ï § h |
|
|
fatum
Junior Member
Belgium
281 Posts |
Posted - 04 February 2003 : 11:20:23
|
Indeed, the things ruirib and RichardKinser said make sense for me, but not for the users of my board
If there is a way to disable the auto conversion, that would also be good, then the users are forced to use the URL icon. |
New Dutch testsite coming soon || Dutch Language file Running: Snitz v3.4.03 on MySQL (MyODBC 2.50)
|
|
|
Shaggy
Support Moderator
Ireland
6780 Posts |
Posted - 04 February 2003 : 11:44:53
|
You could disable the feature by removing the edit_hrefs function altogether.
c ya in the funny books MeTV | Forums (offline) | Graphics | House Of Design | Snitz Bitz "Forgive your enemies, but never forget their names." |
|
|
work mule
Senior Member
USA
1358 Posts |
Posted - 18 July 2003 : 03:17:27
|
Has anyone come up with a solution for the periods being included?
I know that some of you argue that it's not a bug, to disable the auto conversion, or force the [url] tags, but that's not really a solution. See, the auto conversion for many of our users is one of the favorite features of Snitz. However it becomes a pain in the butt for people who like to end their sentences with periods.
Try to tell a website full of writers that they can't end their sentences with periods. |
|
|
MarkJH
Senior Member
United Kingdom
1722 Posts |
Posted - 18 July 2003 : 12:25:47
|
quote: I think if you run a forum for non-tech saavy people, you run into things that aren't problems, but yet... are
Get similar problems in my forum with people typing "Awww..." Just like the full stop problem after the URL, it's more of an annoyance that one can live with than a bug. |
Bandlink.net - http://www.bandlink.net/ Bandlink Music Forums - http://www.bandlink.net/forum/ |
|
|
Doug G
Support Moderator
USA
6493 Posts |
Posted - 18 July 2003 : 12:57:56
|
quote: Originally posted by Nikkol
quote: Originally posted by RichardKinser Just don't put a period after a url.
The technical term for this is the disapperiod
|
====== Doug G ====== Computer history and help at www.dougscode.com |
|
|
RichardKinser
Snitz Forums Admin
USA
16655 Posts |
Posted - 24 September 2003 : 00:08:33
|
How about making the decision to use vbscript's RegEx feature? How does everyone feel about that? I would love to be able to use 1 RegEx to handle all URLs. Does anyone think this is possible? |
|
|
reception
Starting Member
USA
4 Posts |
Posted - 24 September 2003 : 07:33:21
|
quote:
Get similar problems in my forum with people typing "Awww..." Just like the full stop problem after the URL, it's more of an annoyance that one can live with than a bug.
Awww Type it like that so it appears to be a fake link? |
Radio & Records Message Boards 2000-2003 May it always be remembered. |
Edited by - reception on 24 September 2003 07:37:16 |
|
|
|
Topic |
|