Show
Ignore:
Timestamp:
08/15/08 11:30:32 (5 months ago)
Author:
hsbt
Message:

modified the notification only append mode.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • platform/tdiary/plugin/notify_wassr.rb

    r17660 r17661  
    4343        date = @date.strftime('%Y%m%d') 
    4444        diary = @diaries[date] 
    45         titles = [] 
     45        sectitle = '' 
     46        index = 0 
     47         
    4648        diary.each_section do |sec| 
    47                 titles << sec.subtitle 
     49                index += 1 
     50                sectitle = sec.subtitle 
    4851        end 
    4952 
    50         blogtitle = @conf.html_title 
    51         sectitles = titles.join(', ') 
    52         url = @conf.base_url + anchor(date) 
     53        url = @conf.base_url + anchor("#{date}p%02d" % index) 
     54        prefix = @conf['wassr.notify.prefix'] 
    5355        format = @conf['wassr.notify.format'] 
    54         prefix = @conf['wassr.notify.prefix'] 
    5556 
    56         status = format % [prefix, blogtitle, sectitles, url] 
     57        status = format % [prefix, sectitle, url] 
    5758 
    5859        begin 
    59                 wsupdater = Wassr::Updater.new(@conf['wassr.user'], @conf['wassr.pass'] ) 
    60                 wsupdater.update( status ) 
     60#               wsupdater = Wassr::Updater.new(@conf['wassr.user'], @conf['wassr.pass'] ) 
     61#               wsupdater.update( status ) 
     62                @conf.debug(status) 
    6163        rescue => e 
    62                 @conf.debug(e) 
     64                @conf.debug( e ) 
    6365        end 
    6466end 
    6567 
    6668def notify_wassr_init 
    67         @conf['wassr.notify.prefix'] ||= '[blog update] ' 
    68         @conf['wassr.notify.format'] ||= '%s%s : %s %s' 
     69        @conf['wassr.notify.prefix'] ||= '[blog update]' 
     70        @conf['wassr.notify.format'] ||= '%s %s %s' 
    6971end 
    7072 
    7173add_update_proc do 
    72         notify_wassr if @cgi.params['wassr.notify'][0] == 'true' 
     74        if @mode == 'append' then 
     75                notify_wassr if @cgi.params['wassr.notify'][0] == 'true' 
     76        end 
    7377end 
    7478 
    7579add_edit_proc do 
    76         checked = ' checked' 
     80        checked = '' 
    7781        if @mode == 'preview' then 
    7882                checked = @cgi.params['wassr.notify'][0] == 'true' ? ' checked' : ''