Changeset 1629


Ignore:
Timestamp:
2000-10-30T15:12:18+13:00 (24 years ago)
Author:
paynter
Message:

Changed handling of cgi arguments so that a "0" now means return no
expansions/documents instead of returning them all.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/gsdl/src/phind/host/phindcgi.cpp

    r1619 r1629  
    33 * phindcgi.cpp -- cgi program to serve phind phrase hierarchies
    44 *
    5  * Copyright 2000 Gordon Paynter
     5 * Copyright 2000 Gordon W. Paynter
    66 * Copyright 2000 The New Zealand Digital Library Project
    77 *
     
    175175     << "<phinddata id=\"" << phrase
    176176     << "\" text=\"" << word
     177     << "\" tf=\"" << tf
    177178     << "\" df=\"" << df
    178179     << "\" ef=\"" << ef
     
    188189 
    189190  // Output the expansions
    190   if (ef > 0) {
     191  if ((ef > 0) && (first_e < last_e)) {
    191192
    192193    // figure out the number of phrases to output
    193     if (last_e < 1 || last_e > el.size()) {
     194    if (last_e > el.size()) {
    194195      last_e = el.size();
    195196    }
     
    229230         << "<br><a href='" << argv[0]
    230231         << "?c=" << collection << "&n=" << phrase
    231          << "&e=0&d=" << last_d
     232         << "&e=" << el.size() << "&d=" << last_d
    232233         << "&g=" << first_e << "&f=" << first_d
    233234         << "'>Get every phrase</a>"
     
    238239
    239240  // Output the document occurances
    240   if (df > 0) {
     241  if ((df > 0) && (first_d < last_d)) {
    241242
    242243    // figure out the phrases to output
    243     if (last_d < 1 || last_d > docNums.size()) {
     244    if (last_d > docNums.size()) {
    244245      last_d = docNums.size();
    245246    }
     
    280281         << "<br><a href='" << argv[0]
    281282         << "?c=" << collection << "&n=" << phrase
     283         << "&g=" << first_e
    282284         << "&e=" << last_e
    283          << "&g=" << first_e << "&f=" << first_d
    284          << "&d=0'>Get every document</a>" << endl;
     285         << "&f=" << first_d
     286         << "&d=" << docNums.size()
     287         << "'>Get every document</a>" << endl;
    285288      }
    286289    }
Note: See TracChangeset for help on using the changeset viewer.