home *** CD-ROM | disk | FTP | other *** search
/ PC Online 1997 May / PCO_5_97.ISO / FilesBBS / OS2 / WWWCNT15.ARJ / WWWCNT15 / WWWCNT15.ZIP / testcount.sh < prev    next >
Encoding:
Linux/UNIX/POSIX Shell Script  |  1995-09-18  |  4.7 KB  |  116 lines

  1. #!/bin/sh
  2. ########
  3. # a program to test Count.cgi 1.5
  4. # by muquit@semcor.com
  5. # 09/17/95
  6. ##
  7. # if sh=0, then a 1x1 transparent GIF will be written, it will give a
  8. # illusion. so you can count access to a page but will not display any
  9. # counter, otherwise it should always be 1
  10. #
  11. QUERY_STRING="ft=9|frgb=69;139;50|tr=0|trgb=0;0;0|wxh=15;20|md=6|dd=A|st=5000|sh=1|df=count2.dat"
  12. export QUERY_STRING
  13.  
  14. ## below is the explanation for all the options
  15.  
  16. #####################
  17. #        ft=9
  18. #           ft means frame thickness. If you want to wrap the counter
  19. #           with a ornamental frame, you define the frame thickness 
  20. #           like this. Here 9 is the thickness of the frame in pixel.
  21. #           This value can be any positive number more than 1. For nice
  22. #           3D effect, use a number more than 5. If you do not want
  23. #           frame, just use ft=0.
  24. #        
  25. #        frgb=69;139;50
  26. #           frgb defines the color of the frame. Here 69 is the red 
  27. #           component, 139 is the green component and 50 is the blue
  28. #           component of the color. The valid range of each component
  29. #           is >=0 and <= 255. The components must be separated by ;
  30. #           character. Note even if you define ft=0, these components
  31. #           must be present, just use 0;0;0 in that case.
  32. #        
  33. #        tr=0
  34. #           tr defines if you want transparency in the counter image.
  35. #           here tr=0, that is I do not want transparent image. If you
  36. #           want transparent image, define tr=1. Note that Coun.cgi, 
  37. #           does not care if your digits are transparent GIFs or not.
  38. #           You must tell explicitly which color you want to make 
  39. #           transparent.
  40. #
  41. #        trgb=0;0;0
  42. #           if tr=1, then black color of the image will get transparent.
  43. #           Here 0;0;0 are the red, green and blue component of the color
  44. #           you want to make transparent.
  45. #        
  46. #        wxh=15;20
  47. #           wxh string defines the width and height of an individual 
  48. #           digit image. Each digits must have the same width and 
  49. #           height. If you like to use digits not supplied with my
  50. #           distribution, find out the width and height of the digits
  51. #           and specify them here.
  52. #
  53. #        md=6
  54. #           md defines the maximum number of digits to display. It can be
  55. #           >= 5 and <= 10. If your counter number is less than md, the
  56. #           left digits will be padded with zeros. Here md=6 means, display
  57. #           the counter with maximum 6 digits. f you do not want
  58. #           to left pad with zeros, use pad=0 instead of md=6.
  59. #           Note you can either use md=some_number of pad=0, in this
  60. #           field, you can not use both. If you use pad=0, then
  61. #           the digits will be displayed exactly without padding.
  62. #            
  63. #        dd=A
  64. #           dd means digit directory. A indicates, it will use my LED digits
  65. #           located at the directory A. The base of the directory A is defined
  66. #           with DigitDir at step 1.
  67. #
  68. #        st=5
  69. #           st means start, that is start the counter with this value. st is
  70. #           only significant if you compiled the program with 
  71. #           -DALLOW_FILE_CREATION. If you compiled with this option, the
  72. #           datafile will be created to the directory defined byDataDir
  73. #           in the config.h file and 5 will be written to it. 
  74. #           
  75. #        sh=1
  76. #           sh mean show. If sh=0, then no digit images will be displayed,
  77. #           however a transparent 1x1 transparent GIF image will be
  78. #           returned, which will give the illusion of nothing being displayed.
  79. #           Althouh it will seem that nothing is displayed, the counter will
  80. #           be incremented all right.
  81. #
  82. #        df=count.dat
  83. #           finally df means data file. This is the file which will contain the
  84. #           counter number. The base directory of this file is defined 
  85. #           with DataDir at step 1. This file must exist. To create this
  86. #           file, at the shell prompt do this:
  87. #
  88. #                echo 1 > count.dat
  89. #           
  90. #           or use a editor to create it. But this file must exist and
  91. #           writable by httpd.
  92. #############################
  93.  
  94. # play with authentication if you compiled with -DACCESS_AUTH
  95. # replace www.semcor.com
  96. #HTTP_REFERER="http://www.semcor.com/cgi-bin/Count.cgi?aaaa"
  97. #export HTTP_REFERER
  98.  
  99. # play with ignore host
  100. #
  101. #REMOTE_ADDR='192.160.166.1'
  102. #export REMOTE_ADDR
  103.  
  104. ###
  105. # if you have diplay from ImageMagick, try this
  106. # if you have xv, use xv instead of display
  107. ###
  108. Count.cgi -debug |display -
  109.  
  110. ##
  111. # or you can write the image to file and display with any image viewer
  112. # here digit image will be written to a file count.gif
  113. ##
  114. ##
  115. #Count.cgi -debug > count.gif
  116.