Changeset 574
- Timestamp:
- 12/07/2003 08:59:05 AM (21 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/blog.header.php
r572 r574 14 14 require_once ($curpath.$b2inc.'/xmlrpcs.inc'); 15 15 16 $b2varstoreset = array('m','p','posts','w','c', 'cat','withcomments','s','search','exact', 'sentence','poststart','postend','preview','debug', 'calendar','page','paged','more','tb', 'pb','author','order','orderby', 'year', 'monthnum', 'day', 'name', 'category_n icename');16 $b2varstoreset = array('m','p','posts','w','c', 'cat','withcomments','s','search','exact', 'sentence','poststart','postend','preview','debug', 'calendar','page','paged','more','tb', 'pb','author','order','orderby', 'year', 'monthnum', 'day', 'name', 'category_name'); 17 17 18 18 for ($i=0; $i<count($b2varstoreset); $i += 1) { … … 59 59 $limits = ''; 60 60 $distinct = ''; 61 $join = ''; 61 62 62 63 if ($pagenow != 'wp-post.php') { timer_start(); } … … 156 157 $andor = 'OR'; 157 158 } 159 $join = " LEFT JOIN $tablepost2cat ON ($tableposts.ID = $tablepost2cat.post_id) "; 158 160 $cat_array = explode(' ',$cat); 159 $whichcat .= ' AND ( post_category'.$eq.' '.intval($cat_array[0]);161 $whichcat .= ' AND (category_id '.$eq.' '.intval($cat_array[0]); 160 162 for ($i = 1; $i < (count($cat_array)); $i = $i + 1) { 161 163 $whichcat .= ' '.$andor.' post_category '.$eq.' '.intval($cat_array[$i]); 162 164 } 163 165 $whichcat .= ')'; 164 } 166 } 167 168 // Category stuff for nice URIs 169 170 if ('' != $category_name) { 171 $category_name = preg_replace('|[^a-z0-9-/]|', '', $category_name); 172 $join = " LEFT JOIN $tablepost2cat ON ($tableposts.ID = $tablepost2cat.post_id) LEFT JOIN $tablecategories ON ($tablepost2cat.category_id = $tablecategories.cat_ID) "; 173 $whichcat = " AND (category_nicename = '$category_name') "; 174 } 175 165 176 // author stuff 166 177 if ((empty($author)) || ($author == 'all') || ($author == '0')) { … … 294 305 else 295 306 $where .= ')'; 296 $request = " SELECT $distinct * FROM $tableposts WHERE 1=1".$where." ORDER BY post_$orderby $limits";307 $request = " SELECT $distinct * FROM $tableposts $join WHERE 1=1".$where." ORDER BY post_$orderby $limits"; 297 308 298 309
Note: See TracChangeset
for help on using the changeset viewer.