Dotclear


Ignore:
Timestamp:
11/29/11 08:47:14 (14 years ago)
Author:
Dsls <dsls@…>
Branch:
default
Message:

Tuned sql_only parameters in core->blog->getPosts and core->blog->getComments, closes #1028

File:
1 edited

Legend:

Unmodified
Added
Removed
  • inc/core/class.dc.blog.php

    r744 r774  
    658658     - order: Order of results (default "ORDER BY post_dt DES") 
    659659     - limit: Limit parameter 
     660     - sql_only : return the sql request instead of results. Only ids are selected 
    660661      
    661662     Please note that on every cat_id or cat_url, you can add ?not to exclude 
     
    664665     @param    params         <b>array</b>        Parameters 
    665666     @param    count_only     <b>boolean</b>      Only counts results 
    666      @param    sql_only  <b>boolean</b>      Only return SQL request 
    667667     @return   <b>record</b>  A record with some more capabilities or the SQL request 
    668668     */ 
    669      public function getPosts($params=array(),$count_only=false,$sql_only=false) 
     669     public function getPosts($params=array(),$count_only=false) 
    670670     { 
    671671          # --BEHAVIOR-- coreBlogBeforeGetPosts 
     
    675675          { 
    676676               $strReq = 'SELECT count(P.post_id) '; 
     677          } 
     678          elseif (!empty($params['sql_only']))  
     679          { 
     680               $strReq = 'SELECT P.post_id '; 
    677681          } 
    678682          else 
     
    844848          } 
    845849           
    846           if ($sql_only) { 
     850          if (!empty($params['sql_only'])) { 
    847851               return $strReq; 
    848852          } 
     
    17251729     - order: Order of results (default "ORDER BY comment_dt DES") 
    17261730     - limit: Limit parameter 
     1731     - sql_only : return the sql request instead of results. Only ids are selected 
    17271732      
    17281733     @param    params         <b>array</b>        Parameters 
     
    17351740          { 
    17361741               $strReq = 'SELECT count(comment_id) '; 
     1742          } 
     1743          elseif (!empty($params['sql_only']))  
     1744          { 
     1745               $strReq = 'SELECT P.post_id '; 
    17371746          } 
    17381747          else 
     
    18601869               $strReq .= $this->con->limit($params['limit']); 
    18611870          } 
     1871 
     1872          if (!empty($params['sql_only'])) { 
     1873               return $strReq; 
     1874          } 
    18621875           
    18631876          $rs = $this->con->select($strReq); 
Note: See TracChangeset for help on using the changeset viewer.

Sites map