[wp-cvs] wordpress/wp-includes functions.php, 1.112, 1.113 template-functions-links.php, 1.17, 1.18

Ryan Boren rboren at users.sourceforge.net
Sat Jun 5 21:02:29 CDT 2004


Update of /cvsroot/cafelog/wordpress/wp-includes
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21518/wp-includes

Modified Files:
	functions.php template-functions-links.php 
Log Message:
Rewrite and %category% fixes.

Index: template-functions-links.php
===================================================================
RCS file: /cvsroot/cafelog/wordpress/wp-includes/template-functions-links.php,v
retrieving revision 1.17
retrieving revision 1.18
diff -C2 -d -r1.17 -r1.18
*** template-functions-links.php	4 Jun 2004 02:36:46 -0000	1.17
--- template-functions-links.php	6 Jun 2004 02:02:27 -0000	1.18
***************
*** 81,85 ****
          // If the permalink structure does not contain year and month, make
          // one that does.
!         if (! (strstr($permalink, '%year') && strstr($permalink, '%monthnum')) ) {
              $front = substr($permalink, 0, strpos($permalink, '%'));
              $permalink = $front . '%year%/%monthnum%/';
--- 81,86 ----
          // If the permalink structure does not contain year and month, make
          // one that does.
!         if (! (strstr($permalink, '%year%') && strstr($permalink, '%monthnum%'))
!             || preg_match('/%category%.*(%year%|%monthnum%|%day%)/', $permalink)) {
              $front = substr($permalink, 0, strpos($permalink, '%'));
              $permalink = $front . '%year%/%monthnum%/';
***************
*** 93,96 ****
--- 94,98 ----
          $monthlink = str_replace('%monthnum%', zeroise(intval($month), 2), $monthlink);
          $monthlink = str_replace('%post_id%', '', $monthlink);
+         $monthlink = str_replace('%category%', '', $monthlink);
          return get_settings('home') . $monthlink;
      } else {
***************
*** 109,113 ****
          // If the permalink structure does not contain year, month, and day,
          // make one that does.
!         if (! (strstr($permalink, '%year') && strstr($permalink, '%monthnum')) ) {
              $front = substr($permalink, 0, strpos($permalink, '%'));
              $permalink = $front . '%year%/%monthnum%/%day%/';
--- 111,116 ----
          // If the permalink structure does not contain year, month, and day,
          // make one that does.
!         if (! (strstr($permalink, '%year%') && strstr($permalink, '%monthnum%')&& strstr($permalink, '%day%'))
!             || preg_match('/%category%.*(%year%|%monthnum%|%day%)/', $permalink)) {
              $front = substr($permalink, 0, strpos($permalink, '%'));
              $permalink = $front . '%year%/%monthnum%/%day%/';
***************
*** 122,125 ****
--- 125,129 ----
          $daylink = str_replace('%day%', zeroise(intval($day), 2), $daylink);
          $daylink = str_replace('%post_id%', '', $daylink);
+         $daylink = str_replace('%category%', '', $daylink);
          return get_settings('home') . $daylink;
      } else {

Index: functions.php
===================================================================
RCS file: /cvsroot/cafelog/wordpress/wp-includes/functions.php,v
retrieving revision 1.112
retrieving revision 1.113
diff -C2 -d -r1.112 -r1.113
*** functions.php	2 Jun 2004 07:14:02 -0000	1.112
--- functions.php	6 Jun 2004 02:02:27 -0000	1.113
***************
*** 1239,1243 ****
               }
  
!     $structure = str_replace($front, '', $permalink_structure);
      $structure = trim($structure, '/');
      $dirs = explode('/', $structure);
--- 1239,1246 ----
               }
  
!     $structure = $permalink_structure;
!     if ($front != '/') {
!         $structure = str_replace($front, '', $structure);
!     }
      $structure = trim($structure, '/');
      $dirs = explode('/', $structure);
***************
*** 1313,1317 ****
      // separate archive rule.
      $doarchive = false;
!     if (! (strstr($permalink_structure, '%year') && strstr($permalink_structure, '%monthnum') && strstr($permalink_structure, '%day')) ) {
          $doarchive = true;
          $archive_structure = $front . '%year%/%monthnum%/%day%/';
--- 1316,1321 ----
      // separate archive rule.
      $doarchive = false;
!     if (! (strstr($permalink_structure, '%year%') && strstr($permalink_structure, '%monthnum%') && strstr($permalink_structure, '%day%')) ||
!         preg_match('/%category%.*(%year%|%monthnum%|%day%)/', $permalink_structure)) {
          $doarchive = true;
          $archive_structure = $front . '%year%/%monthnum%/%day%/';




More information about the cvs mailing list