Dotclear

Changeset 916:d4fd1fc3fb7d


Ignore:
Timestamp:
10/26/12 16:31:26 (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 entry, fixes #1136

Files:
2 edited

Legend:

Unmodified
Added
Removed
  • admin/post.php

    r907 r916  
    422422     '<p><label for="post_open_comment" class="classic">'.form::checkbox('post_open_comment',1,$post_open_comment).' '. 
    423423     __('Accept comments').'</label></p>'. 
     424     ($core->blog->settings->system->allow_comments ?  
     425          (isContributionAllowed($post_id,strtotime($post_dt),true) ?  
     426               '' : 
     427               '<p class="form-note warn">'.__('Warning: Comments are not more accepted for this entry.').'</p>') :  
     428          '<p class="form-note warn">'.__('Warning: Comments are not accepted on this blog.').'</p>'). 
     429 
    424430     '<p><label for="post_open_tb" class="classic">'.form::checkbox('post_open_tb',1,$post_open_tb).' '. 
    425431     __('Accept trackbacks').'</label></p>'. 
     432     ($core->blog->settings->system->allow_trackbacks ?  
     433          (isContributionAllowed($post_id,strtotime($post_dt),false) ?  
     434               '' : 
     435               '<p class="form-note warn">'.__('Warning: Trackbacks are not more accepted for this entry.').'</p>') :  
     436          '<p class="form-note warn">'.__('Warning: Trackbacks are not accepted on this blog.').'</p>'). 
     437 
    426438     '<p><label for="post_selected" class="classic">'.form::checkbox('post_selected',1,$post_selected).' '. 
    427439     __('Selected entry').'</label></p>'. 
     
    567579} 
    568580 
     581# Controls comments or trakbacks capabilities 
     582function isContributionAllowed($id,$dt,$com=true) 
     583{ 
     584     global $core; 
     585 
     586     if (!$id) { 
     587          return true; 
     588     } 
     589     if ($com) { 
     590          if (($core->blog->settings->system->comments_ttl == 0) ||  
     591               (time() - $core->blog->settings->system->comments_ttl*86400 < $dt)) { 
     592               return true; 
     593          } 
     594     } else { 
     595          if (($core->blog->settings->system->trackbacks_ttl == 0) ||  
     596               (time() - $core->blog->settings->system->trackbacks_ttl*86400 < $dt)) { 
     597               return true; 
     598          } 
     599     } 
     600     return false; 
     601} 
    569602 
    570603# Show comments or trackbacks 
  • locales/fr/main.po

    r901 r916  
    15701570msgstr "Convertir en XHTML" 
    15711571 
     1572msgid "Warning: Comments are not more accepted for this entry." 
     1573msgstr "Attention : les commentaires ne sont plus acceptés pour ce billet." 
     1574 
     1575msgid "Warning: Comments are not accepted on this blog." 
     1576msgstr "Attention : les commentaires ne sont pas acceptés sur ce blog." 
     1577 
     1578msgid "Warning: Trackbacks are not more accepted for this entry." 
     1579msgstr "Attention : les rétroliens ne sont plus acceptés pour ce billet." 
     1580 
     1581msgid "Warning: Trackbacks are not accepted on this blog." 
     1582msgstr "Attention : les rétroliens ne sont pas acceptés sur ce blog." 
     1583 
    15721584msgid "Selected entry" 
    15731585msgstr "Billet sélectionné" 
Note: See TracChangeset for help on using the changeset viewer.

Sites map