[wp-cvs] wordpress/wp-includes functions-post.php, 1.5, 1.6 functions.php, 1.152, 1.153 links-update-xml.php, 1.6, 1.7 template-functions-general.php, 1.43, 1.44

Matthew Mullenweg saxmatt at users.sourceforge.net
Sun Sep 5 00:24:30 UTC 2004


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

Modified Files:
	functions-post.php functions.php links-update-xml.php 
	template-functions-general.php 
Log Message:
Massive options cleanup and another step of cleaning up the upgrade/install.

Index: functions.php
===================================================================
RCS file: /cvsroot/cafelog/wordpress/wp-includes/functions.php,v
retrieving revision 1.152
retrieving revision 1.153
diff -C2 -d -r1.152 -r1.153
*** functions.php	4 Sep 2004 22:15:46 -0000	1.152
--- functions.php	5 Sep 2004 00:24:28 -0000	1.153
***************
*** 314,317 ****
--- 314,325 ----
  }
  
+ function get_option($option) {
+ 	return get_settings($option);
+ }
+ 
+ function form_option($option) {
+ 	echo htmlspecialchars( get_option($option) );
+ }
+ 
  function get_alloptions() {
  	global $wpdb;
***************
*** 352,357 ****
  
  // thx Alex Stapleton, http://alex.vort-x.net/blog/
! function add_option($name, $value = '') {
! 	// Adds an option if it doesn't already exist
  	global $wpdb;
  	if ( is_array($value) || is_object($value) )
--- 360,364 ----
  
  // thx Alex Stapleton, http://alex.vort-x.net/blog/
! function add_option($name, $value = '', $description = '') {
  	global $wpdb;
  	if ( is_array($value) || is_object($value) )
***************
*** 361,365 ****
  		$name = $wpdb->escape($name);
  		$value = $wpdb->escape($value);
! 		$wpdb->query("INSERT INTO $wpdb->options (option_name, option_value) VALUES ('$name', '$value')");
  
  		if($wpdb->insert_id) {
--- 368,373 ----
  		$name = $wpdb->escape($name);
  		$value = $wpdb->escape($value);
! 		$description = $wpdb->escape($description);
! 		$wpdb->query("INSERT INTO $wpdb->options (option_name, option_value, option_description) VALUES ('$name', '$value', '$description')");
  
  		if($wpdb->insert_id) {

Index: links-update-xml.php
===================================================================
RCS file: /cvsroot/cafelog/wordpress/wp-includes/links-update-xml.php,v
retrieving revision 1.6
retrieving revision 1.7
diff -C2 -d -r1.6 -r1.7
*** links-update-xml.php	24 May 2004 08:22:18 -0000	1.6
--- links-update-xml.php	5 Sep 2004 00:24:28 -0000	1.7
***************
*** 59,63 ****
  			// is it old?
  			$modtime = filemtime($file);
! 			if ((time() - $modtime) > (get_settings('weblogs_cacheminutes') * 60)) {
  				$update = true;
  			}
--- 59,63 ----
  			// is it old?
  			$modtime = filemtime($file);
! 			if ((time() - $modtime) > (1.5 * 60)) {
  				$update = true;
  			}

Index: functions-post.php
===================================================================
RCS file: /cvsroot/cafelog/wordpress/wp-includes/functions-post.php,v
retrieving revision 1.5
retrieving revision 1.6
diff -C2 -d -r1.5 -r1.6
*** functions-post.php	4 Sep 2004 06:44:58 -0000	1.5
--- functions-post.php	5 Sep 2004 00:24:28 -0000	1.6
***************
*** 218,268 ****
  
  // get permalink from post ID
! function post_permalink($post_ID=0, $mode = 'id') {
!     global $wpdb;
! 	global $querystring_start, $querystring_equal, $querystring_separator;
! 
! 	$blog_URL = get_settings('home') .'/'. get_settings('blogfilename');
! 
! 	$postdata = get_postdata($post_ID);
! 
! 	// this will probably change to $blog_ID = $postdata['Blog_ID'] one day.
! 	$blog_ID = 1;
! 
! 	if (!($postdata===false)) {
! 	
! 		switch(strtolower($mode)) {
! 			case 'title':
! 				$title = preg_replace('/[^a-zA-Z0-9_\.-]/', '_', $postdata['Title']);
! 				break;
! 			case 'id':
! 			default:
! 				$title = "post-$post_ID";
! 				break;
! 		}
! 
! 		// this code is blatantly derived from permalink_link()
! 		$archive_mode = get_settings('archive_mode');
! 		switch($archive_mode) {
! 			case 'daily':
! 				$post_URL = $blog_URL.$querystring_start.'m'.$querystring_equal.substr($postdata['Date'],0,4).substr($postdata['Date'],5,2).substr($postdata['Date'],8,2).'#'.$title;
! 				break;
! 			case 'monthly':
! 				$post_URL = $blog_URL.$querystring_start.'m'.$querystring_equal.substr($postdata['Date'],0,4).substr($postdata['Date'],5,2).'#'.$title;
! 				break;
! 			case 'weekly':
! 				if((!isset($cacheweekly)) || (empty($cacheweekly[$postdata['Date']]))) {
! 					$sql = "SELECT WEEK('".$postdata['Date']."') as wk";
! 	                    $row = $wpdb->get_row($sql);
! 					$cacheweekly[$postdata['Date']] = $row->wk;
! 				}
! 				$post_URL = $blog_URL.$querystring_start.'m'.$querystring_equal.substr($postdata['Date'],0,4).$querystring_separator.'w'.$querystring_equal.$cacheweekly[$postdata['Date']].'#'.$title;
! 				break;
! 			case 'postbypost':
! 				$post_URL = $blog_URL.$querystring_start.'p'.$querystring_equal.$post_ID;
! 				break;
! 		}
! 	} 
! 
! 	return $post_URL;
  }
  
--- 218,223 ----
  
  // get permalink from post ID
! function post_permalink($post_id = 0, $mode = '') { // $mode legacy
! 	return get_permalink($post_id);
  }
  

Index: template-functions-general.php
===================================================================
RCS file: /cvsroot/cafelog/wordpress/wp-includes/template-functions-general.php,v
retrieving revision 1.43
retrieving revision 1.44
diff -C2 -d -r1.43 -r1.44
*** template-functions-general.php	3 Aug 2004 21:59:29 -0000	1.43
--- template-functions-general.php	5 Sep 2004 00:24:28 -0000	1.44
***************
*** 223,227 ****
  
      if ('' == $type) {
!         $type = get_settings('archive_mode');
      }
  
--- 223,227 ----
  
      if ('' == $type) {
!         $type = 'monthly';
      }
  




More information about the cvs mailing list