Changeset 2317:d33135045528 for inc
- Timestamp:
- 10/09/13 07:48:15 (12 years ago)
- Branch:
- default
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
inc/core/class.dc.blog.php
r2316 r2317 775 775 elseif (!empty($params['sql_only'])) 776 776 { 777 if ($this->core->con->driver() == 'pgsql' && isset($params['media'])) { 778 $strReq = 'SELECT DISTINCT ON (P.post_id) P.post_id '; 779 } else { 780 $strReq = 'SELECT P.post_id '; 781 } 777 $strReq = 'SELECT P.post_id '; 782 778 } 783 779 else … … 816 812 'LEFT OUTER JOIN '.$this->prefix.'category C ON P.cat_id = C.cat_id '; 817 813 818 if (isset($params['media'])) {819 if ($params['media'] == '0') {820 $strReq .= 'LEFT OUTER JOIN '.$this->prefix.'post_media M on P.post_id = M.post_id ';821 } else {822 $strReq .= 'INNER JOIN '.$this->prefix.'post_media M on P.post_id = M.post_id ';823 }824 if (isset($params['link_type'])) {825 $strReq .= " and M.link_type ".$this->con->in($params['link_type'])." ";826 }827 }828 829 814 if (!empty($params['from'])) { 830 815 $strReq .= $params['from'].' '; … … 958 943 959 944 if (isset($params['media'])) { 945 $strReq .= 'AND P.post_id '; 960 946 if ($params['media'] == '0') { 961 $strReq .= ' AND M.post_id IS NULL '; 962 } 947 $strReq .= 'NOT '; 948 } 949 $strReq .= 'IN (SELECT M.post_id FROM '.$this->prefix.'post_media M '; 950 if (isset($params['link_type'])) { 951 $strReq .= " WHERE M.link_type ".$this->con->in($params['link_type'])." "; 952 } 953 $strReq .= ")"; 963 954 } 964 955 965 956 if (!empty($params['sql'])) { 966 957 $strReq .= $params['sql'].' '; 967 }968 969 if ($this->core->con->driver() != 'pgsql' && !$count_only && isset($params['media'])) {970 $strReq .= ' GROUP BY P.post_id ';971 958 } 972 959
Note: See TracChangeset
for help on using the changeset viewer.