# lm.rb: show last-modified before/after article body. $Revision: 1.4 $ # # This plugin run only copy to plugin directory. # You can customize in tdiary.conf: # @options['lm.bottom']: show below the article (default: false ) # @options['lm.style']: date format (default: 'Last Update: %Y-%m-%d %H:%M:%S') # # notice: # After a comment posting, this value will change without your # modify of the article. This is a specification of tDiary. # # Copyright (c) 2002 TADA Tadashi # Distributed under the GPL # def lm( date, leave = false ) return '' if feed? bottom = @options['lm.bottom'] || false style = @options['lm.style'] || 'Last Update: %Y-%m-%d %H:%M:%S' diary = @diaries[date.strftime( '%Y%m%d' )] if diary and !(leave ^ bottom) then %Q|
#{diary.last_modified.strftime( style )}
| else '' end end add_body_enter_proc do |date| lm( date, false ) end add_body_leave_proc do |date| lm( date, true ) end # Local Variables: # mode: ruby # indent-tabs-mode: t # tab-width: 3 # ruby-indent-level: 3 # End: