Dotclear

Changeset 2318:0419bb8bae43 for inc


Ignore:
Timestamp:
10/09/13 07:54:35 (12 years ago)
Author:
Dsls
Branch:
default
Message:

one missing thing...

File:
1 edited

Legend:

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

    r2317 r2318  
    791791               } 
    792792                
    793                if ($this->core->con->driver() == 'pgsql' && isset($params['media'])) { 
    794                     $strReq = 'SELECT DISTINCT ON (P.post_id) '; 
    795                } else { 
    796                     $strReq = 'SELECT '; 
    797                } 
    798                $strReq .= 
    799                'P.post_id, P.blog_id, P.user_id, P.cat_id, post_dt, '. 
     793 
     794               $strReq = 
     795               'SELECT P.post_id, P.blog_id, P.user_id, P.cat_id, post_dt, '. 
    800796               'post_tz, post_creadt, post_upddt, post_format, post_password, '. 
    801797               'post_url, post_lang, post_title, '.$content_req. 
     
    943939           
    944940          if (isset($params['media'])) { 
    945                $strReq .= 'AND P.post_id '; 
    946941               if ($params['media'] == '0') { 
    947                     $strReq .= 'NOT '; 
    948                } 
    949                $strReq .= 'IN (SELECT M.post_id FROM '.$this->prefix.'post_media M '; 
     942                    $strReq .= 'AND NOT '; 
     943               } else { 
     944                    $strReq .= 'AND ';                  
     945               } 
     946               $strReq .= 'EXISTS (SELECT M.post_id FROM '.$this->prefix.'post_media M '. 
     947                    'WHERE M.post_id = P.post_id '; 
    950948               if (isset($params['link_type'])) { 
    951                     $strReq .= " WHERE M.link_type ".$this->con->in($params['link_type'])." "; 
     949                    $strReq .= " AND M.link_type ".$this->con->in($params['link_type'])." "; 
    952950               } 
    953951               $strReq .= ")"; 
Note: See TracChangeset for help on using the changeset viewer.

Sites map