Dotclear

Changeset 917:8017d60b617d


Ignore:
Timestamp:
10/26/12 17:42:29 (13 years ago)
Author:
franck <carnet.franck.paul@…>
Branch:
default
Message:

Display warning messages if comments or trackbacks are not (more) allowed on currently edited page, addresses #1136

Files:
2 edited

Legend:

Unmodified
Added
Removed
  • locales/fr/plugins.po

    r911 r917  
    10571057msgstr "Aucune page" 
    10581058 
     1059msgid "Warning: Comments are not more accepted for this page." 
     1060msgstr "Attention : les commentaires ne sont plus acceptés pour cette page." 
     1061 
     1062msgid "Warning: Trackbacks are not more accepted for this page." 
     1063msgstr "Attention : les rétroliens ne sont plus acceptés pour cette page." 
     1064 
    10591065msgid "select this page" 
    10601066msgstr "sélectionner cette page" 
  • plugins/pages/page.php

    r911 r917  
    428428     '<p><label for="post_open_comment" class="classic">'.form::checkbox('post_open_comment',1,$post_open_comment).' '. 
    429429     __('Accept comments').'</label></p>'. 
     430     ($core->blog->settings->system->allow_comments ?  
     431          (isContributionAllowed($post_id,strtotime($post_dt),true) ?  
     432               '' : 
     433               '<p class="form-note warn">'.__('Warning: Comments are not more accepted for this page.').'</p>') :  
     434          '<p class="form-note warn">'.__('Warning: Comments are not accepted on this blog.').'</p>'). 
    430435 
    431436     '<p><label for="post_open_tb" class="classic">'.form::checkbox('post_open_tb',1,$post_open_tb).' '. 
    432437     __('Accept trackbacks').'</label></p>'. 
     438     ($core->blog->settings->system->allow_trackbacks ?  
     439          (isContributionAllowed($post_id,strtotime($post_dt),false) ?  
     440               '' : 
     441               '<p class="form-note warn">'.__('Warning: Trackbacks are not more accepted for this page.').'</p>') :  
     442          '<p class="form-note warn">'.__('Warning: Trackbacks are not accepted on this blog.').'</p>'). 
    433443      
    434444     '<p><label for="post_selected" class="classic">'.form::checkbox('post_selected',1,$post_selected).' '. 
     
    614624} 
    615625 
     626# Controls comments or trakbacks capabilities 
     627function isContributionAllowed($id,$dt,$com=true) 
     628{ 
     629     global $core; 
     630 
     631     if (!$id) { 
     632          return true; 
     633     } 
     634     if ($com) { 
     635          if (($core->blog->settings->system->comments_ttl == 0) ||  
     636               (time() - $core->blog->settings->system->comments_ttl*86400 < $dt)) { 
     637               return true; 
     638          } 
     639     } else { 
     640          if (($core->blog->settings->system->trackbacks_ttl == 0) ||  
     641               (time() - $core->blog->settings->system->trackbacks_ttl*86400 < $dt)) { 
     642               return true; 
     643          } 
     644     } 
     645     return false; 
     646} 
    616647 
    617648# Show comments or trackbacks 
Note: See TracChangeset for help on using the changeset viewer.

Sites map