Snitz Forums 2000
Snitz Forums 2000
Home | Profile | Register | Active Topics | Members | Search | FAQ
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 Snitz Forums 2000 DEV-Group
 DEV Bug Reports (Open)
 3.4.05 Bug+Fix "url & puncuation"
 New Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

Da_Stimulator
DEV Team Forum Moderator

USA
3373 Posts

Posted - 10 November 2004 :  23:11:15  Show Profile  Send Da_Stimulator an AOL message  Send Da_Stimulator a Yahoo! Message  Reply with Quote
Updated! 11/11/04
- Updated to account for line breaks
- Updated to account for other common punctuation (;, :)

Like a need it but http://www.demonstration.url!

In inc_func_common.asp find this code:


function ChkURLs(ByVal strToFormat, ByVal sPrefix, ByVal iType)
	Dim strArray
	Dim Counter


Directly after that code insert the following


	if InStr(strToFormat, sPrefix)>0 then
	 Dim StrArray1
	 Dim LastChar, i
	 strToFormat = Replace(StrToFormat, "<br />", " :: ")
	  StrArray1 = split(strToFormat, " ")
	    if not(UBound(strArray1)<1) then
		  For i=0 to Ubound(strArray1)
		    if Left(strArray1(i), len(sPrefix))=sPrefix then
			 LastChar = Right(strArray1(i), 1)
			 'response.write(LastChar)
			  Select Case LastChar
			    Case ".",",","!","?",";",":"
				 strArray1(i) = Left(strArray1(i), len(strArray1(i))-1) & " " & LastChar
			  End Select
		     end if
		   i=i+1
		  Next
	    else
		    if Left(strArray1(0), len(sPrefix))=sPrefix then
			 LastChar = Right(strArray1(0), 1)
			 'response.write(LastChar)
			  Select Case LastChar
			    Case ".",",","!","?",";",":"
				 strArray1(0) = Left(strArray1(0), len(strArray1(0))-1) & " " & LastChar
			  End Select
		    end if
	    end if
	  strToFormat = Join(strArray1, " ")
	  strToFormat = Replace(strToFormat, " :: ", "<br />")
	end if



Edit- Figured it could go in the bug forum<

-Stim

Edited by - Da_Stimulator on 11 November 2004 23:09:37

muzishun
Senior Member

United States
1079 Posts

Posted - 11 November 2004 :  03:26:34  Show Profile  Visit muzishun's Homepage
So if this is retarded, is it bad that I actually think this will come in handy? I've noticed this in the past, but just kind of dealt with it. This will be a nice bug fix. Well done.<

Bill Parrott
Senior Web Programmer, University of Kansas
Co-Owner and Code Monkey, Eternal Second Designs (www.eternalsecond.com)
Personal Website (www.chimericdream.com)

Edited by - muzishun on 11 November 2004 03:26:54
Go to Top of Page

PeeWee.Inc
Senior Member

United Kingdom
1893 Posts

Posted - 11 November 2004 :  04:00:11  Show Profile  Visit PeeWee.Inc's Homepage
Yeah, again, a small but good bug fix <

De Priofundus Calmo Ad Te Damine
Go to Top of Page

HuwR
Forum Admin

United Kingdom
20593 Posts

Posted - 11 November 2004 :  04:44:25  Show Profile  Visit HuwR's Homepage
I don't think it is retarded at all, it is correct to use a punctuation mark at the end of a sentance, it is writing work arounds for non existant words which I think is retarded <
Go to Top of Page

MarcelG
Retired Support Moderator

Netherlands
2625 Posts

Posted - 11 November 2004 :  07:23:15  Show Profile  Visit MarcelG's Homepage
Da_Stimulator, could you tell me why it is not working, even after I've done this ?
Look at http://www.oxle.nl/topic.asp?TOPIC_ID=1716 for instance.
I've checked, and rechecked, and I've used the exact code you proposed...
<

