#!/usr/bin/ruby require 'rubygems' require 'dbi' require 'cgi' require 'conf' db=$db order = "-" page="Blagues" subpage="Top 10" require 'header' puts header_bdg() cgi=$cgi if cgi['order'] == "worst" order = "+" subpage="Worst" end require 'menu' puts menu_bdg(page,subpage) puts <

#{subpage}

HTML_BDG i = 0 db.execute("SELECT * FROM blague").sort_by { |row| eval "#{order + "row" + '[5]'}" }.each { |row| unless i == 10 unless row[1] == "" if i.modulo(2) == 1 parity = " impair" else parity = "" end i += 1 puts <

\##{row[0]} - #{CGI::escapeHTML(row[1])} ( #{row[5]} / #{row[6]} )

#{CGI::escapeHTML(row[3]).gsub(/\r\n|\r|\n/,"
")}

posté par #{CGI::escapeHTML(row[2])} le #{row[4]}

HTML_BDG end end } require 'infos' puts infos_bdg() puts < HTML_BDG