Dotclear


Ignore:
Timestamp:
11/17/13 20:25:53 (12 years ago)
Author:
franck <carnet.franck.paul@…>
Branch:
2.6
Children:
2567:6c11245cbf04, 2568:61c67a7d17fa
Message:

Add some people in CREDITS, remove trailing spaces and tabs.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • inc/core/class.dc.rs.extensions.php

    r1179 r2566  
    2626     /** 
    2727     Returns whether post is editable. 
    28       
     28 
    2929     @param    rs   Invisible parameter 
    3030     @return   <b>boolean</b> 
     
    3636               return true; 
    3737          } 
    38            
     38 
    3939          # No user id in result ? false 
    4040          if (!$rs->exists('user_id')) { 
    4141               return false; 
    4242          } 
    43            
     43 
    4444          # If user is usage and owner of the entrie 
    4545          if ($rs->core->auth->check('usage',$rs->core->blog->id) 
     
    4747               return true; 
    4848          } 
    49            
     49 
    5050          return false; 
    5151     } 
    52       
     52 
    5353     /** 
    5454     Returns whether post is deletable 
    55       
     55 
    5656     @param    rs   Invisible parameter 
    5757     @return   <b>boolean</b> 
     
    6363               return true; 
    6464          } 
    65            
     65 
    6666          # No user id in result ? false 
    6767          if (!$rs->exists('user_id')) { 
    6868               return false; 
    6969          } 
    70            
     70 
    7171          # If user has delete rights and is owner of the entrie 
    7272          if ($rs->core->auth->check('delete',$rs->core->blog->id) 
     
    7474               return true; 
    7575          } 
    76            
     76 
    7777          return false; 
    7878     } 
    79       
     79 
    8080     /** 
    8181     Returns whether post is the first one of its day. 
    82       
     82 
    8383     @param    rs   Invisible parameter 
    8484     @return   <b>boolean</b> 
     
    8989               return true; 
    9090          } 
    91            
     91 
    9292          $cdate = date('Ymd',strtotime($rs->post_dt)); 
    9393          $rs->movePrev(); 
     
    9696          return $ndate != $cdate; 
    9797     } 
    98       
     98 
    9999     /** 
    100100     Returns whether post is the last one of its day. 
    101       
     101 
    102102     @param    rs   Invisible parameter 
    103103     @return   <b>boolean</b> 
     
    108108               return true; 
    109109          } 
    110            
     110 
    111111          $cdate = date('Ymd',strtotime($rs->post_dt)); 
    112112          $rs->moveNext(); 
     
    115115          return $ndate != $cdate; 
    116116     } 
    117       
     117 
    118118     /** 
    119119     Returns whether comments are enabled on post. 
    120       
     120 
    121121     @param    rs   Invisible parameter 
    122122     @return   <b>boolean</b> 
     
    130130          time()-($rs->core->blog->settings->system->comments_ttl*86400) < $rs->getTS()); 
    131131     } 
    132       
     132 
    133133     /** 
    134134     Returns whether trackbacks are enabled on post. 
    135       
     135 
    136136     @param    rs   Invisible parameter 
    137137     @return   <b>boolean</b> 
     
    145145          time()-($rs->core->blog->settings->system->trackbacks_ttl*86400) < $rs->getTS()); 
    146146     } 
    147       
     147 
    148148     /** 
    149149     Returns whether post has at least one comment. 
    150       
     150 
    151151     @param    rs   Invisible parameter 
    152152     @return   <b>boolean</b> 
     
    156156          return $rs->nb_comment > 0; 
    157157     } 
    158       
     158 
    159159     /** 
    160160     Returns whether post has at least one trackbacks. 
    161       
     161 
    162162     @return   <b>boolean</b> 
    163163     */ 
     
    176176          return ($rs->getTS('upddt') + dt::getTimeOffset($rs->post_tz)) > $rs->getTS(); 
    177177     } 
    178       
     178 
    179179     /** 
    180180     Returns full post URL. 
    181       
     181 
    182182     @param    rs   Invisible parameter 
    183183     @return   <b>string</b> 
     
    189189               ); 
    190190     } 
    191       
     191 
    192192     /** 
    193193     Returns full post category URL. 
    194       
     194 
    195195     @param    rs   Invisible parameter 
    196196     @return   <b>string</b> 
     
    200200          return $rs->core->blog->url.$rs->core->url->getURLFor('category',html::sanitizeURL($rs->cat_url)); 
    201201     } 
    202       
     202 
    203203     /** 
    204204     Returns whether post has an excerpt. 
    205       
     205 
    206206     @param    rs   Invisible parameter 
    207207     @return   <b>boolean</b> 
     
    211211          return $rs->post_excerpt_xhtml != ''; 
    212212     } 
    213       
     213 
    214214     /** 
    215215     Returns post timestamp. 
    216       
     216 
    217217     @param    rs   Invisible parameter 
    218218     @param    type <b>string</b>       (dt|upddt|creadt) defaults to post_dt 
     
    229229          } 
    230230     } 
    231       
     231 
    232232     /** 
    233233     Returns post date formating according to the ISO 8601 standard. 
    234       
     234 
    235235     @param    rs   Invisible parameter 
    236236     @param    type <b>string</b>       (dt|upddt|creadt) defaults to post_dt 
     
    245245          } 
    246246     } 
    247       
     247 
    248248     /** 
    249249     Returns post date formating according to RFC 822. 
    250       
     250 
    251251     @param    rs   Invisible parameter 
    252252     @param    type <b>string</b>       (dt|upddt|creadt) defaults to post_dt 
     
    261261          } 
    262262     } 
    263       
     263 
    264264     /** 
    265265     Returns post date with <var>$format</var> as formatting pattern. If format 
    266266     is empty, uses <var>date_format</var> blog setting. 
    267       
     267 
    268268     @param    rs   Invisible parameter 
    269269     @param    format    <b>string</b>       Date format pattern 
     
    276276               $format = $rs->core->blog->settings->system->date_format; 
    277277          } 
    278            
     278 
    279279          if ($type == 'upddt') { 
    280280               return dt::dt2str($format,$rs->post_upddt,$rs->post_tz); 
     
    285285          } 
    286286     } 
    287       
     287 
    288288     /** 
    289289     Returns post time with <var>$format</var> as formatting pattern. If format 
    290290     is empty, uses <var>time_format</var> blog setting. 
    291       
     291 
    292292     @param    rs   Invisible parameter 
    293293     @param    format    <b>string</b>       Time format pattern 
     
    300300               $format = $rs->core->blog->settings->system->time_format; 
    301301          } 
    302            
     302 
    303303          if ($type == 'upddt') { 
    304304               return dt::dt2str($format,$rs->post_upddt,$rs->post_tz); 
     
    309309          } 
    310310     } 
    311       
     311 
    312312     /** 
    313313     Returns author common name using user_id, user_name, user_firstname and 
    314314     user_displayname fields. 
    315       
     315 
    316316     @param    rs   Invisible parameter 
    317317     @return   <b>string</b> 
     
    322322          $rs->user_firstname, $rs->user_displayname); 
    323323     } 
    324       
     324 
    325325     /** 
    326326     Returns author common name with a link if he specified one in its 
    327327     preferences. 
    328       
     328 
    329329     @param    rs   Invisible parameter 
    330330     @return   <b>string</b> 
     
    337337               $res = '<a href="%2$s">%1$s</a>'; 
    338338          } 
    339            
     339 
    340340          return sprintf($res,html::escapeHTML($rs->getAuthorCN()),html::escapeHTML($url)); 
    341341     } 
    342       
     342 
    343343     /** 
    344344     Returns author e-mail address. If <var>$encoded</var> is true, "@" sign is 
    345345     replaced by "%40" and "." by "%2e". 
    346       
     346 
    347347     @param    rs   Invisible parameter 
    348348     @param    encoded   <b>boolean</b>      Encode address. 
     
    356356          return $rs->user_email; 
    357357     } 
    358       
     358 
    359359     /** 
    360360     Returns post feed unique ID. 
    361       
     361 
    362362     @param    rs   Invisible parameter 
    363363     @return   <b>string</b> 
     
    366366     { 
    367367          return 'urn:md5:'.md5($rs->core->blog->uid.$rs->post_id); 
    368            
     368 
    369369          $url = parse_url($rs->core->blog->url); 
    370370          $date_part = date('Y-m-d',strtotime($rs->post_creadt)); 
    371            
     371 
    372372          return 'tag:'.$url['host'].','.$date_part.':'.$rs->post_id; 
    373373     } 
    374       
     374 
    375375     /** 
    376376     Returns trackback RDF information block in HTML comment. 
    377       
     377 
    378378     @param    rs   Invisible parameter 
    379379     @return   <b>string</b> 
     
    395395          "<!]]><!---->\n"; 
    396396     } 
    397       
     397 
    398398     /** 
    399399     Returns post trackback full URL. 
    400       
     400 
    401401     @param    rs   Invisible parameter 
    402402     @return   <b>string</b> 
     
    406406          return $rs->core->blog->url.$rs->core->url->getURLFor('trackback',$rs->post_id); 
    407407     } 
    408       
     408 
    409409     /** 
    410410     Returns post content. If <var>$absolute_urls</var> is true, appends full 
    411411     blog URL to each relative post URLs. 
    412       
     412 
    413413     @param    rs   Invisible parameter 
    414414     @param    absolute_urls  <b>boolean</b>      With absolute URLs 
     
    423423          } 
    424424     } 
    425       
     425 
    426426     /** 
    427427     Returns post excerpt. If <var>$absolute_urls</var> is true, appends full 
    428428     blog URL to each relative post URLs. 
    429       
     429 
    430430     @param    rs   Invisible parameter 
    431431     @param    absolute_urls  <b>boolean</b>      With absolute URLs 
     
    440440          } 
    441441     } 
    442       
     442 
    443443     /** 
    444444     Returns post media count using a subquery. 
    445       
     445 
    446446     @param    rs   Invisible parameter 
    447447     @return   <b>integer</b> 
     
    459459               'FROM '.$rs->core->prefix.'post_media '. 
    460460               'WHERE post_id = '.(integer) $rs->post_id.' '; 
    461                 
     461 
    462462               $res = (integer) $rs->core->con->select($strReq)->f(0); 
    463463               $rs->_nb_media[$rs->index()] = $res; 
     
    483483     Returns comment date with <var>$format</var> as formatting pattern. If 
    484484     format is empty, uses <var>date_format</var> blog setting. 
    485       
     485 
    486486     @param    rs   Invisible parameter 
    487487     @param    format    <b>string</b>       Date format pattern 
     
    494494               $format = $rs->core->blog->settings->system->date_format; 
    495495          } 
    496            
     496 
    497497          if ($type == 'upddt') { 
    498498               return dt::dt2str($format,$rs->comment_upddt,$rs->comment_tz); 
     
    501501          } 
    502502     } 
    503       
     503 
    504504     /** 
    505505     Returns comment time with <var>$format</var> as formatting pattern. If 
    506506     format is empty, uses <var>time_format</var> blog setting. 
    507       
     507 
    508508     @param    rs   Invisible parameter 
    509509     @param    format    <b>string</b>       Date format pattern 
     
    516516               $format = $rs->core->blog->settings->system->time_format; 
    517517          } 
    518            
     518 
    519519          if ($type == 'upddt') { 
    520520               return dt::dt2str($format,$rs->comment_updt,$rs->comment_tz); 
     
    523523          } 
    524524     } 
    525       
     525 
    526526     /** 
    527527     Returns comment timestamp. 
    528       
     528 
    529529     @param    rs   Invisible parameter 
    530530     @param    type <b>string</b>       (dt|upddt) defaults to comment_dt 
     
    539539          } 
    540540     } 
    541       
     541 
    542542     /** 
    543543     Returns comment date formating according to the ISO 8601 standard. 
    544       
     544 
    545545     @param    rs   Invisible parameter 
    546546     @param    type <b>string</b>       (dt|upddt) defaults to comment_dt 
     
    555555          } 
    556556     } 
    557       
     557 
    558558     /** 
    559559     Returns comment date formating according to RFC 822. 
    560       
     560 
    561561     @param    rs   Invisible parameter 
    562562     @param    type <b>string</b>       (dt|upddt) defaults to comment_dt 
     
    571571          } 
    572572     } 
    573       
     573 
    574574     /** 
    575575     Returns comment content. If <var>$absolute_urls</var> is true, appends full 
    576576     blog URL to each relative post URLs. 
    577       
     577 
    578578     @param    rs   Invisible parameter 
    579579     @param    absolute_urls  <b>boolean</b>      With absolute URLs 
     
    583583     { 
    584584          $res = $rs->comment_content; 
    585            
     585 
    586586          if ($rs->core->blog->settings->system->comments_nofollow) { 
    587587               $res = preg_replace_callback('#<a(.*?href=".*?".*?)>#ms',array('self','noFollowURL'),$res); 
    588588          } 
    589            
     589 
    590590          if ($absolute_urls) { 
    591591               $res = html::absoluteURLs($res,$rs->getPostURL()); 
    592592          } 
    593            
     593 
    594594          return $res; 
    595595     } 
    596       
     596 
    597597     private static function noFollowURL($m) 
    598598     { 
     
    600600               return $m[0]; 
    601601          } 
    602            
     602 
    603603          return '<a'.$m[1].' rel="nofollow">'; 
    604604     } 
    605       
     605 
    606606     /** 
    607607     Returns comment author link to his website if he specified one. 
    608       
     608 
    609609     @param    rs   Invisible parameter 
    610610     @return   <b>string</b> 
     
    616616          } 
    617617     } 
    618       
     618 
    619619     /** 
    620620     Returns comment post full URL. 
    621       
     621 
    622622     @param    rs   Invisible parameter 
    623623     @return   <b>string</b> 
     
    629629               ); 
    630630     } 
    631       
     631 
    632632     /** 
    633633     Returns comment author name in a link to his website if he specified one. 
    634       
     634 
    635635     @param    rs   Invisible parameter 
    636636     @return   <b>string</b> 
     
    643643               $res = '<a href="%2$s"%3$s>%1$s</a>'; 
    644644          } 
    645            
     645 
    646646          $nofollow = ''; 
    647647          if ($rs->core->blog->settings->system->comments_nofollow) { 
    648648               $nofollow = ' rel="nofollow"'; 
    649649          } 
    650            
     650 
    651651          return sprintf($res,html::escapeHTML($rs->comment_author),html::escapeHTML($url),$nofollow); 
    652652     } 
    653       
     653 
    654654     /** 
    655655     Returns comment author e-mail address. If <var>$encoded</var> is true, 
    656656     "@" sign is replaced by "%40" and "." by "%2e". 
    657       
     657 
    658658     @param    rs   Invisible parameter 
    659659     @param    encoded   <b>boolean</b>      Encode address. 
     
    667667          return $rs->comment_email; 
    668668     } 
    669       
     669 
    670670     /** 
    671671     Returns trackback site title if comment is a trackback. 
    672       
     672 
    673673     @param    rs   Invisible parameter 
    674674     @return   <b>string</b> 
     
    682682          } 
    683683     } 
    684       
     684 
    685685     /** 
    686686     Returns trackback content if comment is a trackback. 
    687       
     687 
    688688     @param    rs   Invisible parameter 
    689689     @return   <b>string</b> 
     
    696696          } 
    697697     } 
    698       
     698 
    699699     /** 
    700700     Returns comment feed unique ID. 
    701       
     701 
    702702     @param    rs   Invisible parameter 
    703703     @return   <b>string</b> 
     
    706706     { 
    707707          return 'urn:md5:'.md5($rs->core->blog->uid.$rs->comment_id); 
    708            
     708 
    709709          $url = parse_url($rs->core->blog->url); 
    710710          $date_part = date('Y-m-d',strtotime($rs->comment_dt)); 
    711            
     711 
    712712          return 'tag:'.$url['host'].','.$date_part.':'.$rs->comment_id; 
    713713     } 
    714       
     714 
    715715     /** 
    716716     Returns whether comment is from the post author. 
    717       
     717 
    718718     @param    rs   Invisible parameter 
    719719     @return   <b>boolean</b> 
     
    748748          return strtotime($rs->dt); 
    749749     } 
    750       
     750 
    751751     /** 
    752752     @param    rs   Invisible parameter 
     
    757757          return date('Y',strtotime($rs->dt)); 
    758758     } 
    759       
     759 
    760760     /** 
    761761     @param    rs   Invisible parameter 
     
    766766          return date('m',strtotime($rs->dt)); 
    767767     } 
    768       
     768 
    769769     /** 
    770770     @param    rs   Invisible parameter 
     
    775775          return date('d',strtotime($rs->dt)); 
    776776     } 
    777       
     777 
    778778     /** 
    779779     Returns date month archive full URL. 
    780       
     780 
    781781     @param    rs   Invisible parameter 
    782782     @param    core      <b>dcCore</b>       dcCore instance 
     
    786786     { 
    787787          $url = date('Y/m',strtotime($rs->dt)); 
    788            
     788 
    789789          return $core->blog->url.$core->url->getURLFor('archive',$url); 
    790790     } 
    791       
     791 
    792792     /** 
    793793     Returns whether date is the first of year. 
    794       
     794 
    795795     @param    rs   Invisible parameter 
    796796     @return   <b>boolean</b> 
     
    801801               return true; 
    802802          } 
    803            
     803 
    804804          $y = $rs->year(); 
    805805          $rs->movePrev(); 
    806806          $py = $rs->year(); 
    807807          $rs->moveNext(); 
    808            
     808 
    809809          return $y != $py; 
    810810     } 
    811       
     811 
    812812     /** 
    813813     Returns whether date is the last of year. 
    814       
     814 
    815815     @param    rs   Invisible parameter 
    816816     @return   <b>boolean</b> 
     
    821821               return true; 
    822822          } 
    823            
     823 
    824824          $y = $rs->year(); 
    825825          if ($rs->moveNext()) { 
     
    829829          } 
    830830          return false; 
    831            
     831 
    832832     } 
    833833} 
     
    848848     /** 
    849849     Returns a user option. 
    850       
     850 
    851851     @param    rs   Invisible parameter 
    852852     @param    name      <b>string</b>       Option name 
     
    856856     { 
    857857          $options = self::options($rs); 
    858            
     858 
    859859          if (isset($options[$name])) { 
    860860               return $options[$name]; 
     
    862862          return null; 
    863863     } 
    864       
     864 
    865865     /** 
    866866     Returns all user options. 
    867       
     867 
    868868     @param    rs   Invisible parameter 
    869869     @return   <b>array</b> 
     
    878878     } 
    879879} 
    880 ?> 
Note: See TracChangeset for help on using the changeset viewer.

Sites map