<% ERuby.charset = "Shift_JIS" require "mysql" require "cgi-lib" require "kconv" require "date" require ENV['PATH_TRANSLATED'].sub("[^$/]*$","MyMySQL.rb") input = CGI.new db = MyMySQL.new() %>

検索結果の表示
<% if db.connect("harley.k.shizuokanet.ne.jp","user_link","sinet","col0009") == nil then print "只今データベースのメンテナンス中のため、結果を表示できません。
" else if "#{input["genre"]}" == "0" then strCond = "CONCAT(title,subtitle,keywords) like '%" + Kconv.kconv(input["keyword"].gsub('\"','\\\"'), Kconv::EUC, Kconv::SJIS) + "%'" else strCond = "genre | #{input['genre']} = genre" end tRecords = db.selectRecord( "user_link", ["url","title","subtitle","date","server"], strCond + " order by server, date desc, id desc;") tRecords.each do |i| tStr = i["date"].split("-") if Date::today() - Date::new(tStr[0].to_i, tStr[1].to_i, tStr[2].to_i) <= 30 then %> <% else %> <% end if "#{i['server']}" == "2" then print "" end %> "><%= Kconv.kconv(i["title"],Kconv::SJIS, Kconv::EUC) %>:<%= Kconv.kconv(i["subtitle"],Kconv::SJIS, Kconv::EUC) %>

<% if "#{i['server']}" == "2" then print "
" end end db.close() end %>