From grdetil@scrc.umanitoba.ca Mon Jul 31 16:24:00 2000 Date: Mon, 31 Jul 2000 12:23:38 -0500 (CDT) From: Gilles Detillieux To: htdig@htdig.org Cc: echan@rim.net, alan@id-media.com Subject: [htdig] PATCH: enhanced build_select_lists attribute OK, there have been a few requests for this, and it's been gnawing away in the back of my mind for a while, so I took a bit of time to implement this. This patch extends the functionality of the build_select_lists attribute to build not only single-choice select lists, but also select multiple lists, radio button lists and checkbox lists. It's for version 3.1.5 of htsearch, and includes documentation additions to describe the enhancements. Please read that for instructions and examples, rather than asking the author. :-) You can point your web browser to the htdoc directory in your source tree. You can apply the patch by saving this e-mail message as-is (provided your mail program doesn't clobber it), and going to the main source directory of htdig-3.1.5 to run this command: patch -p0 < /path/to/saved/patch/file --- htsearch/Display.cc.oldbuild Sat May 13 21:40:09 2000 +++ htsearch/Display.cc Mon Jul 31 09:48:59 2000 @@ -498,27 +498,96 @@ Display::setVariables(int pageNumber, Li int ivalue = atoi(builds[b+4]); int ilabel = atoi(builds[b+5]); int nsel = 0; + int mult = 0, asinput = 0; + char *cp; + char sepc = '\001'; + String currval; + String pre, post; + QuotedStringList nameopt(builds[b], ",", 1); QuotedStringList namelist(config[builds[b+2]], " \t\r\n"); if (ntuple > 0 && ivalue > 0 && ivalue <= ntuple - && ilabel > 0 && ilabel <= ntuple && namelist.Count() % ntuple == 0) + && ilabel > 0 && ilabel <= ntuple && namelist.Count() % ntuple == 0 + && nameopt.Count() > 0) { + if (strcmp(builds[b+1], "restrict") == 0 + || strcmp(builds[b+1], "exclude") == 0) + sepc = '|'; + if (nameopt.Count() == 1) + ; // default is single select + else if (mystrcasecmp(nameopt[1], "multiple") == 0) + mult = 1; + else if (mystrcasecmp(nameopt[1], "radio") == 0) + asinput = 1; + else if (mystrcasecmp(nameopt[1], "checkbox") == 0) + { + mult = 1; + asinput = 1; + } + if (nameopt.Count() > 2) + pre = nameopt[2]; + else + pre = ""; + if (nameopt.Count() > 3) + post = nameopt[3]; + else + post = ""; + str = new String(); - *str << "\n"; + } for (i = 0; i < namelist.Count(); i += ntuple) { - *str << "