Make WordPress Core

Changeset 1664


Ignore:
Timestamp:
09/15/2004 03:09:39 PM (22 years ago)
Author:
saxmatt
Message:

Axing of geo stuff, major cleanups on permalink options, style tweaks.

Location:
trunk
Files:
1 deleted
11 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/admin-footer.php

    r1496 r1664  
    44<?php printf(__('%s seconds'), number_format(timer_stop(), 2)); ?>
    55</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&amp;id=2490&amp;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>
    78</div>
     9
    810<?php do_action('admin_footer', ''); ?>
     11
    912</body>
    1013</html>
  • trunk/wp-admin/edit-form-advanced.php

    r1656 r1664  
    115115//-->
    116116</script>
    117 <?php
    118 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" />&nbsp;
    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" />&nbsp; <a href="http://www.geourl.org/resources.html" rel="external"><?php _e('click for Geo Info') ?></a>
    131 </fieldset>
    132 <br />
    133 <?php
    134     }
    135 }
    136 ?>
    137117
    138118<?php echo $form_pingback ?>
    139119<?php echo $form_prevstatus ?>
    140120<?php echo $form_trackback; ?>
    141 
    142121
    143122
  • trunk/wp-admin/options-misc.php

    r1599 r1664  
    4848<form name="miscoptions" method="post" action="options.php">
    4949        <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'" />
    5151        <fieldset class="options">
    5252        <legend>
     
    124124        <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>
    125125        </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
    151127        <p>
    152128        <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  
    55$parent_file = 'options-general.php';
    66
    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 }
     7require_once('./admin-header.php');
     8if ($user_level <= 8)
     9        die(__('You have do not have sufficient permissions to edit the options for this blog.'));
     10
     11require('./options-head.php');
    2212
    2313$home = get_settings('home');
    24 if ($home != '' && $home != get_settings('siteurl')) {
    25   $home_path = parse_url($home);
    26   $home_path = $home_root['path'];
    27   $root = str_replace($_SERVER["PHP_SELF"], '', $_SERVER["PATH_TRANSLATED"]);
    28   $home_path = $root . $home_path . "/";
     14if ( $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 . "/";
    2919} else {
    30   $home_path = ABSPATH;
     20        $home_path = ABSPATH;
    3121}
    3222
     
    4232}
    4333
     34if ( (!file_exists($home_path.'.htaccess') && is_writable($home_path)) || is_writable($home_path.'.htaccess') )
     35        $writable = true;
     36else
     37        $writable = false;
    4438
     39if ( strstr($permalink_structure, 'index.php') ) // If they're using
     40        $usingpi = true;
     41else
     42        $usingpi = false;
    4543
    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');
     44if ( $writable && !$usingpi && $is_apache ) {
     45        $rules = explode("\n", mod_rewrite_rules($permalink_structure));
     46        insert_with_markers($home_path.'.htaccess', 'WordPress', $rules);
     47}
    5148?>
     49
    5250<?php if (isset($_POST['submit'])) : ?>
    5351<div class="updated"><p><?php _e('Permalink structure updated.'); ?></p></div>
    5452<?php endif; ?>
    5553
    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 <?php
    62                 } else {
    63 ?>
    64 <div class="updated" id="htupdate"><p><?php _e('Failed to write mod_rewrite rules to .htaccess.'); ?></p></div>
    65 <?php
    66         }
    67         }
    68 ?>
    69 
    7054<div class="wrap">
    7155  <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 &#8220;tags&#8221; 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>
    7357
     58<?php if ($is_apache) : ?>
    7459<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 &#8220;This Is A Great Post!&#8221; becomes &#8220;<code>this-is-a-great-post</code>&#8221; 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>
    11569</dl>
    11670
    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&#8217;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
    12487  <form name="form" action="options-permalink.php" method="post">
    12588    <p><?php _e('Use the template tags above to create a virtual site structure:') ?></p>
    12689    <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" />
    12891    </p>
    12992        <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>
    13093        <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" />
    13295     </p>
    13396    <p class="submit">
     
    13598    </p>
    13699  </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&#8217;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>
    141102<form action="options-permalink.php" method="post">
    142103   <p>
     
    144105</textarea>
    145106    </p>
    146 <?php
     107<?php endif; ?>
     108</form>
    147109
    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 &raquo;') ?>">
    152         </p>
    153 <?php } ?>
    154 </form>
    155  
    156 <?php
    157 } 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 } ?>
    163110</div>
    164111
    165 <?php
    166 require('./admin-footer.php');
    167 ?>
     112<?php require('./admin-footer.php'); ?>
  • trunk/wp-admin/options-writing.php

    r1656 r1664  
    55$parent_file = 'options-general.php';
    66
    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 
    427$standalone = 0;
    43 include_once('admin-header.php');
    44 include('options-head.php');
     8include_once('./admin-header.php');
     9include('./options-head.php');
    4510?>
    4611
     
    9358<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>
    9459      </tr>
    95     </table>
    96     <fieldset class="options">
     60    </table>
     61
     62<fieldset class="options">
    9763        <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>
    9965       
    10066        <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">
    10370        <legend><?php _e('Writing by e-mail') ?></legend>
    10471        <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&#8217;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>
    10572       
    106                 <table width="100%" cellspacing="2" cellpadding="5" class="editform">
    107                 <tr valign="top">
    108                 <th scope="row"><?php _e('Mail server:') ?></th>
    109                         <td><input name="mailserver_url" type="text" id="mailserver_url" value="<?php form_option('mailserver_url'); ?>" size="40" />
    110                 <label for="port"><?php _e('Port:') ?></label>
    111                                 <input name="mailserver_port" type="text" id="mailserver_port" value="<?php form_option('mailserver_port'); ?>" size="6" />
    112                         </td>
    113                 </tr>
    114                 <tr valign="top">
    115                 <th width="33%" scope="row"><?php _e('Login name:') ?></th>
    116                         <td><input name="mailserver_login" type="text" id="mailserver_login" value="<?php form_option('mailserver_login'); ?>" size="40" /></td>
    117                 </tr>
    118                 <tr valign="top">
    119                 <th scope="row"><?php _e('Password:') ?></th>
    120                         <td>
    121                                 <input name="mailserver_pass" type="text" id="mailserver_pass" value="<?php form_option('mailserver_pass'); ?>" size="40" />
    122                         </td>
    123                 </tr>
    124                 <tr valign="top">
    125                 <th scope="row"><?php _e('Default post by mail category:') ?></th>
    126                         <td><select name="default_email_category" id="default_email_category">
     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">
    12794<?php
    12895//Alreay have $categories from default_category
     
    13097if ($category->cat_ID == get_settings('default_email_category')) $selected = " selected='selected'";
    13198else $selected = '';
    132         echo "\n\t<option value='$category->cat_ID' $selected>$category->cat_name</option>";
     99echo "\n\t<option value='$category->cat_ID' $selected>$category->cat_name</option>";
    133100endforeach;
    134101?>
    135                         </select></td>
    136                 </tr>
    137         </table>
    138                 </fieldset>
    139     <p class="submit">
    140       <input type="submit" name="Submit" value="<?php _e('Update Options') ?> &raquo;" />
    141     </p>
    142   </form>
     102                        </select></td>
     103                </tr>
     104        </table>
     105</fieldset>
     106<p class="submit">
     107        <input type="submit" name="Submit" value="<?php _e('Update Options') ?> &raquo;" />
     108</p>
     109</form>
    143110</div>
    144 <?php include("admin-footer.php") ?>
     111
     112<?php include('./admin-footer.php') ?>
  • trunk/wp-admin/post.php

    r1656 r1664  
    5555                $post_title = $_POST['post_title'];
    5656                $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                 }
    6557                $post_status = $_POST['post_status'];
    6658                $post_name = $_POST['post_name'];
     
    113105        if ('' != $_POST['savepage']) $post_status = 'static';
    114106
    115         if((get_settings('use_geo_positions')) && (strlen($latstr) > 2) && (strlen($lonstr) > 2) ) {
    116         $postquery ="INSERT INTO $wpdb->posts
    117                         (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                         VALUES
    119                         ('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 {
    122107        $postquery ="INSERT INTO $wpdb->posts
    123108                        (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)
     
    125110                        ('0', '$user_ID', '$now', '$now_gmt', '$content', '$post_title', '$excerpt', '$post_status', '$comment_status', '$ping_status', '$post_password', '$post_name', '$trackback', '$now', '$now_gmt')
    126111                        ";
    127         }
    128112
    129113        $result = $wpdb->query($postquery);
     
    179163
    180164        if ($post_status == 'publish') {
    181                 if((get_settings('use_geo_positions')) && ($post_latf != null) && ($post_lonf != null)) {
    182                         pingGeoUrl($post_ID);
    183                 }
    184165
    185166                if ($post_pingback) {
     
    229210                $content = $postdata->post_content;
    230211                $content = format_to_edit($content);
    231                 $edited_lat = $postdata->post_lat;
    232                 $edited_lon = $postdata->post_lon;
    233212                $excerpt = $postdata->post_excerpt;
    234213                $excerpt = format_to_edit($excerpt);
     
    292271                $excerpt = format_to_post($excerpt);
    293272                $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                 }
    307273                $prev_status = $_POST['prev_status'];
    308274                $post_status = $_POST['post_status'];
     
    370336                        post_title = '$post_title'"
    371337                        .$datemodif_gmt
    372                         .$datemodif.","
    373                         .$latlonaddition."
    374                        
     338                        .$datemodif.",                 
    375339                        post_status = '$post_status',
    376340                        comment_status = '$comment_status',
     
    468432        if ($user_level < $authordata->user_level)
    469433                die (sprintf(__('You don&#8217;t have the right to delete <strong>%s</strong>&#8217;s posts.'), $authordata[1]));
    470 
    471         // send geoURL ping to "erase" from their DB
    472         $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         }
    479434
    480435        $result = $wpdb->query("DELETE FROM $wpdb->posts WHERE ID=$post_id");
  • trunk/wp-admin/upgrade-schema.php

    r1638 r1664  
    106106  post_category int(4) NOT NULL default '0',
    107107  post_excerpt text NOT NULL,
    108   post_lat float default NULL,
    109   post_lon float default NULL,
    110108  post_status enum('publish','draft','private','static') NOT NULL default 'publish',
    111109  comment_status enum('open','closed','registered_only') NOT NULL default 'open',
     
    190188        add_option('date_format', 'F j, Y');
    191189        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);
    196190        add_option('weblogs_xml_url', 'http://static.wordpress.org/changes.xml');
    197191        add_option('links_updated_date_format', 'F j, Y g:i a');
     
    220214
    221215        // 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');
    223217        foreach ($unusedoptions as $option) :
    224218                delete_option($option);
  • trunk/wp-includes/functions.php

    r1637 r1664  
    401401                'Title' => $post->post_title,
    402402                'Category' => $post->post_category,
    403                 'Lat' => $post->post_lat,
    404                 'Lon' => $post->post_lon,
    405403                'post_status' => $post->post_status,
    406404                'comment_status' => $post->comment_status,
     
    826824}
    827825
    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 code
    834                         $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 here
    847                                 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 
    877826/* wp_set_comment_status:
    878827   part of otaku42's comment moderation hack
  • trunk/wp-includes/template-functions-comment.php

    r1660 r1664  
    6363        $blah = str_replace('%', $number, $more);
    6464    }
    65     echo $blah;
     65    echo apply_filters('comments_number', $blah);
    6666}
    6767
  • trunk/wp-includes/template-functions.php

    r801 r1664  
    77/***** Links *****/
    88require($curpath . 'template-functions-links.php');
    9 
    10 /**** // Geo Tags ****/
    11 require($curpath . 'template-functions-geo.php');
    129
    1310/***** Author tags *****/
  • trunk/wp-includes/vars.php

    r1663 r1664  
    191191add_filter('the_content', 'wptexturize');
    192192add_filter('the_excerpt', 'wptexturize');
    193 add_action('wp_head', 'doGeoUrlHeader');
    194193?>
Note: See TracChangeset for help on using the changeset viewer.