anchor.diff:  	   (:ul :class "dropdown-menu dropdown-menu-form pull-right"
   		:role "menu"
   		(:label :type "checkbox"
  -			(:li "test")))))
  -
  -    (:threadtable *threads-query*))))
  +			(:li "test"))))))
  +
  +;;; page skeleton
  +(defparameter *header*
  +  '((:div :class "header banner"
  +     (:div :class "header text"
  +
  +      ;; logo and slogans
  +      (:span :class "hidden-xs"
  +	     (:a :href "/index"
  +		 (:img :class "header logo" :src "/img/ignorama.png"))
  +	     (:b :class "hidden-sm header slogan"
  +		 (echo (random-elt *slogans*))))
  +      (:span :class "visible-xs-inline"
  +	     (:a :href "/index"
  +		 (:img :class "header logo small" :src "/img/ignoramasmall.png")))
  +
  +      ;; right links
  +      (:div :class "hidden-xs header rightlinks"
  +	    (:sociallink twitter "https://twitter.com/IgnoramaDotNet")
  +	    (:sociallink github "https://github.com/tssund93/lispy-ignorama")
  +
  +	    (:rightlink "Following")
  +	    (:rightlink "Rules")
  +	    (:rightlink "Bans")
  +	    (:rightlink "Settings"))))))
  +
  +(define-html-macro :standard-page ((&key title) &body body)
  +  "The basic format that every page will follow."
  +  `(:html
  +    (:head (:title ,(concatenate 'string
  +				 title (if (equal title "")
  +					   ""
  +					   " - ")
  +				 *site-name*))
  +	   ,@*head*)
  +    (:body
  +     (:div :class "container"
  +	   ,@*header*
  +	   (:h2 ,title)
  +	   ,@body))))
  +
  +(defmacro publish-page (name &body body)
  +  `(progn
  +     (defun ,name (request entity)
  +       (with-http-response (request entity :content-type "text/html")
  +	 (with-http-body (request entity :external-format :utf8-base)
  +	   (with-html-output ((request-reply-stream request))
  +	     (html
  +	       ,@body)))))
  +     (publish :path ,(string-downcase
  +		      (concatenate 'string "/" (symbol-name name)))
  +	      :function ',name)))
  +
  +;;; web pages beyond here
  +(publish-page login
  +  (:standard-page
  +   (:title "Login")
  +   (:body
  +    (:form :method "POST" :action "/admin/verify"
  +	   (:input :name "username" :type "text")
  +	   (:br)
  +	   (:input :name "password" :type "password")
  +	   (:br)
  +	   (:input :name "Submit1" :type "submit" :value "Submit")
  +	   (:input :type "button"
  +		   :value "Main Page"
  +		   :onclick "window.location='../'")))))
  +
  +(publish-page index
  +  (:standard-page
  +   (:title "")
  +   (:body
  +    (:indexbuttons)
  +    (:indextable *threads-query*)
  +    (echo *fake-copyright*))))
   
   (publish-page unicode-test
     (:standard-page
  
positive.code: (let* ((q (prepare *db* "SET NAMES utf8")))
    (execute q))
  
  ;; utility functions
  (defun random-elt (choices)
    "Choose an element from a list at random."
    (elt choices (random (length choices))))
  
  ;; site setup
  (defparameter *site-name* "Ignorama")
  
negative.code:     "<a target='_blank' href='http://ignorama.net/rules.php'>Read the goddamn rules</a>"
      "Your hobbies are stupid"))
  
  (defparameter *fake-copyright* "
  <div style='text-align:center;font-size:9pt;'>
    <p>
      All trademarks and copyrights are owned by their respective parties.
      Comments and uploaded images are the responsibility of the poster.
    </p>
    <p>Copyright © 2014 Ignorama. All rights reserved.</p>
  </div>
  <br/>")
  
  (defparameter *resource-dirs* '("js/" "css/" "img/"))
  ;; publish css, js, img, etc.
  (loop for dir in *resource-dirs*
  