Sha256: 3a642035e371889c7bf0237571748a85a928a10f1c1e311987b60b1ae0f63a46

Contents?: true

Size: 1.07 KB

Versions: 27

Compression:

Stored size: 1.07 KB

Contents

# 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 <sho@spc.gr.jp>
# 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|<div class="lm"><span class="lm">#{diary.last_modified.strftime( style )}</span></div>|
	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:

Version data entries

27 entries across 27 versions & 1 rubygems

Version Path
tdiary-blogkit-5.3.0 plugin/lm.rb
tdiary-blogkit-5.2.4 plugin/lm.rb
tdiary-blogkit-5.2.3 plugin/lm.rb
tdiary-blogkit-5.2.2 plugin/lm.rb
tdiary-blogkit-5.2.1 plugin/lm.rb
tdiary-blogkit-5.2.0 plugin/lm.rb
tdiary-blogkit-5.1.7 plugin/lm.rb
tdiary-blogkit-5.1.6 plugin/lm.rb
tdiary-blogkit-5.1.5 plugin/lm.rb
tdiary-blogkit-5.1.4 plugin/lm.rb
tdiary-blogkit-5.1.3 plugin/lm.rb
tdiary-blogkit-5.1.2 plugin/lm.rb
tdiary-blogkit-5.1.1 plugin/lm.rb
tdiary-blogkit-5.1.0 plugin/lm.rb
tdiary-blogkit-5.0.13 plugin/lm.rb
tdiary-blogkit-5.0.12 plugin/lm.rb
tdiary-blogkit-5.0.11 plugin/lm.rb
tdiary-blogkit-5.0.10 plugin/lm.rb
tdiary-blogkit-5.0.9 plugin/lm.rb
tdiary-blogkit-5.0.8 plugin/lm.rb