Dotclear

Changeset 1278:48c827f9db99


Ignore:
Timestamp:
08/06/13 09:15:43 (11 years ago)
Author:
Dsls
Branch:
default
Children:
1279:10bd7878d104, 1280:d9627cb1cb02
Parents:
1245:5ceeeb6f5454 (diff), 1277:80cbd4bba462 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

Merge with 2.5

Files:
3 edited

Legend:

Unmodified
Added
Removed
  • .hgsubstate

    r1242 r1278  
    1 68debbf1f4b869c562e3ac3d1901d55e9ddf2f49 inc/libs/clearbricks 
     14a0351ee5d566a83ff06ca8bc9fffeb99885f545 inc/libs/clearbricks 
  • inc/core/class.dc.blog.php

    r1244 r1278  
    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      */ 
    206      public function triggerComments($ids,$del=false) 
     205     @param    affected_posts      <b>mixed</b>        Posts(s) ID(s) 
     206     */ 
     207     public function triggerComments($ids, $del=false, $affected_posts=null) 
    207208     { 
    208209          $co_ids = dcUtils::cleanIds($ids); 
     210          $a_ids = dcUtils::cleanIds($affected_posts); 
     211          $a_tbs = array(); 
    209212           
    210213          # a) Retrieve posts affected by comments edition 
    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; 
     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               } 
    223227          } 
    224228           
     
    255259          { 
    256260               $nb_comment = $nb_trackback = 0; 
     261               //$cur->nb_comment = $nb_comment; 
    257262               foreach($b_ids as $b_key => $b_id) 
    258263               { 
     
    505510          $this->core->callBehavior('coreBeforeCategoryCreate',$this,$cur); 
    506511           
    507           $this->categories()->addNode($cur,$parent); 
     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          } 
    508519           
    509520          # --BEHAVIOR-- coreAfterCategoryCreate 
     
    21812192          $co_ids = dcUtils::cleanIds($ids); 
    21822193           
    2183           if (empty($ids)) { 
     2194          if (empty($co_ids)) { 
    21842195               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; 
    21852209          } 
    21862210           
     
    22122236           
    22132237          $this->con->execute($strReq); 
    2214           $this->triggerComments($co_ids,true); 
     2238          $this->triggerComments($co_ids, true, $affected_posts); 
    22152239          $this->triggerBlog(); 
    22162240     } 
     
    22672291           
    22682292          if ($cur->comment_site !== null && $cur->comment_site != '') { 
    2269                if (!preg_match('|^http(s?)://|',$cur->comment_site)) { 
     2293               if (!preg_match('|^http(s?)://|i',$cur->comment_site, $matches)) { 
    22702294                    $cur->comment_site = 'http://'.$cur->comment_site; 
     2295               }else{ 
     2296                    $cur->comment_site = strtolower($matches[0]).substr($cur->comment_site, strlen($matches[0])); 
    22712297               } 
    22722298          } 
  • inc/core/class.dc.blog.php

    r1262 r1278  
    8181               $this->desc = $b->blog_desc; 
    8282               $this->url = $b->blog_url; 
    83                $this->host = preg_replace('|^([a-z]{3,}://)(.*?)/.*$|','$1$2',$this->url); 
     83               $this->host = http::getHostFromURL($this->url); 
    8484               $this->creadt = strtotime($b->blog_creadt); 
    8585               $this->upddt = strtotime($b->blog_upddt); 
Note: See TracChangeset for help on using the changeset viewer.

Sites map