[wp-cvs] wordpress/wp-includes functions.php,1.148,1.149

Ryan Boren rboren at users.sourceforge.net
Fri Sep 3 04:29:13 UTC 2004


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

Modified Files:
	functions.php 
Log Message:
Send Geo Url Header only if use_geo_positions is set.  Bug 242. Patch from 2fargon.

Index: functions.php
===================================================================
RCS file: /cvsroot/cafelog/wordpress/wp-includes/functions.php,v
retrieving revision 1.148
retrieving revision 1.149
diff -C2 -d -r1.148 -r1.149
*** functions.php	30 Aug 2004 07:16:40 -0000	1.148
--- functions.php	3 Sep 2004 04:29:11 -0000	1.149
***************
*** 835,858 ****
      global $posts;
  
!     if ($posts && 1 === count($posts) && ! empty($posts[0]->post_lat)) {
!         // there's only one result  see if it has a geo code
!         $row = $posts[0];
!         $lat = $row->post_lat;
!         $lon = $row->post_lon;
!         $title = $row->post_title;
!         if(($lon != null) && ($lat != null) ) {
!             echo "<meta name=\"ICBM\" content=\"".$lat.", ".$lon."\" />\n";
!             echo "<meta name=\"DC.title\" content=\"".convert_chars(strip_tags(htmlspecialchars(get_bloginfo("name"))))." - ".$title."\" />\n";
!             echo "<meta name=\"geo.position\" content=\"".$lat.";".$lon."\" />\n";
!             return;
!         }
!     } else {
!         if(get_settings('use_default_geourl')) {
!             // send the default here 
!             echo "<meta name='ICBM' content=\"". get_settings('default_geourl_lat') .", ". get_settings('default_geourl_lon') ."\" />\n";
!             echo "<meta name='DC.title' content=\"".convert_chars(strip_tags(htmlspecialchars(get_bloginfo("name"))))."\" />\n";
!             echo "<meta name='geo.position' content=\"". get_settings('default_geourl_lat') .";". get_settings('default_geourl_lon') ."\" />\n";
!         }
!     }
  }
  
--- 835,860 ----
      global $posts;
  
!   if (get_settings('use_geo_positions')) {
! 		if ($posts && 1 === count($posts) && ! empty($posts[0]->post_lat)) {
! 			// there's only one result  see if it has a geo code
! 			$row = $posts[0];
! 			$lat = $row->post_lat;
! 			$lon = $row->post_lon;
! 			$title = $row->post_title;
! 			if(($lon != null) && ($lat != null) ) {
! 				echo "<meta name=\"ICBM\" content=\"".$lat.", ".$lon."\" />\n";
! 				echo "<meta name=\"DC.title\" content=\"".convert_chars(strip_tags(htmlspecialchars(get_bloginfo("name"))))." - ".$title."\" />\n";
! 				echo "<meta name=\"geo.position\" content=\"".$lat.";".$lon."\" />\n";
! 				return;
! 			}
! 		} else {
! 			if(get_settings('use_default_geourl')) {
! 				// send the default here 
! 				echo "<meta name='ICBM' content=\"". get_settings('default_geourl_lat') .", ". get_settings('default_geourl_lon') ."\" />\n";
! 				echo "<meta name='DC.title' content=\"".convert_chars(strip_tags(htmlspecialchars(get_bloginfo("name"))))."\" />\n";
! 				echo "<meta name='geo.position' content=\"". get_settings('default_geourl_lat') .";". get_settings('default_geourl_lon') ."\" />\n";
! 			}
! 		}
! 	}
  }
  




More information about the cvs mailing list