Changeset 2777

Show
Ignore:
Timestamp:
03/22/08 10:26:52 (10 months ago)
Author:
hans
Message:

Repair statistics handler

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/bknr/modules/stats/stats-handler.lisp

    r2430 r2777  
    3030                     (let ((errorstr (web-server-error-event-error event))) 
    3131                       (if (> (length errorstr) 25) 
    32                            (concatenate 'string (subseq errorstr 0 25) "...") 
     32                           (concatenate 'string (subseq* errorstr 0 25) "...") 
    3333                           errorstr)))))))))) 
    3434 
     
    100100           (:tr (:td) (:td (:princ-safe hit-name)) (:td "Percent") (:td (:princ-safe name))) 
    101101           (loop for i from 1 
    102                  for (thing . hits) in (subseq list 0 num) 
     102                 for (thing . hits) in (subseq* list 0 num) 
    103103                 for percent = (/ (round (* (/ hits total-hits) 100.0) 0.01) 100.0) 
    104104                 do (html (:tr (:td (:princ-safe i) ".") 
  • trunk/bknr/modules/stats/stats.lisp

    r1703 r2777  
    7272            (sort (remove nil (hash-to-list hour-hash) :key #'car) 
    7373                  #'< :key #'car) 
    74             (subseq (remove nil (hash-to-list url-hash) :key #'car) 0 20) 
    75             (subseq (remove nil (hash-to-list referer-hash) :key #'car) 0 20) 
    76             (subseq (remove nil (hash-to-list user-agent-hash) :key #'car) 0 20)))) 
     74            (subseq* (remove nil (hash-to-list url-hash) :key #'car) 0 20) 
     75            (subseq* (remove nil (hash-to-list referer-hash) :key #'car) 0 20) 
     76            (subseq* (remove nil (hash-to-list user-agent-hash) :key #'car) 0 20)))) 
    7777 
    7878(defun analyze-sessions (events) 
     
    8282                      #'(lambda (event) (ignore-errors (host-name (web-visitor-event-host event))))) 
    8383    (values session-sum 
    84             (subseq (hash-to-list user-hash) 0 20) 
    85             (subseq (hash-to-list host-hash) 0 20)))) 
     84            (subseq* (hash-to-list user-hash) 0 20) 
     85            (subseq* (hash-to-list host-hash) 0 20)))) 
    8686 
    8787(defun make-daily-stats (day month year &key remove-referer-hosts remove-urls delete-events) 
     
    137137                 (incf-hash (car elt) hash (cdr elt)))) 
    138138             (if count 
    139                (subseq (hash-to-list hash) 0 count) 
     139               (subseq* (hash-to-list hash) 0 count) 
    140140               (hash-to-list hash))))) 
    141141    (make-instance 'log-stats 
  • trunk/bknr/web/src/web/handlers.lisp

    r2720 r2777  
    315315  ((to :initarg :to :reader redirect-handler-to :documentation "url to redirect to"))) 
    316316 
     317(defmethod initialize-instance :after ((handler redirect-handler) &key to) 
     318  (assert (equal #\/ (aref to 0)) 
     319          () "path ~S provided as target to redirect-handler does not begin with a slash" 
     320          to)) 
     321 
    317322(defmethod handle ((page-handler redirect-handler)) 
    318323  (redirect (redirect-handler-to page-handler))) 
  • trunk/projects/lisp-ecoop/src/lisp-ecoop.asd

    r2559 r2777  
    1919  :depends-on (:bknr.datastore 
    2020               :bknr.web 
     21               :bknr.modules 
    2122               :closer-mop 
    2223               :cl-smtp 
  • trunk/projects/lisp-ecoop/src/webserver.lisp

    r2548 r2777  
    2323                                              ("http://bknr.net" . :bknr.web) 
    2424                                              ("http://bknr.net/menu" . :bknr.site-menu)) 
    25                  :handler-definitions `(user images 
    26                                         #+(or) stats 
     25                 :handler-definitions `(user 
     26                                        images 
     27                                        #+(or) stats 
    2728                                        #+(or) mailinglist 
    2829                                        #+(or) mailinglist-registration 
    2930                                        participants schedule 
    30                                         ("/" redirect-handler 
    31                                          :to "home") 
     31                                        ("/" redirect-handler :to "/home") 
    3232                                        ("/static" directory-handler 
    3333                                         :destination ,(probe-file (merge-pathnames #p"static/" *website-directory*))))