home *** CD-ROM | disk | FTP | other *** search
/ linuxmafia.com 2016 / linuxmafia.com.tar / linuxmafia.com / pub / skeptic / bibliography / categories.cgi < prev    next >
Text File  |  2009-08-26  |  2KB  |  65 lines

  1. #!/usr/bin/perl
  2.  
  3. # $rcs = ' $Id: categories.cgi,v 1.3 1998/06/20 03:54:24 fitz Exp $ ' ;
  4.  
  5. unshift(@INC, "lib");
  6.  
  7. require 'bib.pl';
  8. require 'web.pl';
  9. require 'cgi-lib.pl';
  10.  
  11.  
  12. &ReadParse; # Read the script input
  13. print "Content-type: text/html\n";
  14.  
  15. &bib::load("CATEGORY", "KEYWORDS");
  16.  
  17. # Get the categories and descriptions
  18. %categories = &bib::read_category_desc();
  19.  
  20. # Get the keywords
  21. %keywords = &bib::read_keyword_desc();
  22.  
  23. # Get the keyword modifiers
  24. %modifiers = &bib::read_modifier_desc();
  25.  
  26. # Tables for the categories, keywords, and modifiers
  27. foreach $category (sort { uc($a) cmp uc($b) } keys %categories)
  28. {
  29.     #$category =~ s/\W//g;
  30.     $categories .=
  31.       sprintf("<TR><TH ALIGN=left>%s</TH><TD>%s</TD></TR>\n",
  32.               &untaint($category), &untaint($categories{$category}))
  33.         if $categories{$category};
  34. }
  35. foreach $keyword (sort  { uc($a) cmp uc($b) } keys %keywords)
  36. {
  37.     #$keyword =~ s/\W//g;
  38.     $keywords .=
  39.       sprintf("<TR><TH ALIGN=left>%s</TH><TD>%s</TD></TR>\n",
  40.               &untaint($keyword), &untaint($keywords{$keyword}))
  41.         if $keywords{$keyword};
  42. }
  43. foreach $modifier (sort { uc($a) cmp uc($b) } keys %modifiers)
  44. {
  45.     #$modifier =~ s/\W//g;
  46.     $modifiers .=
  47.       sprintf("<TR><TH ALIGN=left>%s</TH><TD>%s</TD></TR>\n",
  48.               &untaint($modifier), &untaint($modifiers{$modifier}))
  49.         if $modifiers{$modifier};
  50. }
  51.  
  52. $data = &bib::template("categories.html",
  53.                        "CATEGORIES", $categories,
  54.                        "KEYWORDS", $keywords,
  55.                        "MODIFIERS", $modifiers,);
  56.  
  57. $data = &bib::template("categories-display.html",
  58.                        "DATA", $data,);
  59.  
  60. print "\n", &bib::template("basic.html",
  61.                            "TITLE", "Keyword Descriptions",
  62.                            "DATA", $data,);
  63.  
  64. exit 0;
  65.