From: SHIBATA H. <nul...@cl...> - 2013-02-17 00:23:18
|
SHIBATA Hiroshi 2013-02-17 09:15:33 +0900 (Sun, 17 Feb 2013) New Revision: db8709dae01d76e55c674ed5818f0bdd9c674d80 https://github.com/tdiary/tdiary-core/commit/db8709dae01d76e55c674ed5818f0bdd9c674d80 Log: remove @conf.base_url from plugin and filters Modified files: misc/filter/antispamservice.rb misc/filter/linkcheck.rb misc/filter/plugin/antispamservice.rb misc/plugin/calendar2.rb misc/plugin/image.rb misc/plugin/makelirs.rb misc/plugin/makerss.rb misc/plugin/my-ex.rb misc/plugin/pb-show.rb misc/plugin/ping.rb misc/plugin/tb-show.rb misc/plugin/tlink.rb misc/plugin/xmlrpc.rb misc/plugin/xmlrpc/xmlrpc.rb plugin/00default.rb plugin/90migrate.rb plugin/en/00default.rb plugin/ja/00default.rb tdiary/filter.rb Modified: misc/filter/antispamservice.rb (+1 -1) =================================================================== --- misc/filter/antispamservice.rb 2013-02-17 08:58:21 +0900 (90098c3) +++ misc/filter/antispamservice.rb 2013-02-17 09:15:33 +0900 (ac18d48) @@ -36,7 +36,7 @@ module TDiary::Filter return true unless (key || '' ).length > 0 blog = @conf.index.dup - blog[0, 0] = @conf.base_url unless %r|^https?://|i =~ blog + blog[0, 0] = base_url unless %r|^https?://|i =~ blog blog.gsub!( %r|/\./|, '/' ) permalink = "#{blog}?date=#{diary.date.strftime('%Y%m%d')}" Modified: misc/filter/linkcheck.rb (+1 -1) =================================================================== --- misc/filter/linkcheck.rb 2013-02-17 08:58:21 +0900 (7bbf634) +++ misc/filter/linkcheck.rb 2013-02-17 09:15:33 +0900 (b8b1928) @@ -32,7 +32,7 @@ module TDiary::Filter return true unless comment.name == 'TrackBack' dest_uri = @conf.index.dup - dest_uri[0, 0] = @conf.base_url if %r|^https?://|i !~ @conf.index + dest_uri[0, 0] = base_url if %r|^https?://|i !~ @conf.index dest_uri.gsub!( %r|/\./|, '/' ) # TrackBack URI is the 1st line of comment.body. Modified: misc/filter/plugin/antispamservice.rb (+1 -1) =================================================================== --- misc/filter/plugin/antispamservice.rb 2013-02-17 08:58:21 +0900 (038ba3b) +++ misc/filter/plugin/antispamservice.rb 2013-02-17 09:15:33 +0900 (cb50e03) @@ -60,7 +60,7 @@ end def antispam_verify_key?( host, key ) uri = URI::parse( "http://#{@antispam_service_list[host]}/1.1/verify-key") blog = @conf.index.dup - blog[0, 0] = @conf.base_url unless %r|^https?://|i =~ blog + blog[0, 0] = base_url unless %r|^https?://|i =~ blog blog.gsub!( %r|/\./|, '/' ) data = "key=#{key}&blog=#{blog}" header = { Modified: misc/plugin/calendar2.rb (+1 -1) =================================================================== --- misc/plugin/calendar2.rb 2013-02-17 08:58:21 +0900 (87b2de9) +++ misc/plugin/calendar2.rb 2013-02-17 09:15:33 +0900 (ab82d0c) @@ -25,7 +25,7 @@ # @calendar2_image_dir = @options && @options['image.dir'] || './images/' @calendar2_image_dir.chop! if /\/$/ =~ @calendar2_image_dir -@calendar2_image_url = @options && @options['image.url'] || "#{@conf.base_url}images/" +@calendar2_image_url = @options && @options['image.url'] || "#{base_url}images/" @calendar2_image_url.chop! if /\/$/ =~ @calendar2_image_url @calendar2_imageex_yearlydir = @options && @options['image_ex.yearlydir'] || 0 @calendar2_show_image = @options && @options['calendar2.show_image'] || false Modified: misc/plugin/image.rb (+1 -1) =================================================================== --- misc/plugin/image.rb 2013-02-17 08:58:21 +0900 (55418bf) +++ misc/plugin/image.rb 2013-02-17 09:15:33 +0900 (ef8d941) @@ -124,7 +124,7 @@ end # @image_dir = @options && @options['image.dir'] || './images/' @image_dir.chop! if /\/$/ =~ @image_dir -@image_url = @options && @options['image.url'] || "#{@conf.base_url}images/" +@image_url = @options && @options['image.url'] || "#{base_url}images/" @image_url.chop! if /\/$/ =~ @image_url @image_maxwidth = @options && @options['image.maxwidth'] || nil Modified: misc/plugin/makelirs.rb (+1 -1) =================================================================== --- misc/plugin/makelirs.rb 2013-02-17 08:58:21 +0900 (51385b4) +++ misc/plugin/makelirs.rb 2013-02-17 09:15:33 +0900 (b4040d3) @@ -67,7 +67,7 @@ add_update_proc do utc_offset = now.utc_offset uri = @index.dup - uri[0, 0] = @conf.base_url if %r|^https?://|i !~ @index + uri[0, 0] = base_url if %r|^https?://|i !~ @index uri.gsub!( %r|/\./|, '/' ) lirs = "LIRS,#{t.last_modified.tv_sec},#{Time.now.tv_sec},#{utc_offset},#{body.size},#{e[uri]},#{e[@html_title]},#{e[@author_name]},,\n" Modified: misc/plugin/makerss.rb (+21 -13) =================================================================== --- misc/plugin/makerss.rb 2013-02-17 08:58:21 +0900 (8615207) +++ misc/plugin/makerss.rb 2013-02-17 09:15:33 +0900 (b3b515b) @@ -62,8 +62,8 @@ end class MakeRssFull include ERB::Util - def initialize( conf ) - @conf = conf + def initialize(conf, cgi = CGI.new) + @conf, @cgi = conf, cgi @item_num = 0 end @@ -131,14 +131,22 @@ class MakeRssFull end end + def base_url + if @conf.options['base_url'] && @conf.options['base_url'].length > 0 + @conf.options['base_url'] + else + @cgi.base_url + end + end + def url - u = @conf['makerss.url'] || "#{@conf.base_url}#{File.basename(file)}" - u = "#{@conf.base_url}#{File.basename(file)}" if u.empty? + u = @conf['makerss.url'] || "#{base_url}#{File.basename(file)}" + u = "#{base_url}#{File.basename(file)}" if u.empty? u end end -@makerss_rsses << MakeRssFull::new( @conf ) +@makerss_rsses << MakeRssFull::new(@conf, @cgi) class MakeRssNoComments < MakeRssFull def title @@ -163,20 +171,20 @@ class MakeRssNoComments < MakeRssFull def url return nil unless @conf['makerss.no_comments'] - u = @conf['makerss.no_comments.url'] || "#{@conf.base_url}#{File.basename(file)}" - u = "#{@conf.base_url}#{File.basename(file)}" if u.empty? + u = @conf['makerss.no_comments.url'] || "#{base_url}#{File.basename(file)}" + u = "#{base_url}#{File.basename(file)}" if u.empty? u end end -@makerss_rsses << MakeRssNoComments::new( @conf ) +@makerss_rsses << MakeRssNoComments::new(@conf, @cgi) def makerss_update date = @date.strftime( "%Y%m%d" ) diary = @diaries[date] uri = @conf.index.dup - uri[0, 0] = @conf.base_url if %r|^https?://|i !~ @conf.index + uri[0, 0] = base_url if %r|^https?://|i !~ @conf.index uri.gsub!( %r|/\./|, '/' ) require 'pstore' @@ -256,7 +264,7 @@ def makerss_update if /^http/ =~ @conf.banner rdf_image = @conf.banner else - rdf_image = @conf.base_url + @conf.banner + rdf_image = base_url + @conf.banner end rsses.each {|r| r.image( %Q[<image rdf:resource="#{h rdf_image}" />\n] ) } end @@ -269,8 +277,8 @@ def makerss_update end def makerss_header( uri ) - rdf_url = @conf['makerss.url'] || "#{@conf.base_url}index.rdf" - rdf_url = "#{@conf.base_url}index.rdf" if rdf_url.empty? + rdf_url = @conf['makerss.url'] || "#{base_url}index.rdf" + rdf_url = "#{base_url}index.rdf" if rdf_url.empty? desc = @conf.description || '' @@ -362,7 +370,7 @@ def makerss_body( uri, rdfsec ) text << body_leave unless text.empty? uri = @conf.index.dup - uri[0, 0] = @conf.base_url unless %r|^https?://|i =~ uri + uri[0, 0] = base_url unless %r|^https?://|i =~ uri uri.gsub!( %r|/\./|, '/' ) text = absolutify( text, uri ) text.gsub!( /\]\]>/, ']]]]><![CDATA[>' ) Modified: misc/plugin/my-ex.rb (+1 -1) =================================================================== --- misc/plugin/my-ex.rb 2013-02-17 08:58:21 +0900 (5878b83) +++ misc/plugin/my-ex.rb 2013-02-17 09:15:33 +0900 (00d524f) @@ -49,7 +49,7 @@ def my( a, str, title = nil ) end end end - index = /^https?:/ =~ @index ? '' : @conf.base_url + index = /^https?:/ =~ @index ? '' : base_url index += @index.sub(%r|^\./|, '') if title then %Q[<a href="#{h index}#{anchor anc}" title="#{title}">#{str}</a>] Modified: misc/plugin/pb-show.rb (+2 -2) =================================================================== --- misc/plugin/pb-show.rb 2013-02-17 08:58:21 +0900 (e4e348d) +++ misc/plugin/pb-show.rb 2013-02-17 09:15:33 +0900 (68b52db) @@ -138,9 +138,9 @@ add_body_enter_proc do |date| cgi = File.basename(@options['pb.cgi'] || './pb.rb') @pb_date = date @pb_id_url = %Q|#{h @index}#{anchor( @pb_date.strftime('%Y%m%d') )}| - @pb_id_url[0, 0] = @conf.base_url if %r|^https?://|i !~ @conf.index + @pb_id_url[0, 0] = base_url if %r|^https?://|i !~ @conf.index @pb_id_url.gsub!( %r|/\./|, '/' ) - @pb_url = %Q|#{h @conf.base_url}#{cgi}/#{@pb_date.strftime('%Y%m%d')}| + @pb_url = %Q|#{h base_url}#{cgi}/#{@pb_date.strftime('%Y%m%d')}| '' end Modified: misc/plugin/ping.rb (+1 -1) =================================================================== --- misc/plugin/ping.rb 2013-02-17 08:58:21 +0900 (8779ff1) +++ misc/plugin/ping.rb 2013-02-17 09:15:33 +0900 (cebe309) @@ -26,7 +26,7 @@ def ping( list ) <value>#{@conf.html_title}</value> </param> <param> - <value>#{@conf.base_url}</value> + <value>#{base_url}</value> </param> </params> </methodCall> Modified: misc/plugin/tb-show.rb (+2 -2) =================================================================== --- misc/plugin/tb-show.rb 2013-02-17 08:58:21 +0900 (71a6b48) +++ misc/plugin/tb-show.rb 2013-02-17 09:15:33 +0900 (7102640) @@ -37,9 +37,9 @@ add_body_enter_proc do |date| cgi = File.basename(@options['tb.cgi'] || './tb.rb') @tb_date = date @tb_id_url = %Q|#{@index}#{anchor( @tb_date.strftime('%Y%m%d') )}| - @tb_id_url[0, 0] = @conf.base_url if %r|^https?://|i !~ @conf.index + @tb_id_url[0, 0] = base_url if %r|^https?://|i !~ @conf.index @tb_id_url.gsub!( %r|/\./|, '/' ) - @tb_url = %Q|#{@conf.base_url}#{cgi}/#{@tb_date.strftime('%Y%m%d')}| + @tb_url = %Q|#{base_url}#{cgi}/#{@tb_date.strftime('%Y%m%d')}| '' end Modified: misc/plugin/tlink.rb (+1 -1) =================================================================== --- misc/plugin/tlink.rb 2013-02-17 08:58:21 +0900 (d0fd29c) +++ misc/plugin/tlink.rb 2013-02-17 09:15:33 +0900 (49f0fd4) @@ -96,7 +96,7 @@ end def tlink_getcomment( url ) result = "" - ref = @conf.base_url + ref = base_url agent = { "User-Agent" => "DoCoMo (compatible; tDiary plugin; tlink; #{ref})" } host, path, frag = url.scan( %r[http://(.*?)/(.*)#((?:p|c)\d\d)] )[0] if /p0/ =~ frag Modified: misc/plugin/xmlrpc.rb (+3 -3) =================================================================== --- misc/plugin/xmlrpc.rb 2013-02-17 08:58:21 +0900 (b0c4f33) +++ misc/plugin/xmlrpc.rb 2013-02-17 09:15:33 +0900 (9d39763) @@ -7,7 +7,7 @@ # add_header_proc do - %Q!\t<link rel="EditURI" type="application/rsd+xml" title="RSD" href="#{h @conf.base_url}rsd.xml" />\n! + %Q!\t<link rel="EditURI" type="application/rsd+xml" title="RSD" href="#{h base_url}rsd.xml" />\n! end add_conf_proc('XMLRPC', 'XML-RPC API') do @@ -36,7 +36,7 @@ end # for conf_proc # def xmlrpc_init - @conf['xmlrpc.url'] ||= @conf.base_url + 'xmlrpc.rb' + @conf['xmlrpc.url'] ||= base_url + 'xmlrpc.rb' @conf['xmlrpc.blogid'] ||= 'devlog' @conf['xmlrpc.username'] ||= 'default' @conf['xmlrpc.password'] ||= '' @@ -60,7 +60,7 @@ def saveconf_xmlrpc <service> <engineName>tDiary</engineName> <engineLink>http://www.tdiary.org/</engineLink> - <homePageLink>#{h @conf.base_url}</homePageLink> + <homePageLink>#{h base_url}</homePageLink> <apis> <api name="MetaWeblog" preferred="true" apiLink="#{h @conf['xmlrpc.url']}" blogID="#{h @conf['xmlrpc.blogid']}"/> <api name="Blogger" preferred="false" apiLink="#{h @conf['xmlrpc.url']}" blogID="#{h @conf['xmlrpc.blogid']}"/> Modified: misc/plugin/xmlrpc/xmlrpc.rb (+11 -11) =================================================================== --- misc/plugin/xmlrpc/xmlrpc.rb 2013-02-17 08:58:21 +0900 (6749f43) +++ misc/plugin/xmlrpc/xmlrpc.rb 2013-02-17 09:15:33 +0900 (8dab4c2) @@ -29,7 +29,7 @@ server.add_handler('blogger.newPost') do |appkey, blogid, username, password, co @cgi = CGI::new conf = ::TDiary::Config::new(@cgi) ENV['REQUEST_METHOD'] = 'POST' - ENV['HTTP_REFERER'] = (URI.parse(conf.base_url) + conf.update).to_s + ENV['HTTP_REFERER'] = (URI.parse(base_url) + conf.update).to_s if username==conf['xmlrpc.username'] && password==conf['xmlrpc.password'] begin postid = Time.now.strftime("%Y%m%d") @@ -67,7 +67,7 @@ server.add_handler('blogger.editPost') do |appkey, postid, username, password, c @cgi = CGI::new conf = ::TDiary::Config::new(@cgi) ENV['REQUEST_METHOD'] = 'POST' - ENV['HTTP_REFERER'] = (URI.parse(conf.base_url) + conf.update).to_s + ENV['HTTP_REFERER'] = (URI.parse(base_url) + conf.update).to_s unless username==conf['xmlrpc.username'] && password==conf['xmlrpc.password'] raise XMLRPC::FaultException.new(1,'userid or password incorrect') end @@ -114,7 +114,7 @@ server.add_handler('blogger.deletePost') do |appkey, postid, username, password| @cgi = CGI::new conf = ::TDiary::Config::new(@cgi) ENV['REQUEST_METHOD'] = 'POST' - ENV['HTTP_REFERER'] = (URI.parse(conf.base_url) + conf.update).to_s + ENV['HTTP_REFERER'] = (URI.parse(base_url) + conf.update).to_s unless username==conf['xmlrpc.username'] && password==conf['xmlrpc.password'] raise XMLRPC::FaultException.new(1,'userid or password incorrect') end @@ -188,7 +188,7 @@ server.add_handler('blogger.getUsersBlogs') do |appkey, username, password| { 'blogid' => conf['xmlrpc.blogid'], 'blogName' => conf.html_title, - 'url' => conf.base_url + 'url' => base_url } ] result @@ -203,7 +203,7 @@ server.add_handler('blogger.getUserInfo') do |appkey, username, password| result = { 'nickname' => conf.author_name, 'email' => conf.author_mail, - 'url' => conf.base_url, + 'url' => base_url, 'lastname' => conf['xmlrpc.lastname'], 'firstname' => conf['xmlrpc.firstname'], 'userid' => conf['xmlrpc.userid'] @@ -215,7 +215,7 @@ server.add_handler('metaWeblog.newPost') do |blogid, username, password, content @cgi = CGI::new conf = ::TDiary::Config::new(@cgi) ENV['REQUEST_METHOD'] = 'POST' - ENV['HTTP_REFERER'] = (URI.parse(conf.base_url) + conf.update).to_s + ENV['HTTP_REFERER'] = (URI.parse(base_url) + conf.update).to_s unless username==conf['xmlrpc.username'] && password==conf['xmlrpc.password'] raise XMLRPC::FaultException.new(1,'userid or password incorrect') end @@ -251,7 +251,7 @@ server.add_handler('metaWeblog.editPost') do |postid, username, password, conten @cgi = CGI::new conf = ::TDiary::Config::new(@cgi) ENV['REQUEST_METHOD'] = 'POST' - ENV['HTTP_REFERER'] = (URI.parse(conf.base_url) + conf.update).to_s + ENV['HTTP_REFERER'] = (URI.parse(base_url) + conf.update).to_s unless username==conf['xmlrpc.username'] && password==conf['xmlrpc.password'] raise XMLRPC::FaultException.new(1,'userid or password incorrect') end @@ -310,7 +310,7 @@ server.add_handler('metaWeblog.getPost') do |postid, username, password| diary.each_section {|sec| i += 1 if i==index - link = conf.base_url + conf.index.sub(%r|^\./|, '') + diary.date.strftime('%Y%m%d') + ".html\#p%02d" % i + link = base_url + conf.index.sub(%r|^\./|, '') + diary.date.strftime('%Y%m%d') + ".html\#p%02d" % i title = sec.stripped_subtitle || '' body = sec.body result = { @@ -351,7 +351,7 @@ server.add_handler('metaWeblog.getRecentPosts') do |blogid, username, password, diary.each_section {|sec| index += 1 postid = diary.date.strftime('%Y%m%d') + "%02d" % index - link = conf.base_url + conf.index.sub(%r|^\./|, '') + diary.date.strftime('%Y%m%d') + ".html\#p%02d" % index + link = base_url + conf.index.sub(%r|^\./|, '') + diary.date.strftime('%Y%m%d') + ".html\#p%02d" % index title = sec.stripped_subtitle || '' body = sec.body author = sec.author || conf['xmlrpc.userid'] @@ -391,7 +391,7 @@ server.add_handler('metaWeblog.newMediaObject') do |blogid, username, password, open(path,'wb') {|f| f.write bits.to_s } - {'url' => (URI.parse(conf.base_url) + (image_url + '/' + name)).to_s } + {'url' => (URI.parse(base_url) + (image_url + '/' + name)).to_s } end server.add_handler('mt.getRecentPostTitles') do |blogid, username, password, numberOfPosts| @@ -491,7 +491,7 @@ server.add_handler('mt.setPostCategories') do |postid, username, password, categ @cgi = CGI::new conf = ::TDiary::Config::new(@cgi) ENV['REQUEST_METHOD'] = 'POST' - ENV['HTTP_REFERER'] = (URI.parse(conf.base_url) + conf.update).to_s + ENV['HTTP_REFERER'] = (URI.parse(base_url) + conf.update).to_s unless username==conf['xmlrpc.username'] && password==conf['xmlrpc.password'] raise XMLRPC::FaultException.new(1,'userid or password incorrect') end Modified: plugin/00default.rb (+2 -2) =================================================================== --- plugin/00default.rb 2013-02-17 08:58:21 +0900 (e9a9cf4) +++ plugin/00default.rb 2013-02-17 09:15:33 +0900 (9001864) @@ -324,7 +324,7 @@ end def mobile_link_discovery return '' unless /^(latest|day)$/ =~ @mode uri = @conf.index.dup - uri[0, 0] = @conf.base_url if %r|^https?://|i !~ @conf.index + uri[0, 0] = base_url if %r|^https?://|i !~ @conf.index uri.gsub!( %r|/\./|, '/' ) if @mode == 'day' then uri += anchor( @date.strftime( '%Y%m%d' ) ) @@ -535,7 +535,7 @@ end def my( a, str, title = nil ) date, noise, frag = a.scan( /^(\d{4}|\d{6}|\d{8}|\d{8}-\d+)([^\d]*)?#?([pct]\d+)?$/ )[0] anc = frag ? "#{date}#{frag}" : date - index = /^https?:/ =~ @conf.index ? '' : @conf.base_url + index = /^https?:/ =~ @conf.index ? '' : base_url index += @conf.index.sub(%r|^\./|, '') if title then %Q[<a href="#{h index}#{anchor anc}" title="#{h title}">#{str}</a>] Modified: plugin/90migrate.rb (+1 -1) =================================================================== --- plugin/90migrate.rb 2013-02-17 08:58:21 +0900 (6b4b2df) +++ plugin/90migrate.rb 2013-02-17 09:15:33 +0900 (d3b2d30) @@ -98,7 +98,7 @@ if !@conf.tdiary_version && @conf.io_class.to_s == 'TDiary::DefaultIO' Dir["#{dir}/*.parser"].each{|f| FileUtils.rm_f( f )} # redirect to top page - raise ::TDiary::ForceRedirect, @conf.base_url + raise ::TDiary::ForceRedirect, base_url end # Local Variables: Modified: plugin/en/00default.rb (+2 -2) =================================================================== --- plugin/en/00default.rb 2013-02-17 08:58:21 +0900 (fce22fb) +++ plugin/en/00default.rb 2013-02-17 09:15:33 +0900 (569f425) @@ -147,8 +147,8 @@ add_conf_proc( 'default', 'Site information', 'basic' ) do <h3 class="subtitle">URL of Your Diary</h3> #{"<p>Specify your diary's URL. This URL is used by some plugins for indicate your diary</p>" unless @cgi.mobile_agent?} - #{"<p><strong>NOTICE!! The URL specified below is different from current URL of accessed now.</strong></p>" unless @conf.base_url == @cgi.base_url} - <p><input name="base_url" value="#{h @conf.base_url}" size="70"></p> + #{"<p><strong>NOTICE!! The URL specified below is different from current URL of accessed now.</strong></p>" unless base_url == @cgi.base_url} + <p><input name="base_url" value="#{h base_url}" size="70"></p> <h3 class="subtitle">Description</h3> #{"<p>A brief description of your diary. Can be left blank.</p>" unless @cgi.mobile_agent?} Modified: plugin/ja/00default.rb (+2 -2) =================================================================== --- plugin/ja/00default.rb 2013-02-17 08:58:21 +0900 (d486850) +++ plugin/ja/00default.rb 2013-02-17 09:15:33 +0900 (6c5e0e8) @@ -182,8 +182,8 @@ add_conf_proc( 'default', 'サイトの情報', 'basic' ) do <h3 class="subtitle">日記のURL</h3> #{"<p>日記のURLを指定します。このURLは、さまざまなプラグインで日記を指し示すために利用されるので、正しく一意なものを指定しましょう。</p>" unless @cgi.mobile_agent?} - #{"<p><strong>指定してある値と、現在アクセス中のURLが異なります。注意してください。</strong></p>" unless @conf.base_url == @cgi.base_url} - <p><input name="base_url" value="#{h @conf.base_url}" size="70"></p> + #{"<p><strong>指定してある値と、現在アクセス中のURLが異なります。注意してください。</strong></p>" unless base_url == @cgi.base_url} + <p><input name="base_url" value="#{h base_url}" size="70"></p> <h3 class="subtitle">日記の説明</h3> #{"<p>この日記の簡単な説明を指定します。HTMLヘッダ中に展開されます。何も入力しなくてもかまいません。</p>" unless @cgi.mobile_agent?} Modified: tdiary/filter.rb (+8 -0) =================================================================== --- tdiary/filter.rb 2013-02-17 08:58:21 +0900 (e64363b) +++ tdiary/filter.rb 2013-02-17 09:15:33 +0900 (185b195) @@ -28,6 +28,14 @@ module TDiary true end + def base_url + if @conf.options['base_url'] && @conf.options['base_url'].length > 0 + @conf.options['base_url'] + else + @cgi.base_url + end + end + def debug( msg, level = DEBUG_SPAM ) return if @debug_mode == DEBUG_NONE return if @debug_mode == DEBUG_SPAM and level == DEBUG_FULL |