portfolio - linkshrinker - oxle - twitter
Go to Top of Page

Carefree
Advanced Member

Philippines
4216 Posts

Posted - 11 November 2004 :  08:43:04  Show Profile
quote:
Originally posted by Da_Stimulator

			    Case ".",",","!","?"




Need to add two more common ones

			    Case ".",",","!","?",";",":"
<
Go to Top of Page

Da_Stimulator
DEV Team Forum Moderator

USA
3373 Posts

Posted - 11 November 2004 :  10:36:06  Show Profile  Send Da_Stimulator an AOL message  Send Da_Stimulator a Yahoo! Message
quote:
Originally posted by marcelgoertz

Da_Stimulator, could you tell me why it is not working, even after I've done this ?
Look at http://www.oxle.nl/topic.asp?TOPIC_ID=1716 for instance.
I've checked, and rechecked, and I've used the exact code you proposed...




Could you post your ChkURLs function for me?<

-Stim
Go to Top of Page

Da_Stimulator
DEV Team Forum Moderator

USA
3373 Posts

Posted - 11 November 2004 :  11:52:12  Show Profile  Send Da_Stimulator an AOL message  Send Da_Stimulator a Yahoo! Message
Ok, thats because of line breaks, which I previously didnt account for...

Here's the fix. Right after this:


	 Dim LastChar, i


Insert code in green


	 Dim LastChar, i
	 strToFormat = Replace(StrToFormat, "<br />", " :: ")
	  StrArray1 = split(strToFormat, " ")


Then find this:


	  strToFormat = Join(strArray1, " ")


And insert code in green


	  strToFormat = Join(strArray1, " ")
	  strToFormat = Replace(strToFormat, " :: ", "<br />")
	end if


Code at the top of the page has been updated

quote:

Need to add two more common ones


Case ".",",","!","?",";",":"



Added<

-Stim

Edited by - Da_Stimulator on 11 November 2004 14:31:25
Go to Top of Page

MarcelG
Retired Support Moderator

Netherlands
2625 Posts

Posted - 12 November 2004 :  06:08:45  Show Profile  Visit MarcelG's Homepage
Well, it is working however, it is adding a space inbetween the url and the dot, comma, etc.
I've fixed it now, by replacing the following code as shown in red.
I 'tricked' it by using the bold tag...perhaps a better fix is available, but this did it for me.

if InStr(strToFormat, sPrefix)>0 then
 Dim StrArray1
 Dim LastChar, i
 strToFormat = Replace(StrToFormat, "<br />", " :: ")
  StrArray1 = split(strToFormat, " ")
    if not(UBound(strArray1)<1) then
	  For i=0 to Ubound(strArray1)
	    if Left(strArray1(i), len(sPrefix))=sPrefix then
		 LastChar = Right(strArray1(i), 1)
		 'response.write(LastChar)
		  Select Case LastChar
		    Case ".",",","!","?",";",":"
			 strArray1(i) = Left(strArray1(i), len(strArray1(i))-1) & "<b></b>" & LastChar
		  End Select
	     end if
	   i=i+1
	  Next
    else
	    if Left(strArray1(0), len(sPrefix))=sPrefix then
		 LastChar = Right(strArray1(0), 1)
		 'response.write(LastChar)
		  Select Case LastChar
		    Case ".",",","!","?",";",":"
			 strArray1(0) = Left(strArray1(0), len(strArray1(0))-1) & "<b></b>" & LastChar
		  End Select
	    end if
    end if
  strToFormat = Join(strArray1, " ")
  strToFormat = Replace(strToFormat, " :: ", "<br />")
end if


Thanks for your help!<

portfolio - linkshrinker - oxle - twitter
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic
 Printer Friendly
Jump To:
Snitz Forums 2000 © 2000-2021 Snitz™ Communications Go To Top Of Page
This page was generated in 0.15 seconds. Powered By: Snitz Forums 2000 Version 3.4.07