[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Quick Favor:



here is the new Display.cc.patch

the Display.h.patch didn't change any



Aaron Turner wrote:
> 
> Could you write a short install.txt for your htdig patches?  Also include
> directions on how to change the unique ID cgi param name from the default
> 'oid' to something else and a brief synopsis regarding what your patch
> does in your words.  I'd like to post your patches on the www.linuxkb.org
> web site in time for tomorrow's weekly news.  Doesn't have to be anything
> fancy- just a page or two will do.
> 
> Thanks.
> 
> --
> Aaron Turner, Core Developer       http://vodka.linuxkb.org/~aturner/
> Linux Knowledge Base Organization  http://linuxkb.org/
> Because world domination requires quality open documentation.
> aka: aturner@vicinity.com, aturner@pobox.com, ion_beam_head@ashtech.net
--- htdig-3.1.4/htsearch/Display.cc	Thu Dec  9 16:28:47 1999
+++ htdig-dev/htsearch/Display.cc	Mon Jan  3 19:41:24 2000
@@ -79,6 +79,10 @@
       }
     //    if (mystrcasestr(currentTemplate->getMatchTemplate(), "excerpt"))
     //	needExcerpt = 1;
+    	
+    //	LINUXKB
+    if(config["ID"] != NULL && config["ID"] != "")
+    	variables.Add(config["ID"]);
 }
 
 //*****************************************************************************
@@ -220,9 +224,44 @@
             excludeFrom->hasPattern() &&
             excludeFrom->FindFirst(url) >= 0)
 	    return 0;
-	else
-	    return 1;
+	else // LINUXKB
+	{
+		String value;
+		String sUrl(url);
+		int vcount = variables.Count();
+		int count = variableValues.Count();
+		int index, valueStart = 1, valueEnd = 1;
+		
+		for(int i = 0; i < vcount; i++)
+		{
+			index = sUrl.indexOf(variables[i]);
+			if(index == -1)
+				continue;
+
+			valueStart = sUrl.indexOf('=', index);
+			valueEnd = sUrl.indexOf('&', valueStart);
+
+			if(valueEnd == -1)
+				valueEnd = sUrl.last();
+
+
+			if((valueEnd - valueStart) > 0) 
+			{
+				value = sUrl.sub((valueStart + 1), (valueEnd - (valueStart + 1)));
+				for(int j = 0; j < count; j++)
+				{
+					if(value.compare(variableValues.Nth(j)) == 0) 
+					{
+						return 0;
+					}
+				}
+				variableValues.Add(value);
+			}
+		}
     }
+// END LINUXKB
+	}
+	    return 1;
 }
 
 //*****************************************************************************