Changeset 1246
- Timestamp:
- 05/09/2004 05:54:17 AM (22 years ago)
- File:
-
- 1 edited
-
trunk/wp-blog-header.php (modified) (12 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-blog-header.php
r1245 r1246 1 1 <?php 2 2 3 /* Including config and functions files */4 3 $curpath = dirname(__FILE__).'/'; 5 4 6 5 if (!file_exists($curpath . '/wp-config.php')) 7 die( "There doesn't seem to be a <code>wp-config.php</code> file. I need this before we can get started. Need more help? <a href='http://wordpress.org/docs/faq/#wp-config'>We got it</a>. You can <a href='wp-admin/install-config.php'>create a <code>wp-config.php</code> file through a web interface</a>, but this doesn't work for all server setups. The safest way is to manually create the file.");6 die(__("There doesn't seem to be a <code>wp-config.php</code> file. I need this before we can get started. Need more help? <a href='http://wordpress.org/docs/faq/#wp-config'>We got it</a>. You can <a href='wp-admin/install-config.php'>create a <code>wp-config.php</code> file through a web interface</a>, but this doesn't work for all server setups. The safest way is to manually create the file.")); 8 7 9 8 require_once($curpath . '/wp-config.php'); 10 9 11 / * Process PATH_INFO, if set. */10 // Process PATH_INFO, if set. 12 11 $path_info = array(); 13 12 if (! empty($_SERVER['PATH_INFO'])) { … … 71 70 72 71 73 / * Sending HTTP headers */72 // Sending HTTP headers 74 73 75 74 if (!isset($doing_rss) || !$doing_rss) { … … 104 103 } 105 104 106 / * Getting settings from db */105 // Getting settings from DB 107 106 if (isset($doing_rss) && $doing_rss == 1) 108 107 $posts_per_page=get_settings('posts_per_rss'); … … 113 112 $use_gzipcompression = get_settings('gzipcompression'); 114 113 115 / * First let's clear some variables */114 // First let's clear some variables 116 115 $whichcat = ''; 117 116 $whichauthor = ''; … … 189 188 } 190 189 191 // if a post number is specified, load that post190 // If a post number is specified, load that post 192 191 if (($p != '') && ($p != 'all')) { 193 192 $p = intval($p); … … 195 194 } 196 195 197 // if a search pattern is specified, load the posts that match196 // If a search pattern is specified, load the posts that match 198 197 if (!empty($s)) { 199 198 $s = addslashes_gpc($s); 200 199 $search = ' AND ('; 201 // puts spaces instead of commas 202 $s = preg_replace('/, +/', '', $s); 200 $s = preg_replace('/, +/', ' ', $s); 203 201 $s = str_replace(',', ' ', $s); 204 202 $s = str_replace('"', ' ', $s); … … 222 220 } 223 221 224 // category stuff222 // Category stuff 225 223 $dogs = $wpdb->get_results("SELECT * FROM $tablecategories WHERE 1=1"); 226 224 foreach ($dogs as $catt) { … … 261 259 $whichcat .= ')'; 262 260 if ($eq == '!=') { 263 $cat = '-'.$cat; // put back the knowledge that we are excluding a category.261 $cat = '-'.$cat; // Put back the knowledge that we are excluding a category. 264 262 } 265 263 } … … 271 269 $category_name = explode('/',$category_name); 272 270 if ($category_name[count($category_name)-1]) { 273 $category_name = $category_name[count($category_name)-1]; #no trailing slash271 $category_name = $category_name[count($category_name)-1]; // no trailing slash 274 272 } else { 275 $category_name = $category_name[count($category_name)-2]; #there was a trailling slash276 } 277 } 278 $category_name = preg_replace('|[^a-z0-9-]| ', '', $category_name);273 $category_name = $category_name[count($category_name)-2]; // there was a trailling slash 274 } 275 } 276 $category_name = preg_replace('|[^a-z0-9-]|i', '', $category_name); 279 277 $tables = ", $tablepost2cat, $tablecategories"; 280 278 $join = " LEFT JOIN $tablepost2cat ON ($tableposts.ID = $tablepost2cat.post_id) LEFT JOIN $tablecategories ON ($tablepost2cat.category_id = $tablecategories.cat_ID) "; … … 286 284 287 285 // Author/user stuff 288 $users = $wpdb->get_results("SELECT * FROM $tableusers WHERE 1=1");286 $users = $wpdb->get_results("SELECT * FROM $tableusers WHERE user_level > 0"); 289 287 foreach ($users as $user) { 290 288 $cache_userdata[$user->ID] = $user; … … 335 333 } 336 334 337 // order by stuff335 // Order by 338 336 if (empty($orderby)) { 339 337 $orderby='date '.$order; 340 338 } else { 341 // used to filter values339 // Used to filter values 342 340 $allowed_keys = array('author','date','category','title'); 343 341 $orderby = urldecode($orderby); … … 521 519 } 522 520 } 523 } // end if posts.521 } // End if posts. 524 522 ?>
Note: See TracChangeset
for help on using the changeset viewer.