Changeset 7902 for platform/tdiary
- Timestamp:
- 03/13/08 19:58:50 (5 years ago)
- Location:
- platform/tdiary/plugin
- Files:
-
- 3 modified
-
google_sitemaps.rb (modified) (4 diffs)
-
ja/google_sitemaps.rb (modified) (1 diff)
-
jholiday.rb (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
platform/tdiary/plugin/google_sitemaps.rb
r7897 r7902 8 8 headers = Array.new 9 9 header = Hash.new 10 10 11 11 Dir.glob(@conf.data_path + '/????/*.td2') { |data_file| 12 12 File.open(data_file) { |buffer| … … 19 19 header.clear 20 20 end 21 if %r|^Date: ([0-9]+)$| =~ line then21 if %r|^Date: ([0-9]+)$|i =~ line then 22 22 header['loc'] = sprintf(@conf['google_sitemaps.uri_format'], $1) 23 23 end 24 if %r|^Last \-Modified: ([0-9]+)$|=~ line then24 if %r|^Last-Modified: ([0-9]+)$|i =~ line then 25 25 header['lastmod'] = Time.at($1.to_i).iso8601 26 26 end 27 if %r|^Visible: (.+)$| =~ line then27 if %r|^Visible: (.+)$|i =~ line then 28 28 if $1.upcase == "TRUE" then 29 29 header['visible'] = true … … 35 35 } 36 36 } 37 37 38 38 headers.sort! { |a, b| b['loc'] <=> a['loc']} 39 39 … … 42 42 43 43 File.open(@conf['google_sitemaps.output_file'], 'w') do |fp| 44 fp.write %Q[<?xml version="1.0" encoding="UTF-8"?>\n]45 fp.write %Q[<urlset xmlns="http://www.google.com/schemas/sitemap/0.84">\n]46 fp.write %Q[ <url><loc>#{CGI::escapeHTML(top_page_uri)}</loc><lastmod>#{now_datetime}</lastmod></url>\n]47 headers.each { |entry|48 fp.write %Q[<url><loc>#{CGI::escapeHTML(entry['loc'])}</loc><lastmod>#{entry['lastmod']}</lastmod></url>\n]49 }50 fp.write %Q[</urlset>\n]44 fp.write %Q[<?xml version="1.0" encoding="UTF-8"?>\n] 45 fp.write %Q[<urlset xmlns="http://www.google.com/schemas/sitemap/0.84">\n] 46 fp.write %Q[ <url><loc>#{CGI::escapeHTML(top_page_uri)}</loc><lastmod>#{now_datetime}</lastmod></url>\n] 47 headers.each { |entry| 48 fp.write %Q[ <url><loc>#{CGI::escapeHTML(entry['loc'])}</loc><lastmod>#{entry['lastmod']}</lastmod></url>\n] 49 } 50 fp.write %Q[</urlset>\n] 51 51 end 52 52 end -
platform/tdiary/plugin/ja/google_sitemaps.rb
r7897 r7902 15 15 16 16 if File.writable_real?(@conf['google_sitemaps.output_file']) == false 17 msg = "<strong>[NG] 指定されているファイル には書き込み権限がありません。</strong>"17 msg = "<strong>[NG] 指定されているファイルの書き込み権限がありません。</strong>" 18 18 else 19 msg = "[OK] 指定されているファイル には書き込み権限があります。"19 msg = "[OK] 指定されているファイルの書き込み権限があります。" 20 20 end 21 21 22 22 <<-HTML 23 <p>Google sitemap用のXMLを出力する設定を行います。</p>23 <p>Google ウェブマスターツール用のSitemap XMLを出力する設定を行います。</p> 24 24 <h3 class="subtitle">アドレスフォーマット</h3> 25 25 <p>日付別表示時のURLフォーマットを指定します。日付文字列の部分は<strong>%s</strong>にしてください。</p> 26 26 <p><input type="text" name="google_sitemaps.uri_format" value="#{ CGI::escapeHTML(@conf['google_sitemaps.uri_format']) }" size="50"></p> 27 <div class="section">e x.<br />http://www.example.com/inex.cgi?date=<strong>%s</strong><br />http://www.example.com/<strong>%s</strong>.html</div>27 <div class="section">eg.<br />http://www.example.com/inex.cgi?date=<strong>%s</strong><br />http://www.example.com/<strong>%s</strong>.html</div> 28 28 29 29 <h3 class="subtitle">XMLファイルの出力先</h3> -
platform/tdiary/plugin/jholiday.rb
r7898 r7902 1 1 require 'Calendar.rb' 2 2 require 'date' 3 unless Time::new.respond_to?( :strftime_holiday_backup ) 3 unless Time::new.respond_to?( :strftime_holiday_backup ) 4 4 then 5 5 eval( <<-MODIFY_CLASS, TOPLEVEL_BINDING )
![(please configure the [header_logo] section in trac.ini)](/share/chrome/site/your_project_logo.png)