Changeset 1664
- Timestamp:
- 09/15/2004 03:09:39 PM (20 years ago)
- Location:
- trunk
- Files:
-
- 1 deleted
- 11 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-admin/admin-footer.php
r1496 r1664 4 4 <?php printf(__('%s seconds'), number_format(timer_stop(), 2)); ?> 5 5 </p> 6 <p> <a href="http://getfirefox.com/" title="<?php _e('WordPress recommends the open-source Firefox browser') ?>"><img src="http://www.mozilla.org/products/firefox/buttons/getfirefox_88x31.png" width="88" height="31" alt="Get Firefox" /></a></p> 6 7 <p><a href="http://spreadfirefox.com/community/?q=affiliates&id=2490&t=1" title="<?php _e('WordPress recommends the open-source Firefox browser') ?>"><img src="http://static.wordpress.org/get-firefox.png" alt="Get Firefox" /></a></p> 7 8 </div> 9 8 10 <?php do_action('admin_footer', ''); ?> 11 9 12 </body> 10 13 </html> -
trunk/wp-admin/edit-form-advanced.php
r1656 r1664 115 115 //--> 116 116 </script> 117 <?php118 if ($action != 'editcomment') {119 if (get_settings('use_geo_positions')) {120 if (empty($edited_lat)) {121 if (get_settings('use_default_geourl')) {122 $edited_lat = get_settings('default_geourl_lat');123 $edited_lon = get_settings('default_geourl_lon');124 }125 }126 ?>127 <br />128 <fieldset id="post_lat_lon">129 <label for="post_latf"><?php _e('Latitude:') ?></label><input size="8" type="text" value="<?php echo $edited_lat; ?>" name="post_latf" id="post_latf" /> 130 <label for="post_lonf"><?php _e('Longitude:') ?></label><input size="8" type="text" value="<?php echo $edited_lon; ?>" name="post_lonf" id="post_lonf" /> <a href="http://www.geourl.org/resources.html" rel="external"><?php _e('click for Geo Info') ?></a>131 </fieldset>132 <br />133 <?php134 }135 }136 ?>137 117 138 118 <?php echo $form_pingback ?> 139 119 <?php echo $form_prevstatus ?> 140 120 <?php echo $form_trackback; ?> 141 142 121 143 122 -
trunk/wp-admin/options-misc.php
r1599 r1664 48 48 <form name="miscoptions" method="post" action="options.php"> 49 49 <input type="hidden" name="action" value="update" /> 50 <input type="hidden" name="page_options" value="'hack_file','use_fileupload','fileupload_realpath','fileupload_url','fileupload_allowedtypes','fileupload_maxk','fileupload_maxk','fileupload_minlevel','use_geo_positions','use_linksupdate','weblogs_xml_url','links_updated_date_format','links_recently_updated_prepend','links_recently_updated_append' ,'default_geourl_lat','default_geourl_lon','use_default_geourl'" />50 <input type="hidden" name="page_options" value="'hack_file','use_fileupload','fileupload_realpath','fileupload_url','fileupload_allowedtypes','fileupload_maxk','fileupload_maxk','fileupload_minlevel','use_geo_positions','use_linksupdate','weblogs_xml_url','links_updated_date_format','links_recently_updated_prepend','links_recently_updated_append'" /> 51 51 <fieldset class="options"> 52 52 <legend> … … 124 124 <p><?php printf(__('A link is "recent" if it has been updated in the past %s minutes.'), '<input name="links_recently_updated_time" type="text" id="links_recently_updated_time" size="3" value="' . get_settings('links_recently_updated_time'). '" />' ) ?></p> 125 125 </fieldset> 126 <fieldset class="options"> 127 <legend> 128 <input name="use_geo_positions" type="checkbox" id="use_geo_positions" value="1" <?php checked('1', get_settings('use_geo_positions')); ?> /> 129 <label for="use_geo_positions"><?php _e('Use Geographic Tracking Features') ?></label></legend> 130 <table width="100%" cellspacing="2" cellpadding="5" class="editform"> 131 <tr> 132 <th width="33%" valign="top" scope="row"><?php _e('Default latitude:') ?> </th> 133 <td> 134 <input name="default_geourl_lat" type="text" id="default_geourl_lat" value="<?php form_option('default_geourl_lat'); ?>" size="50" /> 135 </td> 136 </tr> 137 <tr> 138 <th valign="top" scope="row"><?php _e('Default longitude:') ?> </th> 139 <td> 140 <input name="default_geourl_lon" type="text" id="default_geourl_lon" value="<?php form_option('default_geourl_lon'); ?>" size="50" /> 141 </td> 142 </tr> 143 <tr> 144 <th scope="row"> </th> 145 <td><label> 146 <input type="checkbox" name="use_default_geourl" value="1" <?php checked('1', get_settings('use_default_geourl')); ?> /> 147 <?php _e('Use default location values if none specified.') ?></label></td> 148 </tr> 149 </table> 150 </fieldset> 126 151 127 <p> 152 128 <label><input type="checkbox" name="hack_file" value="1" <?php checked('1', get_settings('hack_file')); ?> /> <?php _e('Use legacy <code>my-hacks.php</code> file support') ?></label> -
trunk/wp-admin/options-permalink.php
r1599 r1664 5 5 $parent_file = 'options-general.php'; 6 6 7 $wpvarstoreset = array('action','standalone', 'option_group_id'); 8 for ($i=0; $i<count($wpvarstoreset); $i += 1) { 9 $wpvar = $wpvarstoreset[$i]; 10 if (!isset($$wpvar)) { 11 if (empty($_POST["$wpvar"])) { 12 if (empty($_GET["$wpvar"])) { 13 $$wpvar = ''; 14 } else { 15 $$wpvar = $_GET["$wpvar"]; 16 } 17 } else { 18 $$wpvar = $_POST["$wpvar"]; 19 } 20 } 21 } 7 require_once('./admin-header.php'); 8 if ($user_level <= 8) 9 die(__('You have do not have sufficient permissions to edit the options for this blog.')); 10 11 require('./options-head.php'); 22 12 23 13 $home = get_settings('home'); 24 if ( $home != '' && $home != get_settings('siteurl')) {25 26 27 28 14 if ( $home != '' && $home != get_settings('siteurl') ) { 15 $home_path = parse_url($home); 16 $home_path = $home_root['path']; 17 $root = str_replace($_SERVER["PHP_SELF"], '', $_SERVER["PATH_TRANSLATED"]); 18 $home_path = $root . $home_path . "/"; 29 19 } else { 30 20 $home_path = ABSPATH; 31 21 } 32 22 … … 42 32 } 43 33 34 if ( (!file_exists($home_path.'.htaccess') && is_writable($home_path)) || is_writable($home_path.'.htaccess') ) 35 $writable = true; 36 else 37 $writable = false; 44 38 39 if ( strstr($permalink_structure, 'index.php') ) // If they're using 40 $usingpi = true; 41 else 42 $usingpi = false; 45 43 46 require_once('admin-header.php'); 47 if ($user_level <= 6) { 48 die(__("You have do not have sufficient permissions to edit the options for this blog.")); 49 } 50 require('./options-head.php'); 44 if ( $writable && !$usingpi && $is_apache ) { 45 $rules = explode("\n", mod_rewrite_rules($permalink_structure)); 46 insert_with_markers($home_path.'.htaccess', 'WordPress', $rules); 47 } 51 48 ?> 49 52 50 <?php if (isset($_POST['submit'])) : ?> 53 51 <div class="updated"><p><?php _e('Permalink structure updated.'); ?></p></div> 54 52 <?php endif; ?> 55 53 56 <?php if(isset($_POST['rules'])) {57 $rules = explode("\n", $_POST['rules']);58 if(insert_with_markers($home_path.'.htaccess', 'WordPress', $rules)) {59 ?>60 <div class="updated" id="htupdate"><p><?php _e('mod_rewrite rules written to .htaccess.'); ?></p></div>61 <?php62 } else {63 ?>64 <div class="updated" id="htupdate"><p><?php _e('Failed to write mod_rewrite rules to .htaccess.'); ?></p></div>65 <?php66 }67 }68 ?>69 70 54 <div class="wrap"> 71 55 <h2><?php _e('Edit Permalink Structure') ?></h2> 72 < ?php _e('<p>WordPress offers you the ability to create a custom URI structure for your permalinks and archives. The following “tags” are available:</p>')?>56 <p><?php _e('By default WordPress uses web URIs which have question marks and lots of numbers in them, however WordPress offers you the ability to create a custom URI structure for your permalinks and archives. This can improve the aesthetics, usability, and longevity of your links. A <a href="http://codex.wordpress.org/Permalink_Structure">number of tags are available</a>, and here are some examples to get you started.'); ?></p> 73 57 58 <?php if ($is_apache) : ?> 74 59 <dl> 75 <dt><code>%year%</code></dt> 76 <dd> 77 <?php _e('The year of the post, 4 digits, for example <code>2004</code>') ?> 78 </dd> 79 <dt><code>%monthnum%</code></dt> 80 <dd> 81 <?php _e('Month of the year, for example <code>05</code>') ?> 82 </dd> 83 <dt><code>%day%</code></dt> 84 <dd> 85 <?php _e('Day of the month, for example <code>28</code>') ?> 86 </dd> 87 <dt><code>%hour%</code></dt> 88 <dd> 89 <?php _e('Hour of the day, for example <code>15</code>') ?> 90 </dd> 91 <dt><code>%minute%</code></dt> 92 <dd> 93 <?php _e('Minute of the hour, for example <code>43</code>') ?> 94 </dd> 95 <dt><code>%second%</code></dt> 96 <dd> 97 <?php _e('Second of the minute, for example <code>33</code>') ?> 98 </dd> 99 <dt><code>%postname%</code></dt> 100 <dd> 101 <?php _e('A sanitized version of the title of the post. So “This Is A Great Post!” becomes “<code>this-is-a-great-post</code>” in the URI') ?> 102 </dd> 103 <dt><code>%post_id%</code></dt> 104 <dd> 105 <?php _e('The unique ID # of the post, for example <code>423</code>') ?> 106 </dd> 107 <dt><code>%category%</code></dt> 108 <dd> 109 <?php _e('A sanitized version of the category name.') ?> 110 </dd> 111 <dt><code>%author%</code></dt> 112 <dd> 113 <?php _e('A sanitized version of the author name.') ?> 114 </dd> 60 <dt><?php _e('Structure'); ?>: <code>/%year%/%monthnum%/%day%/%postname%/</code></dt> 61 <strong> 62 <dd><?php _e('Result'); ?>: <code><?php echo get_settings('home') . '/' . date('Y') . '/' . date('m') . '/' . date('d') . '/sample-post/'; ?></code></dd> 63 </strong> 64 <dt><?php _e('Structure'); ?>: <code>/archives/%post_id%</code></dt> 65 <strong> 66 <dd><?php _e('Result'); ?>: <code><?php echo get_settings('home'); ?>/archives/123</code></dd> 67 </strong> 68 <dt></dt> 115 69 </dl> 116 70 117 <?php _e('<p>So for example a value like:</p> 118 <p><code>/archives/%year%/%monthnum%/%day%/%postname%/</code> </p> 119 <p>would give you a permalink like:</p> 120 <p><code>/archives/2003/05/23/my-cheese-sandwich/</code></p> 121 <p> In general for this you must use mod_rewrite, however if you put a filename at the beginning WordPress will attempt to use that to pass the arguments, for example:</p> 122 <p><code>/index.php/archives/%year%/%monthnum%/%day%/%postname%/</code> </p> 123 <p>If you use this option you can ignore the mod_rewrite rules.</p>') ?> 71 <p><?php _e('For the above to work you must have something called <code>mod_rewrite</code> installed on your server. (Ask your host.) If that isn’t available, you can prefix the structure with <code>/index.php/</code> . This is the recommend method if you are on any web server but Apache.'); ?></p> 72 73 <?php else : ?> 74 <dl> 75 <dt><?php _e('Structure'); ?>: <code>/index.php/%year%/%monthnum%/%day%/%postname%/</code></dt> 76 <strong> 77 <dd><?php _e('Result'); ?>: <code><?php echo get_settings('home') . '/index.php/' . date('Y') . '/' . date('m') . '/' . date('d') . '/sample-post/'; ?></code></dd> 78 </strong> 79 <dt><?php _e('Structure'); ?>: <code>/index.php/archives/%post_id%</code></dt> 80 <strong> 81 <dd><?php _e('Result'); ?>: <code><?php echo get_settings('home'); ?>/index.php/archives/123</code></dd> 82 </strong> 83 <dt></dt> 84 </dl> 85 <?php endif; ?> 86 124 87 <form name="form" action="options-permalink.php" method="post"> 125 88 <p><?php _e('Use the template tags above to create a virtual site structure:') ?></p> 126 89 <p> 127 < input name="permalink_structure" type="text" style="width: 98%;" value="<?php echo $permalink_structure; ?>" />90 <?php _e('Structure'); ?>: <input name="permalink_structure" type="text" class="code" style="width: 60%;" value="<?php echo $permalink_structure; ?>" size="50" /> 128 91 </p> 129 92 <p><?php _e('If you like, you may enter a custom prefix for your category URIs here. For example, <code>/taxonomy/categorias</code> would make your category links like <code>http://example.org/taxonomy/categorias/general/</code>. If you leave this blank the default will be used.') ?></p> 130 93 <p> 131 < input name="category_base" type="text" style="width: 98%;" value="<?php echo $category_base; ?>" />94 <?php _e('Category base'); ?>: <input name="category_base" type="text" class="code" value="<?php echo $category_base; ?>" size="30" /> 132 95 </p> 133 96 <p class="submit"> … … 135 98 </p> 136 99 </form> 137 <?php 138 if ($permalink_structure) { 139 ?> 140 <p><?php printf(__('Using the permalink structure value you currently have, <code>%s</code>, these are the mod_rewrite rules you should have in your <code>.htaccess</code> file. Click in the field and press <kbd>CTRL + a</kbd> to select all.'), $permalink_structure) ?></p> 100 <?php if ( $permalink_structure && !$usingpi && !$writable ) : ?> 101 <p><?php _e('If your <code>.htaccess</code> was <a href="http://codex.wordpress.org/Make_a_Directory_Writable">writable</a> we could do this automatically, but it isn’t so these are the mod_rewrite rules you should have in your <code>.htaccess</code> file. Click in the field and press <kbd>CTRL + a</kbd> to select all.') ?></p> 141 102 <form action="options-permalink.php" method="post"> 142 103 <p> … … 144 105 </textarea> 145 106 </p> 146 <?php 107 <?php endif; ?> 108 </form> 147 109 148 if ((! file_exists($home_path.'.htaccess') && is_writable($home_path)) || is_writable($home_path.'.htaccess')) {149 ?>150 <p class="submit">151 <input type="submit" name="writerules" value="<?php _e('Write mod_rewrite rules to .htaccess »') ?>">152 </p>153 <?php } ?>154 </form>155 156 <?php157 } else {158 ?>159 <p>160 <?php _e('You are not currently using customized permalinks. No special mod_rewrite rules are needed.') ?>161 </p>162 <?php } ?>163 110 </div> 164 111 165 <?php 166 require('./admin-footer.php'); 167 ?> 112 <?php require('./admin-footer.php'); ?> -
trunk/wp-admin/options-writing.php
r1656 r1664 5 5 $parent_file = 'options-general.php'; 6 6 7 function add_magic_quotes($array) {8 foreach ($array as $k => $v) {9 if (is_array($v)) {10 $array[$k] = add_magic_quotes($v);11 } else {12 $array[$k] = addslashes($v);13 }14 }15 return $array;16 }17 18 if (!get_magic_quotes_gpc()) {19 $_GET = add_magic_quotes($_GET);20 $_POST = add_magic_quotes($_POST);21 $_COOKIE = add_magic_quotes($_COOKIE);22 }23 24 $wpvarstoreset = array('action','standalone', 'option_group_id');25 for ($i=0; $i<count($wpvarstoreset); $i += 1) {26 $wpvar = $wpvarstoreset[$i];27 if (!isset($$wpvar)) {28 if (empty($_POST["$wpvar"])) {29 if (empty($_GET["$wpvar"])) {30 $$wpvar = '';31 } else {32 $$wpvar = $_GET["$wpvar"];33 }34 } else {35 $$wpvar = $_POST["$wpvar"];36 }37 }38 }39 40 41 42 7 $standalone = 0; 43 include_once(' admin-header.php');44 include(' options-head.php');8 include_once('./admin-header.php'); 9 include('./options-head.php'); 45 10 ?> 46 11 … … 93 58 <label for="new_users_can_blog2"><input name="new_users_can_blog" id="new_users_can_blog2" type="radio" value="2" <?php checked('2', get_settings('new_users_can_blog')); ?> /> <?php _e('May publish articles') ?></label><br /></td> 94 59 </tr> 95 </table> 96 <fieldset class="options"> 60 </table> 61 62 <fieldset class="options"> 97 63 <legend><?php _e('Update Services') ?></legend> 98 <p><?php printf(__(' Enter the sites that you would like to notify when you publish a new post. For a list of some recommended sites to ping please see <a href="%s">Update Services</a> on the wiki. Separate multiple URIs by line breaks.'), 'http://wiki.wordpress.org/index.php/UpdateServices') ?></p>64 <p><?php printf(__('When you publish a new post WordPress can notify site update services. For more about this see <a href="%s">Update Services</a> on the Codex. Separate multiple service URIs with line breaks.'), 'http://codex.wordpress.org/Update_Services') ?></p> 99 65 100 66 <textarea name="ping_sites" id="ping_sites" style="width: 98%;"><?php form_option('ping_sites'); ?></textarea> 101 </fieldset> 102 <fieldset class="options"> 67 </fieldset> 68 69 <fieldset class="options"> 103 70 <legend><?php _e('Writing by e-mail') ?></legend> 104 71 <p><?php printf(__('To post to WordPress by e-mail you must set up a secret e-mail account with POP3 access. Any mail received at this address will be posted, so it’s a good idea to keep this address very secret. Here are three random strings you could use: <code>%s</code>, <code>%s</code>, <code>%s</code>.'), substr(md5(uniqid(microtime())),0,5), substr(md5(uniqid(microtime())),0,5), substr(md5(uniqid(microtime())),0,5)) ?></p> 105 72 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 73 <table width="100%" cellspacing="2" cellpadding="5" class="editform"> 74 <tr valign="top"> 75 <th scope="row"><?php _e('Mail server:') ?></th> 76 <td><input name="mailserver_url" type="text" id="mailserver_url" value="<?php form_option('mailserver_url'); ?>" size="40" /> 77 <label for="port"><?php _e('Port:') ?></label> 78 <input name="mailserver_port" type="text" id="mailserver_port" value="<?php form_option('mailserver_port'); ?>" size="6" /> 79 </td> 80 </tr> 81 <tr valign="top"> 82 <th width="33%" scope="row"><?php _e('Login name:') ?></th> 83 <td><input name="mailserver_login" type="text" id="mailserver_login" value="<?php form_option('mailserver_login'); ?>" size="40" /></td> 84 </tr> 85 <tr valign="top"> 86 <th scope="row"><?php _e('Password:') ?></th> 87 <td> 88 <input name="mailserver_pass" type="text" id="mailserver_pass" value="<?php form_option('mailserver_pass'); ?>" size="40" /> 89 </td> 90 </tr> 91 <tr valign="top"> 92 <th scope="row"><?php _e('Default post by mail category:') ?></th> 93 <td><select name="default_email_category" id="default_email_category"> 127 94 <?php 128 95 //Alreay have $categories from default_category … … 130 97 if ($category->cat_ID == get_settings('default_email_category')) $selected = " selected='selected'"; 131 98 else $selected = ''; 132 99 echo "\n\t<option value='$category->cat_ID' $selected>$category->cat_name</option>"; 133 100 endforeach; 134 101 ?> 135 136 137 138 139 140 141 </p> 142 102 </select></td> 103 </tr> 104 </table> 105 </fieldset> 106 <p class="submit"> 107 <input type="submit" name="Submit" value="<?php _e('Update Options') ?> »" /> 108 </p> 109 </form> 143 110 </div> 144 <?php include("admin-footer.php") ?> 111 112 <?php include('./admin-footer.php') ?> -
trunk/wp-admin/post.php
r1656 r1664 55 55 $post_title = $_POST['post_title']; 56 56 $post_categories = $_POST['post_category']; 57 if(get_settings('use_geo_positions')) {58 $latstr = $_POST['post_latf'];59 $lonstr = $_POST['post_lonf'];60 if((strlen($latstr) > 2) && (strlen($lonstr) > 2 ) ) {61 $post_latf = floatval($_POST['post_latf']);62 $post_lonf = floatval($_POST['post_lonf']);63 }64 }65 57 $post_status = $_POST['post_status']; 66 58 $post_name = $_POST['post_name']; … … 113 105 if ('' != $_POST['savepage']) $post_status = 'static'; 114 106 115 if((get_settings('use_geo_positions')) && (strlen($latstr) > 2) && (strlen($lonstr) > 2) ) {116 $postquery ="INSERT INTO $wpdb->posts117 (ID, post_author, post_date, post_date_gmt, post_content, post_title, post_lat, post_lon, post_excerpt, post_status, comment_status, ping_status, post_password, post_name, to_ping, post_modified, post_modified_gmt)118 VALUES119 ('0', '$user_ID', '$now', '$now_gmt', '$content', '$post_title', $post_latf, $post_lonf,'$excerpt', '$post_status', '$comment_status', '$ping_status', '$post_password', '$post_name', '$trackback', '$now', '$now_gmt')120 ";121 } else {122 107 $postquery ="INSERT INTO $wpdb->posts 123 108 (ID, post_author, post_date, post_date_gmt, post_content, post_title, post_excerpt, post_status, comment_status, ping_status, post_password, post_name, to_ping, post_modified, post_modified_gmt) … … 125 110 ('0', '$user_ID', '$now', '$now_gmt', '$content', '$post_title', '$excerpt', '$post_status', '$comment_status', '$ping_status', '$post_password', '$post_name', '$trackback', '$now', '$now_gmt') 126 111 "; 127 }128 112 129 113 $result = $wpdb->query($postquery); … … 179 163 180 164 if ($post_status == 'publish') { 181 if((get_settings('use_geo_positions')) && ($post_latf != null) && ($post_lonf != null)) {182 pingGeoUrl($post_ID);183 }184 165 185 166 if ($post_pingback) { … … 229 210 $content = $postdata->post_content; 230 211 $content = format_to_edit($content); 231 $edited_lat = $postdata->post_lat;232 $edited_lon = $postdata->post_lon;233 212 $excerpt = $postdata->post_excerpt; 234 213 $excerpt = format_to_edit($excerpt); … … 292 271 $excerpt = format_to_post($excerpt); 293 272 $post_title = $_POST['post_title']; 294 if(get_settings('use_geo_positions')) {295 $latf = floatval($_POST["post_latf"]);296 $lonf = floatval($_POST["post_lonf"]);297 $latlonaddition = "";298 if( ($latf != null) && ($latf <= 90 ) && ($latf >= -90) && ($lonf != null) && ($lonf <= 360) && ($lonf >= -360) ) {299 pingGeoUrl($post_ID);300 $latlonaddition = " post_lat=".$latf.", post_lon =".$lonf.", ";301 } else {302 $latlonaddition = " post_lat=null, post_lon=null, ";303 }304 } else {305 $latlonaddition = '';306 }307 273 $prev_status = $_POST['prev_status']; 308 274 $post_status = $_POST['post_status']; … … 370 336 post_title = '$post_title'" 371 337 .$datemodif_gmt 372 .$datemodif."," 373 .$latlonaddition." 374 338 .$datemodif.", 375 339 post_status = '$post_status', 376 340 comment_status = '$comment_status', … … 468 432 if ($user_level < $authordata->user_level) 469 433 die (sprintf(__('You don’t have the right to delete <strong>%s</strong>’s posts.'), $authordata[1])); 470 471 // send geoURL ping to "erase" from their DB472 $query = "SELECT post_lat from $wpdb->posts WHERE ID=$post_id";473 $rows = $wpdb->query($query);474 $myrow = $rows[0];475 $latf = $myrow->post_lat;476 if($latf != null ) {477 pingGeoUrl($post);478 }479 434 480 435 $result = $wpdb->query("DELETE FROM $wpdb->posts WHERE ID=$post_id"); -
trunk/wp-admin/upgrade-schema.php
r1638 r1664 106 106 post_category int(4) NOT NULL default '0', 107 107 post_excerpt text NOT NULL, 108 post_lat float default NULL,109 post_lon float default NULL,110 108 post_status enum('publish','draft','private','static') NOT NULL default 'publish', 111 109 comment_status enum('open','closed','registered_only') NOT NULL default 'open', … … 190 188 add_option('date_format', 'F j, Y'); 191 189 add_option('time_format', 'g:i a'); 192 add_option('use_geo_positions', 0);193 add_option('use_default_geourl', 0);194 add_option('default_geourl_lat', 0);195 add_option('default_geourl_lon', 0);196 190 add_option('weblogs_xml_url', 'http://static.wordpress.org/changes.xml'); 197 191 add_option('links_updated_date_format', 'F j, Y g:i a'); … … 220 214 221 215 // Delete unused options 222 $unusedoptions = array ('blodotgsping_url', 'bodyterminator', 'emailtestonly', 'phoneemail_separator', 'smilies_directory', 'subjectprefix', 'use_bbcode', 'use_blodotgsping', 'use_phoneemail', 'use_quicktags', 'use_weblogsping', 'weblogs_cache_file', 'use_preview', 'use_htmltrans', 'smilies_directory', 'rss_language', 'fileupload_allowedusers', 'use_phoneemail', 'default_post_status', 'default_post_category', 'archive_mode', 'time_difference', 'links_minadminlevel', 'links_use_adminlevels', 'links_rating_type', 'links_rating_char', 'links_rating_ignore_zero', 'links_rating_single_image', 'links_rating_image0', 'links_rating_image1', 'links_rating_image2', 'links_rating_image3', 'links_rating_image4', 'links_rating_image5', 'links_rating_image6', 'links_rating_image7', 'links_rating_image8', 'links_rating_image9', 'weblogs_cacheminutes', 'comment_allowed_tags', 'search_engine_friendly_urls' );216 $unusedoptions = array ('blodotgsping_url', 'bodyterminator', 'emailtestonly', 'phoneemail_separator', 'smilies_directory', 'subjectprefix', 'use_bbcode', 'use_blodotgsping', 'use_phoneemail', 'use_quicktags', 'use_weblogsping', 'weblogs_cache_file', 'use_preview', 'use_htmltrans', 'smilies_directory', 'rss_language', 'fileupload_allowedusers', 'use_phoneemail', 'default_post_status', 'default_post_category', 'archive_mode', 'time_difference', 'links_minadminlevel', 'links_use_adminlevels', 'links_rating_type', 'links_rating_char', 'links_rating_ignore_zero', 'links_rating_single_image', 'links_rating_image0', 'links_rating_image1', 'links_rating_image2', 'links_rating_image3', 'links_rating_image4', 'links_rating_image5', 'links_rating_image6', 'links_rating_image7', 'links_rating_image8', 'links_rating_image9', 'weblogs_cacheminutes', 'comment_allowed_tags', 'search_engine_friendly_urls', 'default_geourl_lat', 'default_geourl_lon', 'use_default_geourl'); 223 217 foreach ($unusedoptions as $option) : 224 218 delete_option($option); -
trunk/wp-includes/functions.php
r1637 r1664 401 401 'Title' => $post->post_title, 402 402 'Category' => $post->post_category, 403 'Lat' => $post->post_lat,404 'Lon' => $post->post_lon,405 403 'post_status' => $post->post_status, 406 404 'comment_status' => $post->comment_status, … … 826 824 } 827 825 828 function doGeoUrlHeader($post_list = '') {829 global $posts;830 831 if (get_settings('use_geo_positions')) {832 if ($posts && 1 === count($posts) && ! empty($posts[0]->post_lat)) {833 // there's only one result see if it has a geo code834 $row = $posts[0];835 $lat = $row->post_lat;836 $lon = $row->post_lon;837 $title = $row->post_title;838 if(($lon != null) && ($lat != null) ) {839 echo "<meta name=\"ICBM\" content=\"".$lat.", ".$lon."\" />\n";840 echo "<meta name=\"DC.title\" content=\"".convert_chars(strip_tags(htmlspecialchars(get_bloginfo("name"))))." - ".$title."\" />\n";841 echo "<meta name=\"geo.position\" content=\"".$lat.";".$lon."\" />\n";842 return;843 }844 } else {845 if(get_settings('use_default_geourl')) {846 // send the default here847 echo "<meta name='ICBM' content=\"". get_settings('default_geourl_lat') .", ". get_settings('default_geourl_lon') ."\" />\n";848 echo "<meta name='DC.title' content=\"".convert_chars(strip_tags(htmlspecialchars(get_bloginfo("name"))))."\" />\n";849 echo "<meta name='geo.position' content=\"". get_settings('default_geourl_lat') .";". get_settings('default_geourl_lon') ."\" />\n";850 }851 }852 }853 }854 855 function getRemoteFile($host,$path) {856 $fp = fsockopen($host, 80, $errno, $errstr, 5);857 if ($fp) {858 fputs($fp,"GET $path HTTP/1.0\r\nHost: $host\r\n\r\n");859 while ($line = fgets($fp, 4096)) {860 $lines[] = $line;861 }862 fclose($fp);863 return $lines;864 } else {865 return false;866 }867 }868 869 function pingGeoURL($blog_ID) {870 871 $ourUrl = get_settings('home') ."/index.php?p=".$blog_ID;872 $host="geourl.org";873 $path="/ping/?p=".$ourUrl;874 getRemoteFile($host,$path);875 }876 877 826 /* wp_set_comment_status: 878 827 part of otaku42's comment moderation hack -
trunk/wp-includes/template-functions-comment.php
r1660 r1664 63 63 $blah = str_replace('%', $number, $more); 64 64 } 65 echo $blah;65 echo apply_filters('comments_number', $blah); 66 66 } 67 67 -
trunk/wp-includes/template-functions.php
r801 r1664 7 7 /***** Links *****/ 8 8 require($curpath . 'template-functions-links.php'); 9 10 /**** // Geo Tags ****/11 require($curpath . 'template-functions-geo.php');12 9 13 10 /***** Author tags *****/ -
trunk/wp-includes/vars.php
r1663 r1664 191 191 add_filter('the_content', 'wptexturize'); 192 192 add_filter('the_excerpt', 'wptexturize'); 193 add_action('wp_head', 'doGeoUrlHeader');194 193 ?>
Note: See TracChangeset
for help on using the changeset viewer.