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
Author Previous Topic Topic Next Topic
Page: of 7

Andy Humm
Average Member

United Kingdom
908 Posts

Posted - 13 August 2008 :  13:53:21  Show Profile  Reply with Quote
Did you reload the keywords? - I assume you mean upload the xml again, if yes, I have done that but still the same?<
Go to Top of Page

leatherlips
Senior Member

USA
1838 Posts

Posted - 13 August 2008 :  14:13:40  Show Profile  Visit leatherlips's Homepage  Reply with Quote
No. I meant:

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


Unless you replaced that with cripto9t's code:

if mLev < 3 then
    if trim(Application(strCookieURL & "STRKEYWORDS")) = "" or trim(Application(strCookieURL & "STRKEYREPLACE")) = "" then
	LoadKeywordApps
    end if
else
    LoadKeywordApps
end if
<

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

Andy Humm
Average Member

United Kingdom
908 Posts

Posted - 13 August 2008 :  17:33:57  Show Profile  Reply with Quote
Leatherlips, thank you for the PM, regarding dynamic signatures... Allow Dynamic Signatures -makes it work.. Thank You Andy<
Go to Top of Page

bobby131313
Senior Member

USA
1163 Posts

Posted - 13 August 2008 :  18:07:50  Show Profile  Visit bobby131313's Homepage  Reply with Quote
Awesome crypto, thanks!

I think the only thing left is the conflict of a user initiated link and a keyword link. Obviously I would like a user initiated link to override an automated link.

That doesn't sound to my amateur mind like it would be easy though. <

Switch the order of your title tags
Go to Top of Page

Carefree
Advanced Member

Philippines
4207 Posts

Posted - 13 August 2008 :  18:12:42  Show Profile  Reply with Quote
I never did get the KW working properly. Disabled it and went on to other things.<
Go to Top of Page

leatherlips
Senior Member

USA
1838 Posts

Posted - 13 August 2008 :  18:21:51  Show Profile  Visit leatherlips's Homepage  Reply with Quote
quote:
Originally posted by bobby131313

Awesome crypto, thanks!

I think the only thing left is the conflict of a user initiated link and a keyword link. Obviously I would like a user initiated link to override an automated link.

That doesn't sound to my amateur mind like it would be easy though.

On my forum, a user initiated link does override the auto link. I didn't do anything different that what was provided in this thread.<

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

bobby131313
Senior Member

USA
1163 Posts

Posted - 13 August 2008 :  18:31:24  Show Profile  Visit bobby131313's Homepage  Reply with Quote
Really? Hmmm... let me investigate, it's been a little while since I played with it.<

Switch the order of your title tags
Go to Top of Page

Andy Humm
Average Member

United Kingdom
908 Posts

Posted - 13 August 2008 :  18:38:58  Show Profile  Reply with Quote
Ditto: On my forum, a user initiated link does override the auto link. I didn't do anything different that what was provided in this thread.<
Go to Top of Page

bobby131313
Senior Member

USA
1163 Posts

Posted - 13 August 2008 :  19:47:00  Show Profile  Visit bobby131313's Homepage  Reply with Quote
I would appear you're correct. <

Switch the order of your title tags
Go to Top of Page

Carefree
Advanced Member

Philippines
4207 Posts

Posted - 22 October 2011 :  20:56:44  Show Profile  Reply with Quote
Here's a "Readers Digest Condensed Book" version of this thread:


Notes:

1.	In "config.asp":

After this line (appx 473):

strShowQuickReply = Application(strCookieURL & "STRSHOWQUICKREPLY")

Insert the following:

'	##	Keywords Below
IKey = Application(strCookieURL & "IKey")
KeyReplace = Application(strCookieURL & "KeyReplace")
KeyWords = Application(strCookieURL & "KeyWords")
NumOfKeys = Application(strCookieURL & "NumOfKeys")
ObjRegex = Application(strCookieURL & "ObjRegex")
ShowKeyWords = Application(strCookieURL & "ShowKeyWords")
strErr = Application(strCookieURL & "strErr")
strKeys = Application(strCookieURL & "strKeys")
strPath = Application(strCookieURL & "strPath")
strReplace = Application(strCookieURL & "strReplace")
XMLDoc = Application(strCookieURL & "XMLDoc")
'	##	Keywords Above


After this line (appx 163):

Dim SubCount, MySubCount

Insert the following:

'	##	Keywords Below
Dim IKey, KeyReplace, Keywords, NumOfKeys, objRegex, ShowKeyWords
Dim strErr, strKeys, strPath, strReplace, xmlDoc
'	##	Keywords Above


2.	In "topic.asp" (and in any other file you wish the keyword links to function):

Before this line (appx 95):

'## Forum_SQL - Get original topic and check for the Category, Forum or Topic Status and existence

Insert the following:

'	##	Keywords Below
ShowKeyWords = True
'	##	Keywords Above

3.	In "inc_func_common.asp":

After these lines (appx 1560-1562):

