httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Rob Hartill <r...@imdb.com>
Subject Re: Using Tables for indices
Date Wed, 04 Dec 1996 17:04:37 GMT

Hi,

I'll pass your patch/suggestion on to the developers to see if it interests
someone enough to see that it gets into a future release.

cheers,
rob

Ben Yoshino wrote:
>
>Hello Apache developers,
>
>I have attached a patch file with something I cooked up experimenting with
>tables. Please feel free to experiment with it and notify me if I've made any
>think-o's in the code.
>
>This patch adds "TableIndexing" as a new IndexOption.
>
>Sincerly,
>
>Ben.
>-- 
>Ben Y. Yoshino            <<{ Computer Facility, College of Engineering
>2540 Dole St. Holmes 240J }>> Univ. of Hawaii at Manoa; Educational Specialist
>Honolulu, Hawaii  96822   <<{ Email: ben@wiliki.eng.hawaii.edu
>Phone: (808) 956-6910     }>> <URL:http://www.eng.hawaii.edu/~ben/>
>
>#* mod_dir.tablepatch *
>#*** Cut here *********
>
>*** mod_dir.c.orig	Thu Oct 17 12:18:51 1996
>--- mod_dir.c	Fri Oct 18 10:51:30 1996
>***************
>*** 83,88 ****
>--- 83,89 ----
>  #define SUPPRESS_LAST_MOD 8
>  #define SUPPRESS_SIZE 16
>  #define SUPPRESS_DESC 32
>+ #define TABLE_INDEXING 64
>  
>  struct item {
>      char *type;
>***************
>*** 205,210 ****
>--- 206,213 ----
>              opts |= SUPPRESS_SIZE;
>          else if(!strcasecmp(w,"SuppressDescription"))
>              opts |= SUPPRESS_DESC;
>+ 	else if(!strcasecmp(w,"TableIndexing"))
>+ 	    opts |= TABLE_INDEXING;
>          else if(!strcasecmp(w,"None"))
>              opts = 0;
>  	else
>***************
>*** 574,590 ****
>      if(name[0] == '\0') name = "/";
>  
>      if(dir_opts & FANCY_INDEXING) {
>          rputs("<PRE>", r);
>          if((tp = find_default_icon(d,"^^BLANKICON^^")))
>              rvputs(r, "<IMG SRC=\"", escape_html(scratch, tp),
>  		   "\" ALT=\"     \"> ", NULL);
>          rputs("Name                   ", r);
>!         if(!(dir_opts & SUPPRESS_LAST_MOD))
>              rputs("Last modified     ", r);
>!         if(!(dir_opts & SUPPRESS_SIZE))
>              rputs("Size  ", r);
>          if(!(dir_opts & SUPPRESS_DESC))
>              rputs("Description", r);
>          rputs("\n<HR>\n", r);
>      }
>      else {
>--- 577,606 ----
>      if(name[0] == '\0') name = "/";
>  
>      if(dir_opts & FANCY_INDEXING) {
>+ 	if (dir_opts & TABLE_INDEXING) {
>+ 	    rputs("<TABLE BORDER=1 ALIGN=\"CENTER\" WIDTH=\"100%%\">\n", r);
>+ 	    rputs("<TR ALIGN=\"CENTER\" VALIGN=\"BASELINE\">", r);
>+ 	    rputs("<TH>", r);
>+ 	} else
>  	    rputs("<PRE>", r);
>          if((tp = find_default_icon(d,"^^BLANKICON^^")))
>              rvputs(r, "<IMG SRC=\"", escape_html(scratch, tp),
>  		   "\" ALT=\"     \"> ", NULL);
>          rputs("Name                   ", r);
>!         if(!(dir_opts & SUPPRESS_LAST_MOD)) {
>! 	    if(dir_opts & TABLE_INDEXING) rputs("<TH>", r);
>              rputs("Last modified     ", r);
>! 	}
>!         if(!(dir_opts & SUPPRESS_SIZE)) {
>! 	    if(dir_opts & TABLE_INDEXING) rputs("<TH>", r);
>              rputs("Size  ", r);
>+ 	}
>          if(!(dir_opts & SUPPRESS_DESC))
>+ 	    if(dir_opts & TABLE_INDEXING) rputs("<TH>", r);
>              rputs("Description", r);
>+ 	if(dir_opts & TABLE_INDEXING)
>+ 	    rputs("<BR>\n", r);
>+ 	else
>  	    rputs("\n<HR>\n", r);
>      }
>      else {
>***************
>*** 596,601 ****
>--- 612,619 ----
>  
>  	clear_pool (scratch);
>  
>+ 	if(dir_opts & TABLE_INDEXING)
>+ 	    rputs("<TR ALIGN=\"CENTER\" VALIGN=\"BASELINE\">", r);
>          if((!strcmp(ar[x]->name,"../")) || (!strcmp(ar[x]->name,".."))) {
>              char *t = make_full_path (scratch, name, "../");
>              getparents(t);
>***************
>*** 628,633 ****
>--- 646,652 ----
>          }
>  
>          if(dir_opts & FANCY_INDEXING) {
>+ 	    if(dir_opts & TABLE_INDEXING) rputs("<TD ALIGN=\"LEFT\">", r);
>              if(dir_opts & ICONS_ARE_LINKS)
>                  rputs(anchor, r);
>              if((ar[x]->icon) || d->default_icon) {
>***************
>*** 639,647 ****
>              }
>              if(dir_opts & ICONS_ARE_LINKS) 
>                  rputs("</A>", r);
>! 
>              rvputs(r," ", anchor, t2, NULL);
>              if(!(dir_opts & SUPPRESS_LAST_MOD)) {
>                  if(ar[x]->lm != -1) {
>  		    char time[MAX_STRING_LEN];
>                      struct tm *ts = localtime(&ar[x]->lm);
>--- 658,674 ----
>              }
>              if(dir_opts & ICONS_ARE_LINKS)
>                  rputs("</A>", r);
>! 	    if(dir_opts & TABLE_INDEXING) {
>! 		char *t3;
>! 		if (t == NULL)
>! 		    t3 = t2;
>! 		else
>! 		    t3 = pstrcat(scratch, t, "</A>", NULL);
>! 		rvputs(r," ", anchor, t3, NULL);
>! 	    } else
>  		rvputs(r," ", anchor, t2, NULL);
>              if(!(dir_opts & SUPPRESS_LAST_MOD)) {
>+ 		if(dir_opts & TABLE_INDEXING) rputs(" <TD>", r);
>                  if(ar[x]->lm != -1) {
>  		    char time[MAX_STRING_LEN];
>                      struct tm *ts = localtime(&ar[x]->lm);
>***************
>*** 650,672 ****
>                  }
>                  else {
>                      rputs("                 ", r);
>                  }
>              }
>              if(!(dir_opts & SUPPRESS_SIZE)) {
>                  send_size(ar[x]->size,r);
>                  rputs("  ", r);
>              }
>              if(!(dir_opts & SUPPRESS_DESC)) {
>                  if(ar[x]->desc) {
>!                     rputs(terminate_description(d, ar[x]->desc, dir_opts), r);
>                  }
>              }
>-         }
>          else
>              rvputs(r, "<LI> ", anchor," ", t2, NULL);
>          rputc('\n', r);
>      }
>      if(dir_opts & FANCY_INDEXING) {
>          rputs("</PRE>", r);
>      }
>      else {
>--- 677,711 ----
>                  }
>                  else {
>                      rputs("                 ", r);
>+ 		    if (dir_opts & TABLE_INDEXING) rputs("&nbsp;", r);
>                  }
>              }
>              if(!(dir_opts & SUPPRESS_SIZE)) {
>+ 		if(dir_opts & TABLE_INDEXING) rputs(" <TD>", r);
>                  send_size(ar[x]->size,r);
>                  rputs("  ", r);
>              }
>              if(!(dir_opts & SUPPRESS_DESC)) {
>+ 		if(dir_opts & TABLE_INDEXING) rputs(" <TD ALIGN=\"LEFT\">", r);
>                  if(ar[x]->desc) {
>! 		    if (dir_opts & TABLE_INDEXING)
>! 			rputs(ar[x]->desc, r);
>! 		    else
>! 			rputs(terminate_description(d, ar[x]->desc, dir_opts),
>! 			      r);
>! 		} else if (dir_opts & TABLE_INDEXING)
>! 		    rputs("&nbsp;", r);
>              }
>+ 	    if(dir_opts & TABLE_INDEXING) rputs("<BR>", r);
>          }
>          else
>              rvputs(r, "<LI> ", anchor," ", t2, NULL);
>          rputc('\n', r);
>      }
>      if(dir_opts & FANCY_INDEXING) {
>+ 	if (dir_opts & TABLE_INDEXING)
>+ 	    rputs("</TABLE>", r);
>+ 	else
>  	    rputs("</PRE>", r);
>      }
>      else {
>
>


-- 
Rob Hartill.       Internet Movie Database Ltd.    http://www.imdb.com/  

Mime
View raw message