Changeset 470
- Timestamp:
- 10/26/2003 05:25:26 AM (22 years ago)
- Location:
- trunk
- Files:
-
- 1 added
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/b2-include/b2template.functions.php
r469 r470 1406 1406 1407 1407 /***** Permalink tags *****/ 1408 function get_permalink($id=false) { 1409 global $post; 1410 if (!$id) { 1411 if (get_settings('permalink_structure')) { 1412 $unixtime = strtotime($post->post_date); 1413 $rewritecode = array( 1414 '%year%', 1415 '%monthnum%', 1416 '%day%', 1417 '%postname%' 1418 ); 1419 $rewritereplace = array( 1420 date('Y', $unixtime), 1421 date('n', $unixtime), 1422 date('j', $unixtime), 1423 $post->post_name 1424 ); 1425 return str_replace($rewritecode, $rewritereplace, get_settings('permalink_structure')); 1426 } else { // if they're not using the fancy permalink option 1427 return $file.$querystring_start.'p'.$querystring_equal.$post->ID; 1428 } 1429 } 1430 } 1408 1431 1409 1432 function permalink_anchor($mode = 'id') { … … 1435 1458 break; 1436 1459 } 1437 $archive_mode = get_settings('archive_mode'); 1438 switch($archive_mode) { 1439 case 'daily': 1440 echo $file.$querystring_start.'m'.$querystring_equal.substr($post->post_date,0,4).substr($post->post_date,5,2).substr($postdata['Date'],8,2).'#post-'.$anchor; 1441 break; 1442 case 'monthly': 1443 echo $file.$querystring_start.'m'.$querystring_equal.substr($post->post_date,0,4).substr($post->post_date,5,2).'#post-'.$anchor; 1444 break; 1445 case 'weekly': 1446 if((!isset($cacheweekly)) || (empty($cacheweekly[$postdata['Date']]))) { 1447 $cacheweekly[$post->post_date] = $wpdb->get_var("SELECT WEEK('$post->post_date')"); 1448 ++$querycount; 1449 } 1450 echo $file.$querystring_start.'m'.$querystring_equal.substr($post->post_date,0,4).$querystring_separator.'w'.$querystring_equal.$cacheweekly[$post->post_date].'#post-'.$anchor; 1451 break; 1452 case 'postbypost': 1453 echo $file.$querystring_start.'p'.$querystring_equal.$id; 1454 break; 1455 } 1460 echo get_permalink(); 1456 1461 } 1457 1462 -
trunk/blog.header.php
r404 r470 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' );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', 'monthnum'); 17 17 18 18 for ($i=0; $i<count($b2varstoreset); $i += 1) { … … 83 83 } 84 84 85 if ($year != '') { 86 $year = '' . intval($year); 87 $where .= ' AND YEAR(post_date)=' . $year; 88 } 89 90 if ($monthnum != '') { 91 $monthnum = '' . intval($monthnum); 92 $where .= ' AND MONTH(post_date)=' . $monthnum; 93 } 94 95 if ($day != '') { 96 $hay = '' . intval($day); 97 $where .= ' AND DAYOFMONTH(post_date)=' . $day; 98 } 99 100 if ($name != '') { 101 $name = preg_replace('/[^a-z0-9-]/', '', $name); 102 $where .= " AND post_name = '$name'"; 103 } 104 85 105 if ($w != '') { 86 106 $w = ''.intval($w); 87 $where .= ' AND WEEK(post_date, 1)='.$w;107 $where .= ' AND WEEK(post_date, 1)=' . $w; 88 108 } 89 109 … … 207 227 } 208 228 209 if ( !empty($postend) && ($postend > $poststart) && (!$m) && (!$w) && (!$whichcat) && (!$s) && (!$p)) {229 if ( !empty($postend) && ($postend > $poststart) && (!$m) && !$month && !$year && !$day &&(!$w) && (!$whichcat) && (!$s) && (!$p)) { 210 230 if ($what_to_show == 'posts' || ($what_to_show == 'paged' && (!$paged))) { 211 231 $poststart = intval($poststart); … … 244 264 } 245 265 } 246 elseif (($m) || ($p) || ($w) || ($s) || ($whichcat) || ($author) ) {266 elseif (($m) || ($p) || ($w) || ($s) || ($whichcat) || ($author) || $month || $year || $day) { 247 267 $limits = ''; 248 268 } … … 282 302 } 283 303 284 // error_log("$request");285 // echo $request;304 // error_log("$request"); 305 // echo $request; 286 306 $posts = $wpdb->get_results($request); 307 308 if (1 == count($posts)) { 309 $more = 1; $c = 1; $single = 1; 310 } 287 311 ?> -
trunk/index.php
r415 r470 56 56 <?php include($abspath . 'b2comments.php'); ?> 57 57 58 <?php } } // end foreach, end if any posts ?> 59 58 <?php } } else { // end foreach, end if any posts ?> 59 <p>Sorry, no posts matched your criteria.</p> 60 <?php } ?> 60 61 </div> 61 62 -
trunk/wp-admin/upgrade-072-to-073.php
r467 r470 6 6 if (!$step) $step = 0; 7 7 if (!step) $step = 0; 8 update_option('blogdescription', 'hahahah'); 8 9 ?> 9 10 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> … … 77 78 } 78 79 80 $wpdb->query("INSERT INTO `$tableoptions` (`option_id`, `blog_id`, `option_name`, `option_can_override`, `option_type`, `option_value`, `option_width`, `option_height`, `option_description`, `option_admin_level`) VALUES ('', '0', 'permalink_structure', 'Y', '3', '', '20', '8', 'How the permalinks for your site are constructed.', '8');"); 79 81 ?> 80 82 <strong>Done.</strong> </p> -
trunk/wp-admin/wp-options.php
r344 r470 120 120 } // end for each group 121 121 ?> 122 <li><a href="wp-options-permalink.php">Permalinks</a></li> 122 123 </ul> 123 124 <br clear="all" />
Note: See TracChangeset
for help on using the changeset viewer.