Changeset 20481
- Timestamp:
- 2009-09-02T15:49:49+12:00 (14 years ago)
- Location:
- gsdl/trunk/runtime-src/src/recpt
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
gsdl/trunk/runtime-src/src/recpt/queryaction.cpp
r17938 r20481 809 809 } 810 810 } 811 } 812 813 // add a queryterms macro for plain version of search terms 814 if (!args["q"].empty()) { 815 disp.setmacro ("queryterms", displayclass::defaultpackage, get_plain_query_terms(args["q"])); 811 816 } 812 817 } … … 1650 1655 // also reset the _cgiargq_ macro as it has changed now 1651 1656 disp.setmacro("cgiargq", displayclass::defaultpackage, html_safe(args["q"])); 1652 1657 1653 1658 // reset the compressed options to include the q arg 1654 1659 text_t compressedoptions = recpt->get_compressed_arg(args, logout); -
gsdl/trunk/runtime-src/src/recpt/querytools.cpp
r18459 r20481 332 332 } 333 333 334 335 334 // turn query string into terms separated by spaces. 335 // still working on this... 336 text_t get_plain_query_terms(const text_t &querystring) { 337 338 text_t::const_iterator here = querystring.begin(); 339 text_t::const_iterator end = querystring.end(); 340 text_t terms = ""; 341 bool space = false; 342 while (here != end) { 343 if (*here == '#' || *here == '/') { 344 // skip over #is /10 etc 345 ++here; 346 while (here != end && *here != ' ') { 347 ++here; 348 } 349 if (here == end) break; 350 } 351 if (*here == '[') { 352 // get the text out and ignore the :TI after 353 } 354 if (is_unicode_letdig(*here)) { 355 terms.push_back(*here); 356 space = false; 357 } else { 358 if (!space) { 359 terms.push_back(' '); 360 space = true; 361 } 362 } 363 ++here; 364 } 365 return terms; 366 367 } 336 368 337 369 // search history tool -
gsdl/trunk/runtime-src/src/recpt/querytools.h
r12864 r20481 48 48 int startbc, int endbc, int ct); 49 49 50 // get a plain version of the query string - terms, separated by space 51 text_t get_plain_query_terms(const text_t &querystring); 52 50 53 // search history tool 51 54 text_t escape_quotes(const text_t &querystring);
Note:
See TracChangeset
for help on using the changeset viewer.