Dotclear

Changeset 1280:d9627cb1cb02 for inc


Ignore:
Timestamp:
08/06/13 10:03:57 (12 years ago)
Author:
Dsls
Branch:
default
Message:

Backed out merge changeset: 48c827f9db99

Backed out merge revision to its first parent (5ceeeb6f5454)

Location:
inc
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • inc/admin/lib.dc.page.php

    r1256 r1280  
    476476          self::jsVar('dotclear.msg.confirm_change_post_format', 
    477477               __('You have unsaved changes. Switch post format will loose these changes. Proceed anyway?')). 
    478           self::jsVar('dotclear.msg.confirm_change_post_format_noconvert', 
    479                __("Warning: post format change will not convert existing content. You will need to apply new format by yourself. Proceed anyway?")). 
    480478          self::jsVar('dotclear.msg.load_enhanced_uploader', 
    481479               __('Loading enhanced uploader, please wait.')). 
  • inc/core/class.dc.blog.php

    r1278 r1280  
    203203     @param    ids       <b>mixed</b>        Comment(s) ID(s) 
    204204     @param    del       <b>boolean</b>      If comment is delete, set this to true 
    205      @param    affected_posts      <b>mixed</b>        Posts(s) ID(s) 
    206      */ 
    207      public function triggerComments($ids, $del=false, $affected_posts=null) 
     205     */ 
     206     public function triggerComments($ids,$del=false) 
    208207     { 
    209208          $co_ids = dcUtils::cleanIds($ids); 
    210           $a_ids = dcUtils::cleanIds($affected_posts); 
    211           $a_tbs = array(); 
    212209           
    213210          # a) Retrieve posts affected by comments edition 
    214           if (empty($a_ids)) { 
    215                $strReq =  
    216                     'SELECT post_id, comment_trackback '. 
    217                     'FROM '.$this->prefix.'comment '. 
    218                     'WHERE comment_id'.$this->con->in($co_ids). 
    219                     'GROUP BY post_id,comment_trackback'; 
    220                 
    221                $rs = $this->con->select($strReq); 
    222                 
    223                while ($rs->fetch()) { 
    224                     $a_ids[] = (integer) $rs->post_id; 
    225                     $a_tbs[] = (integer) $rs->comment_trackback; 
    226                } 
     211          $strReq =  
     212               'SELECT post_id, comment_trackback '. 
     213               'FROM '.$this->prefix.'comment '. 
     214               'WHERE comment_id'.$this->con->in($co_ids). 
     215               'GROUP BY post_id,comment_trackback'; 
     216           
     217          $rs = $this->con->select($strReq); 
     218           
     219          $a_ids = $a_tbs = array(); 
     220          while ($rs->fetch()) { 
     221               $a_ids[] = (integer) $rs->post_id; 
     222               $a_tbs[] = (integer) $rs->comment_trackback; 
    227223          } 
    228224           
     
    259255          { 
    260256               $nb_comment = $nb_trackback = 0; 
    261                //$cur->nb_comment = $nb_comment; 
    262257               foreach($b_ids as $b_key => $b_id) 
    263258               { 
     
    510505          $this->core->callBehavior('coreBeforeCategoryCreate',$this,$cur); 
    511506           
    512           $id = $this->categories()->addNode($cur,$parent); 
    513           # Update category's cursor 
    514           $rs = $this->getCategory($id); 
    515           if (!$rs->isEmpty()) { 
    516                $cur->cat_lft = $rs->cat_lft; 
    517                $cur->cat_rgt = $rs->cat_rgt; 
    518           } 
     507          $this->categories()->addNode($cur,$parent); 
    519508           
    520509          # --BEHAVIOR-- coreAfterCategoryCreate 
     
    21922181          $co_ids = dcUtils::cleanIds($ids); 
    21932182           
    2194           if (empty($co_ids)) { 
     2183          if (empty($ids)) { 
    21952184               throw new Exception(__('No such comment ID')); 
    2196           } 
    2197            
    2198           # Retrieve posts affected by comments edition 
    2199           $affected_posts = array(); 
    2200           $strReq = 
    2201                'SELECT distinct(post_id) '. 
    2202                'FROM '.$this->prefix.'comment '. 
    2203                'WHERE comment_id'.$this->con->in($co_ids); 
    2204            
    2205           $rs = $this->con->select($strReq); 
    2206            
    2207           while ($rs->fetch()) { 
    2208                $affected_posts[] = (integer) $rs->post_id; 
    22092185          } 
    22102186           
     
    22362212           
    22372213          $this->con->execute($strReq); 
    2238           $this->triggerComments($co_ids, true, $affected_posts); 
     2214          $this->triggerComments($co_ids,true); 
    22392215          $this->triggerBlog(); 
    22402216     } 
     
    22912267           
    22922268          if ($cur->comment_site !== null && $cur->comment_site != '') { 
    2293                if (!preg_match('|^http(s?)://|i',$cur->comment_site, $matches)) { 
     2269               if (!preg_match('|^http(s?)://|',$cur->comment_site)) { 
    22942270                    $cur->comment_site = 'http://'.$cur->comment_site; 
    2295                }else{ 
    2296                     $cur->comment_site = strtolower($matches[0]).substr($cur->comment_site, strlen($matches[0])); 
    22972271               } 
    22982272          } 
  • inc/core/class.dc.media.php

    r1270 r1280  
    497497     @param    post_id   <b>integer</b>      Post ID 
    498498     @param    media_id  <b>integer</b>      Optionnal media ID 
    499      @param    return_rs <b>boolean</b>      Whether to return a resultset (true) or an array (false, default value). 
    500      @return   <b>array</b> Array or ResultSet of fileItems 
    501      */ 
    502      public function getPostMedia($post_id,$media_id=null,$return_rs=false) 
     499     @return   <b>array</b> Array of fileItems 
     500     */ 
     501     public function getPostMedia($post_id,$media_id=null) 
    503502     { 
    504503          $params = array( 
     
    516515               $f = $this->fileRecord($rs); 
    517516               if ($f !== null) { 
    518                     $res[] = $return_rs ? new ArrayObject($f) : $f; 
    519                } 
    520           } 
    521            
    522           return $return_rs ? staticRecord::newFromArray($res) : $res; 
     517                    $res[] = $f; 
     518               } 
     519          } 
     520           
     521          return $res; 
    523522     } 
    524523      
  • inc/core/class.dc.update.php

    r1231 r1280  
    3232      
    3333     protected $cache_ttl = '-6 hours'; 
    34      protected $nocache_ttl = '-2 mins'; 
    3534     protected $forced_files = array(); 
    3635      
     
    5655      *  
    5756      * @param version        string    Current version to compare 
    58       * @param nocache        boolean   Force checking 
    5957      * @return string                  Latest version if available 
    6058      */ 
    61      public function check($version, $nocache=false) 
    62      { 
    63           $this->getVersionInfo($nocache); 
     59     public function check($version) 
     60     { 
     61          $this->getVersionInfo(); 
    6462          $v = $this->getVersion(); 
    6563          if ($v && version_compare($version,$v,'<')) { 
     
    7068     } 
    7169      
    72      public function getVersionInfo($nocache=false) 
    73      { 
    74           # Check minimum time without cache (prevents from server flood) 
    75           if ($nocache && is_readable($this->cache_file) && filemtime($this->cache_file) > strtotime($this->nocache_ttl)) { 
    76                $nocache = false; 
    77           } 
    78            
     70     public function getVersionInfo() 
     71     { 
    7972          # Check cached file 
    80           if (is_readable($this->cache_file) && filemtime($this->cache_file) > strtotime($this->cache_ttl) && !$nocache) 
     73          if (is_readable($this->cache_file) && filemtime($this->cache_file) > strtotime($this->cache_ttl)) 
    8174          { 
    8275               $c = @file_get_contents($this->cache_file); 
  • inc/load_plugin_file.php

    r1241 r1280  
    8686} 
    8787 
    88 http::$cache_max_age = (!defined('DC_CACHE_MAX_AGE') ? 604800 : DC_CACHE_MAX_AGE); 
     88http::$cache_max_age = 7200; 
    8989http::cache(array_merge(array($PF),get_included_files())); 
    9090 
  • inc/prepend.php

    r1233 r1279  
    123123# Constants 
    124124define('DC_ROOT',path::real(dirname(__FILE__).'/..')); 
    125 define('DC_VERSION','2.5.2-dev'); 
     125define('DC_VERSION','2.6-dev'); 
    126126define('DC_DIGESTS',dirname(__FILE__).'/digests'); 
    127127define('DC_L10N_ROOT',dirname(__FILE__).'/../locales'); 
  • inc/public/class.dc.template.php

    r1249 r1280  
    6767          $this->addValue('BlogLanguage',array($this,'BlogLanguage')); 
    6868          $this->addValue('BlogThemeURL',array($this,'BlogThemeURL')); 
    69           $this->addValue('BlogParentThemeURL',array($this,'BlogParentThemeURL')); 
    7069          $this->addValue('BlogUpdateDate',array($this,'BlogUpdateDate')); 
    7170          $this->addValue('BlogID',array($this,'BlogID')); 
     
    840839      
    841840     /*dtd 
    842      <!ELEMENT tpl:BlogThemeURL - O -- Blog's current Theme URL --> 
     841     <!ELEMENT tpl:BlogThemeURL - O -- Blog's current Themei URL --> 
    843842     */ 
    844843     public function BlogThemeURL($attr) 
     
    846845          $f = $this->getFilters($attr); 
    847846          return '<?php echo '.sprintf($f,'$core->blog->settings->system->themes_url."/".$core->blog->settings->system->theme').'; ?>'; 
    848      } 
    849       
    850      /*dtd 
    851      <!ELEMENT tpl:BlogParentThemeURL - O -- Blog's current Theme's parent URL --> 
    852      */ 
    853      public function BlogParentThemeURL($attr) 
    854      { 
    855           $f = $this->getFilters($attr); 
    856           $parent = '$core->themes->moduleInfo($core->blog->settings->system->theme,\'parent\')'; 
    857           return '<?php echo '.sprintf($f,'$core->blog->settings->system->themes_url."/".('."$parent".' ? '."$parent".' : $core->blog->settings->system->theme)').'; ?>'; 
    858847     } 
    859848     
Note: See TracChangeset for help on using the changeset viewer.

Sites map