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 MOD-Group
 MOD Add-On Forum (W/Code)
 Keyword Links - Last Update 6/9/08
 New Topic  Reply to Topic
 Printer Friendly
Previous Page | Next Page
Author Previous Topic Topic Next Topic
Page: of 7

weeweeslap
Senior Member

USA
1077 Posts

Posted - 09 June 2008 :  22:01:35  Show Profile  Visit weeweeslap's Homepage  Send weeweeslap an AOL message  Send weeweeslap a Yahoo! Message  Reply with Quote
http://www.mangionemagic.com/forumbeta/topic.asp?TOPIC_ID=881
hmm I logge din and made some sample posts and see the results, neither worked and I didn't do any tricks!<

coaster crazy
Go to Top of Page

leatherlips
Senior Member

USA
1838 Posts

Posted - 09 June 2008 :  22:35:09  Show Profile  Visit leatherlips's Homepage  Reply with Quote
quote:
Originally posted by weeweeslap

hmm I logge din and made some sample posts and see the results, neither worked and I didn't do any tricks!

You typed the wrong phrase.

You typed Feel So Good. The phrase I have is Feels So Good.<

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
Go to Top of Page

weeweeslap
Senior Member

USA
1077 Posts

Posted - 09 June 2008 :  22:48:06  Show Profile  Visit weeweeslap's Homepage  Send weeweeslap an AOL message  Send weeweeslap a Yahoo! Message  Reply with Quote
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
Go to Top of Page

Carefree
Advanced Member

Philippines
4207 Posts

Posted - 10 June 2008 :  02:45:04  Show Profile  Reply with Quote
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.


		for iKey = 0 to cLng(NumOfKeys)
			if strKeys = "" then
				strKeys = xmlKeyList.item(iKey).childNodes(0).text
				strDiv = xmlKeyList.item(iKey).childNodes(1).text
				if left(strDiv,4)<> "http" and left(strDiv,3) <> "ftp" then
					strReplace = "<a id=""keywords"" href=""" & xmlKeyList.item(iKey).childNodes(1).text & """ target=""_self"">"
				else
					strReplace = "<a id=""keywords"" href=""" & xmlKeyList.item(iKey).childNodes(1).text & """ target=""_blank"">"
				end if
				strReplace = strReplace & xmlKeyList.item(iKey).childNodes(0).text & "</a>"
			else
				strKeys = strKeys & "," & xmlKeyList.item(iKey).childNodes(0).text
				strDiv = xmlKeyList.item(iKey).childNodes(1).text
				strDiz = xmlKeyList.item(iKey).childNodes(0).text
				if left(strDiv,4)= "http" or left(strDiv,3) = "ftp" then
					strReplace = strReplace & ", <a id=""keywords"" href=""" & xmlKeyList.item(iKey).childNodes(1).text & """ target=""_blank"">"
				else
					strReplace = strReplace & ", <a id=""keywords"" href=""" & xmlKeyList.item(iKey).childNodes(1).text & """ target=""_self"">"
				end if
				strReplace = strReplace & xmlKeyList.item(iKey).childNodes(0).text & "</a>"
			end if
		next
<
Go to Top of Page

cripto9t
Average Member

USA
881 Posts

Posted - 10 June 2008 :  08:07:58  Show Profile  Reply with Quote
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\-_
Go to Top of Page

weeweeslap
Senior Member

USA
1077 Posts

Posted - 10 June 2008 :  18:06:01  Show Profile  Visit weeweeslap's Homepage  Send weeweeslap an AOL message  Send weeweeslap a Yahoo! Message  Reply with Quote
looking good cripto9t! I really like it. I appreciate it alot! Many sincere thanks!<

coaster crazy
Go to Top of Page

leatherlips
Senior Member

USA
1838 Posts

Posted - 10 June 2008 :  19:52:05  Show Profile  Visit leatherlips's Homepage  Reply with Quote
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
Go to Top of Page

Carefree
Advanced Member

Philippines
4207 Posts

Posted - 10 June 2008 :  21:49:57  Show Profile  Reply with Quote
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....<
Go to Top of Page

Carefree
Advanced Member

Philippines
4207 Posts

Posted - 10 June 2008 :  21:54:07  Show Profile  Reply with Quote
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:

'if trim(Application(strCookieURL & "STRKEYWORDS")) = "" or trim(Application(strCookieURL & "STRKEYREPLACE")) = "" then
	LoadKeywordApps
'end if



Not quite, Leather.

To modify "on the fly", you should:

  1. Comment the two lines.

  2. Save the file.

  3. Make your changes.

  4. Test the changes.

  5. Un-comment the two lines.

  6. 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
Go to Top of Page

leatherlips
Senior Member

USA
1838 Posts

Posted - 10 June 2008 :  21:54:23  Show Profile  Visit leatherlips's Homepage  Reply with Quote
I've just discovered a new odd issue. For some reason, not all of the links take on the id set in inc_header.asp. My auto terms links are set to be dashed. However in this post the last key phrase ignores the id:



But if I edit it and add a phrase after it, it takes on the id but then the new last one does not:



And then again:



It does not do this in every post. What would be causing this?<

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
Go to Top of Page

Carefree
Advanced Member

Philippines
4207 Posts

Posted - 10 June 2008 :  22:01:14  Show Profile  Reply with Quote
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.<
Go to Top of Page

leatherlips
Senior Member

USA
1838 Posts

Posted - 10 June 2008 :  22:26:28  Show Profile  Visit leatherlips's Homepage  Reply with Quote
quote:
Originally posted by Carefree

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.

I'm not sure, but I just checked my page on my MacBook using Safari and Firefox and the links were all correctly taking on the id.

Could it be a browser issue that causes some of the links not to behave correctly?
<

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
Go to Top of Page

cripto9t
Average Member

USA
881 Posts

Posted - 11 June 2008 :  08:15:11  Show Profile  Reply with Quote
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\-_
Go to Top of Page

leatherlips
Senior Member

USA
1838 Posts

Posted - 11 June 2008 :  09:31:06  Show Profile  Visit leatherlips's Homepage  Reply with Quote
quote:
Originally posted by cripto9t

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;

Good call! 18 was the magic number!

I have had one of my users testing this out for me and they really love this new feature! Thanks again for all of your work!<

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
Go to Top of Page

cripto9t
Average Member

USA
881 Posts

Posted - 11 June 2008 :  10:05:20  Show Profile  Reply with Quote
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\-_
Go to Top of Page
Page: of 7 Previous Topic Topic Next Topic  
Previous Page | Next Page
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
Snitz Forums 2000 © 2000-2021 Snitz™ Communications Go To Top Of Page
This page was generated in 0.17 seconds. Powered By: Snitz Forums 2000 Version 3.4.07