Author |
Topic |
weeweeslap
Senior Member
USA
1077 Posts |
|
leatherlips
Senior Member
USA
1838 Posts |
|
weeweeslap
Senior Member
USA
1077 Posts |
Posted - 09 June 2008 : 22:48:06
|
ah yes, I made another post testing spring fever, I noticed that it changes the capitalization to whatever capitalization you have set in the XML file.< |
coaster crazy |
|
|
Carefree
Advanced Member
Philippines
4207 Posts |
Posted - 10 June 2008 : 02:45:04
|
I figured out the settings for you, Leather. For pages on your server, use relative paths in the Keywords.xml page. For external pages, use complete (http) paths in the Keywords.xml page. It'll work.
< |
|
|
cripto9t
Average Member
USA
881 Posts |
Posted - 10 June 2008 : 08:07:58
|
I left out one of the changes in my update post. quote: 1. In the function FormatStr(), move this line "fString = ChkKeys(fString)" to here
function FormatStr(fString)
on Error resume next
fString = ChkKeys(fString)
So if you just replaced the ChkKeys() function, you need to do this also. This may fix the first and last word issue, because I'm not having that problem.
quote: I noticed that it changes the capitalization to whatever capitalization you have set in the XML file.
Thats the way it works. I may be able to solve that using regular expressions. Most of the sites I visit use all caps for the keywords. Thats probably why I never thought this would be an issue. Thanks carefree, I was thinking in a different direction, but I like your solution better .
< |
_-/Cripto9t\-_ |
|
|
weeweeslap
Senior Member
USA
1077 Posts |
Posted - 10 June 2008 : 18:06:01
|
looking good cripto9t! I really like it. I appreciate it alot! Many sincere thanks!< |
coaster crazy |
|
|
leatherlips
Senior Member
USA
1838 Posts |
Posted - 10 June 2008 : 19:52:05
|
Thanks Carefree for the code. Now my links open the way I want them.
I'm still having trouble with the dashed underline links.
I finally got them to work but then all of a sudden they reverted back to my default forum link style. Here is what I have in inc_header.asp concerning the links:
"#autokeywords{color:#333399;font-weight:normal;text-decoration:none;border-bottom:1px dashed;}" & vbNewLine & _
"#autokeywords:hover{color:red;font-weight:normal;text-decoration:none;border-bottom:1px dashed;}" & vbNewLine & _ It worked for a little bit then stopped. Any ideas?
(I also renamed the id autokeywords in the code in inc_func_common.asp)
Edit: I got it to work again. I commented out those two lines found earlier in this thread and then recommented them. It seems to be working now.
The only thing left IMO is to maintain the case of the letters if possible. < |
Mangione Magic Forum - The Music of Chuck Mangione
My Mods: Googiespell MOD | Link To Reply MOD | Petition MOD | Contact Page MOD | Share This Topic MOD | MP3 MOD | PageEar MOD | Google Viewer MOD |
Edited by - leatherlips on 10 June 2008 20:52:44 |
|
|
Carefree
Advanced Member
Philippines
4207 Posts |
Posted - 10 June 2008 : 21:49:57
|
quote: Originally posted by leatherlips The only thing left IMO is to maintain the case of the letters if possible.
If a hexadecimal conversion of the string (rather than a straight comparison without regard to capitalization) is used, that could be done - though I'm not sure whether it would still recognize keywords which used different capitalization. Would have to experiment a bit, unless somebody knows a quick/dirty way....< |
|
|
Carefree
Advanced Member
Philippines
4207 Posts |
Posted - 10 June 2008 : 21:54:07
|
quote: Originally posted by leatherlips
Each time you upate your xml file or even change the target of the keyword links in the inc_func_common.asp file you must first uncomment the lines you mentioned, save the file and then uncomment the lines and then save again:
Not quite, Leather.
To modify "on the fly", you should:
- Comment the two lines.
- Save the file.
- Make your changes.
- Test the changes.
- Un-comment the two lines.
- Save the file again.
That way, your changes will be evident immediately and not contingent on a replacement of your cookie.< |
Edited by - Carefree on 10 June 2008 21:58:50 |
|
|
leatherlips
Senior Member
USA
1838 Posts |
|
Carefree
Advanced Member
Philippines
4207 Posts |
Posted - 10 June 2008 : 22:01:14
|
I have the same issue with first/last occasionally not following set behaviour. Not sure what's causing it. I'm going to experiment & see if I can fix it, though.< |
|
|
leatherlips
Senior Member
USA
1838 Posts |
|
cripto9t
Average Member
USA
881 Posts |
Posted - 11 June 2008 : 08:15:11
|
Maybe there's just not enough room.
Leatherlips, for the bottom border try setting the line-height up. I added a border to mine and like yours some worked and some didn't, especially when they were on consecutive lines. Mine started working at 18px.
line-height:18px;< |
_-/Cripto9t\-_ |
|
|
leatherlips
Senior Member
USA
1838 Posts |
|
cripto9t
Average Member
USA
881 Posts |
Posted - 11 June 2008 : 10:05:20
|
Switched everything over to regular expressions and words now keep thier structure (upper and lower case).
I'm not going to update the topic yet because I want to add carefrees window addon to it and a better way of handling the xml error message and maybe a few other things. So for anyone that wants to test it out, I'll post the code here for now. Just replace the ChkKeys() function and the LoadKeywordApps() sub.
Function ChkKeys(fString)
dim strFiles,iCnt,strKeys,strReplace,strClose,keywords,keyreplace,objRegex
if ShowKeyWords = False then
ChkKeys = fString
Exit Function
end if
if trim(Application(strCookieURL & "STRKEYWORDS")) = "" or trim(Application(strCookieURL & "STRKEYREPLACE")) = "" then
LoadKeywordApps
end if
strKeys = Application(strCookieURL & "STRKEYWORDS")
strReplace = Application(strCookieURL & "STRKEYREPLACE")
strClose = "</a>"
if fString = "" or IsNull(fString) then fString = " "
keywords = split(strKeys, ",")
keyreplace = split(strReplace, ",")
set objRegex = new RegExp
objRegex.ignorecase = true
objRegex.global = true
for i = 0 to Ubound(keywords)
strPattern = "^(" & keywords(i) & ")(\s)"
strReplace = keyreplace(i) & "$1" & strClose & "$2"
objRegex.pattern= strPattern
fString = objRegex.replace(fString,strReplace)
strPattern = "(" & keywords(i) & ")$"
strReplace = keyreplace(i) & "$1" & strClose
objRegex.pattern= strPattern
fString = objRegex.replace(fString,strReplace)
strPattern = "(""|'|\(|\[|{)(" & keywords(i) & ")(}|\]|\)|'|"")"
strReplace = "$1" & keyreplace(i) & "$2" & strClose & "$3"
objRegex.pattern= strPattern
fString = objRegex.replace(fString,strReplace)
strPattern = "(\s)(" & keywords(i) & ")(\s|\.|,|;|'|\?|!|\)|\]|}|"")"
strReplace = "$1" & keyreplace(i) & "$2" & strClose & "$3"
objRegex.pattern= strPattern
fString = objRegex.replace(fString,strReplace)
next
ChkKeys = fString
End Function
Sub LoadKeywordApps()
dim strPath,xmlDoc,strErr,xmlKeyList,NumOfKeys,strKeys,strReplace,iKey
strPath = "C:\Inetpub\wwwroot\pool\key_db.xml"
set xmlDoc=CreateObject("Microsoft.XMLDOM")
xmlDoc.async="false"
xmlDOc.setProperty "ServerHTTPRequest", true
xmlDoc.load(strPath)
if xmlDoc.parseError.errorCode <> 0 Then
strErr = "<div><b>" & vbNewLine & _
"<ul>" & vbNewLine & _
"<li>ERROR!</li>" & vbNewLine & _
"<li>XML File " & strFileName & " - Failed to validate.</li>" & vbNewLine & _
"<li>" & xmlDoc.parseError.reason & "</li>" & vbNewLine & _
"<li>Error code: " & xmlDoc.parseError.errorCode & "</li>" & vbNewLine & _
"<li>Line: " & xmlDoc.parseError.line & "</li>" & vbNewLine & _
"<li>Character: " & xmlDoc.parseError.linepos & "</li>" & vbNewLine & _
"<li>Source: " & Chr(34) & xmlDoc.parseError.srcText & Chr(34) & "</li>" & vbNewLine & _
"<li>" & Now & "</li>" & vbNewLine & _
"</ul>" & vbNewLine & _
"</b></div>" & vbNewLine
Response.Write strErr
Response.End
end if
set xmlKeyList = xmlDoc.getElementsByTagName("key")
NumOfKeys = ((xmlKeyList.length) - 1) '0 based
strKeys = ""
strReplace = ""
for iKey = 0 to cLng(NumOfKeys)
if strKeys = "" then
strKeys = xmlKeyList.item(iKey).childNodes(0).text
strReplace = "<a id=""keywords"" href=""" & xmlKeyList.item(iKey).childNodes(1).text & """ target=""blank"">"
else
strKeys = strKeys & "," & xmlKeyList.item(iKey).childNodes(0).text
strReplace = strReplace & ", <a id=""keywords"" href=""" & xmlKeyList.item(iKey).childNodes(1).text & """ target=""blank"">"
end if
next
set xmlKeyList = nothing
set xmlDoc = nothing
Application.Lock
Application(strCookieURL & "STRKEYWORDS") = strKeys
Application(strCookieURL & "STRKEYREPLACE") = strReplace
Application.UnLock
End Sub < |
_-/Cripto9t\-_ |
|
|
Topic |
|