Sub WriteFooterShort() %>
<!--#INCLUDE FILE="inc_footer_short.asp"-->
<% end sub

Insert the following:

'	##	Keywords Below
Function ChkKeys(fString)
	If ShowKeyWords = FALSE Then
		ChkKeys = fString
		Exit Function
	End If
	If mLev < 3 Then
		If trim(Application(strCookieURL & "STRKEYWORDS")) = "" or trim(Application(strCookieURL & "STRKEYREPLACE")) = "" Then
			LoadKeywordApps
		End If
	Else
		LoadKeywordApps
	End If
	If fString = "" or IsNull(fString) Then
		fString = " "
	End If
	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) & "$2"
		objRegex.pattern= strPattern
		fString = objRegex.replace(fString,strReplace)
		strPattern = "(" & keywords(i) & ")$"
		strReplace = keyreplace(i)
		objRegex.pattern= strPattern
		fString = objRegex.replace(fString,strReplace)
		fString = Replace(fString, " " & keywords(i) & " ", " " & keyreplace(i) & " ", 1, -1, 1)
		fString = Replace(fString, " " & keywords(i) & ",", " " & keyreplace(i) & ",", 1, -1, 1)
		fString = Replace(fString, " " & keywords(i) & ".", " " & keyreplace(i) & ".", 1, -1, 1)
		fString = Replace(fString, " " & keywords(i) & ":", " " & keyreplace(i) & ":", 1, -1, 1)
		fString = Replace(fString, " " & keywords(i) & ";", " " & keyreplace(i) & ";", 1, -1, 1)
		fString = Replace(fString, " " & keywords(i) & "!", " " & keyreplace(i) & "!", 1, -1, 1)
		fString = Replace(fString, " " & keywords(i) & "?", " " & keyreplace(i) & "?", 1, -1, 1)
		fString = Replace(fString, "-" & keywords(i) & "-", "-" & keyreplace(i) & "-", 1, -1, 1)
		fString = Replace(fString, "-" & keywords(i) & " ", "-" & keyreplace(i) & " ", 1, -1, 1)
		fString = Replace(fString, " " & keywords(i) & "-", " " & keyreplace(i) & "-", 1, -1, 1)
		fString = Replace(fString, "_" & keywords(i) & "_", "_" & keyreplace(i) & "_", 1, -1, 1)
		fString = Replace(fString, "_" & keywords(i) & " ", "_" & keyreplace(i) & " ", 1, -1, 1)
		fString = Replace(fString, " " & keywords(i) & "_", " " & keyreplace(i) & "_", 1, -1, 1)
		fString = Replace(fString, "'" & keywords(i) & "'", "'" & keyreplace(i) & "'", 1, -1, 1)
		fString = Replace(fString, "'" & keywords(i) & " ", "'" & keyreplace(i) & " ", 1, -1, 1)
		fString = Replace(fString, " " & keywords(i) & "'", " " & keyreplace(i) & "'", 1, -1, 1)
		fString = Replace(fString, """" & keywords(i) & """", """" & keyreplace(i) & """", 1, -1, 1)
		fString = Replace(fString, """" & keywords(i) & " ", """" & keyreplace(i) & " ", 1, -1, 1)
		fString = Replace(fString, " " & keywords(i) & """", " " & keyreplace(i) & """", 1, -1, 1)
		fString = Replace(fString, "(" & keywords(i) & ")", "(" & keyreplace(i) & ")", 1, -1, 1)
		fString = Replace(fString, "(" & keywords(i) & " ", "(" & keyreplace(i) & " ", 1, -1, 1)
		fString = Replace(fString, " " & keywords(i) & ")", " " & keyreplace(i) & ")", 1, -1, 1)
		fString = Replace(fString, "[" & keywords(i) & "]", "[" & keyreplace(i) & "]", 1, -1, 1)
		fString = Replace(fString, "[" & keywords(i) & " ", "[" & keyreplace(i) & " ", 1, -1, 1)
		fString = Replace(fString, " " & keywords(i) & "]", " " & keyreplace(i) & "]", 1, -1, 1)
		fString = Replace(fString, " " & keywords(i) & " ", " " & keyreplace(i) & " ", 1, -1, 1)
		fString = Replace(fString, chr(13) & chr(10) & keywords(i) & " ", chr(13) & chr(10) & keyreplace(i) & " ", 1, -1, 1)
		fString = Replace(fString, " " & keywords(i) & chr(13) & chr(10), " " & keyreplace(i) & chr(13) & chr(10), 1, -1, 1)
		fString = Replace(fString, chr(13) & chr(10) & keywords(i) & chr(13) & chr(10), chr(13) & chr(10) & keyreplace(i) & chr(13) & chr(10), 1, -1, 1)
		fString = Replace(fString, chr(10) & keywords(i) & ".", chr(10) & keyreplace(i) & ".", 1, -1, 1)
		fString = Replace(fString, chr(10) & keywords(i) & ",", chr(10) & keyreplace(i) & ",", 1, -1, 1)
		fString = Replace(fString, chr(10) & keywords(i) & "?", chr(10) & keyreplace(i) & "?", 1, -1, 1)
		fString = Replace(fString, chr(10) & keywords(i) & "!", chr(10) & keyreplace(i) & "!", 1, -1, 1)
		fString = Replace(fString, chr(10) & keywords(i) & ":", chr(10) & keyreplace(i) & ":", 1, -1, 1)
		fString = Replace(fString, chr(10) & keywords(i) & ";", chr(10) & keyreplace(i) & ";", 1, -1, 1)
		fString = Replace(fString, chr(10) & keywords(i) & """", chr(10) & keyreplace(i) & """", 1, -1, 1)
		fString = Replace(fString, chr(10) & keywords(i) & "'", chr(10) & keyreplace(i) & "'", 1, -1, 1)
		fString = Replace(fString, chr(10) & keywords(i) & ")", chr(10) & keyreplace(i) & ")", 1, -1, 1)
		fString = Replace(fString, chr(10) & keywords(i) & "]", chr(10) & keyreplace(i) & "]", 1, -1, 1)
	Next
	Set objRegex = Nothing
	ChkKeys = fString
End Function

Sub LoadKeywordApps()
	strPath = strForumURL & "keywords.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)
	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"">"
			strReplace = strReplace & xmlKeyList.item(iKey).childNodes(0).text & "</a>"
		Else
			strKeys = strKeys & "," & xmlKeyList.item(iKey).childNodes(0).text
			strReplace = strReplace & ", <a id=""keywords"" href=""" & xmlKeyList.item(iKey).childNodes(1).text & """ target=""blank"">"
			strReplace = strReplace & xmlKeyList.item(iKey).childNodes(0).text & "</a>"
		End If
	Next
	Set xmlKeyList = Nothing
	Set xmlDoc = Nothing
	Application.Lock
	Application(strCookieURL & "STRKEYWORDS") = strKeys
	Application(strCookieURL & "STRKEYREPLACE") = strReplace
	Application.UnLock
End Sub
'	##	Keywords Above

Next, within "FormatStr" function: 

After this line (appx 117):

	on Error resume next

Insert the following:

	'	##	Keywords Below
	If fString <> "Reply_MemberSig" and fString <> "Topic_MemberSig" Then
		fString = ChkKeys(fString)
	End If
	'	##	Keywords Above

4.	keywords.xml file (You'll have to create this yourself, the file name must match the one above in green save to forum root directory):

		NOTES:	
		
			a.	Pattern is critical, nothing extra can be inserted.  
			b.	If the URL is not within your forum, use the entire path (including http://),
					if it is within your forum, just the internal address is sufficient (eg. topic.asp?topic_id=300)
			c.	If a phrase is repeated within a longer phrase (eg. "murder" and "mass murder"), then list the
					longer phrase keyword first or the shorter recognized keyword will point both to the first URL.

<?xml version="1.0" encoding="ISO-8859-1"?>
	<keywords>
		<key>
			<phrase>xml</phrase>
			<url>http://some/site.xml</url>
		</key>
		<key>
			<phrase>html</phrase>
			<url>http://some/site.html</url>
		</key>
		<key>
			<phrase>css</phrase>
			<url>http://some/site.css</url>
		</key>
	</keywords>

Styling (optional):  To add a style to the keyword links, make the following changes.

In "inc_header.asp", look for this line (appx 269):

".spnSearchHighlight {background-color:" & strSearchHiLiteColor & "}" & vbNewLine & _

After that, insert these:

		"#keywords {color:" & strLinkColor & "; font-weight:normal; text-decoration:none; border-bottom-style:1px dashed; line-height:18px;}" & vbNewLine & _
		"#keywords:hover {color:" & strHoverFontColor & "; font-weight:normal; text-decoration:none; border-bottom-style:1px dashed; line-height:18px;}" & vbNewLine & _


Note: I modified this to move all dimensioned variables into "config.asp" from "inc_func_common.asp", etc.

Edited by - Carefree on 03 November 2011 05:53:13
Go to Top of Page

Webbo
Average Member

United Kingdom
982 Posts

Posted - 23 October 2011 :  04:24:27  Show Profile  Visit Webbo's Homepage  Reply with Quote
Why move code around and into the config.asp file when it worked well as is?
Just curious
Go to Top of Page

Carefree
Advanced Member

Philippines
4207 Posts

Posted - 23 October 2011 :  10:33:12  Show Profile  Reply with Quote
Just to keep dimensioned variables together, easier to eliminate repeats.
Go to Top of Page

Webbo
Average Member

United Kingdom
982 Posts

Posted - 23 October 2011 :  12:25:20  Show Profile  Visit Webbo's Homepage  Reply with Quote
Good point
Go to Top of Page
Page: of 7 Previous Topic Topic Next Topic  
Previous 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.1 seconds. Powered By: Snitz Forums 2000 Version 3.4.07