mirror of
https://github.com/WordPress/WordPress.git
synced 2024-12-22 17:18:32 +01:00
Axing of geo stuff, major cleanups on permalink options, style tweaks.
git-svn-id: http://svn.automattic.com/wordpress/trunk@1664 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
e7e5b63493
commit
e8f22c65a2
@ -3,8 +3,11 @@
|
||||
<?php bloginfo('version'); ?> — <a href="http://wordpress.org/support/"><?php _e('Support Forums'); ?></a><br />
|
||||
<?php printf(__('%s seconds'), number_format(timer_stop(), 2)); ?>
|
||||
</p>
|
||||
<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>
|
||||
|
||||
<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>
|
||||
</div>
|
||||
|
||||
<?php do_action('admin_footer', ''); ?>
|
||||
|
||||
</body>
|
||||
</html>
|
@ -114,33 +114,12 @@ window.onload = focusit;
|
||||
edCanvas = document.getElementById('content');
|
||||
//-->
|
||||
</script>
|
||||
<?php
|
||||
if ($action != 'editcomment') {
|
||||
if (get_settings('use_geo_positions')) {
|
||||
if (empty($edited_lat)) {
|
||||
if (get_settings('use_default_geourl')) {
|
||||
$edited_lat = get_settings('default_geourl_lat');
|
||||
$edited_lon = get_settings('default_geourl_lon');
|
||||
}
|
||||
}
|
||||
?>
|
||||
<br />
|
||||
<fieldset id="post_lat_lon">
|
||||
<label for="post_latf"><?php _e('Latitude:') ?></label><input size="8" type="text" value="<?php echo $edited_lat; ?>" name="post_latf" id="post_latf" />
|
||||
<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>
|
||||
</fieldset>
|
||||
<br />
|
||||
<?php
|
||||
}
|
||||
}
|
||||
?>
|
||||
|
||||
<?php echo $form_pingback ?>
|
||||
<?php echo $form_prevstatus ?>
|
||||
<?php echo $form_trackback; ?>
|
||||
|
||||
|
||||
|
||||
<p class="submit"><?php echo $saveasdraft; ?> <input type="submit" name="submit" value="<?php _e('Save') ?>" style="font-weight: bold;" tabindex="6" />
|
||||
<?php
|
||||
if ('publish' != $post_status || 0 == $post_ID) {
|
||||
|
@ -47,7 +47,7 @@ include('options-head.php');
|
||||
<h2><?php _e('Miscellaneous Options') ?></h2>
|
||||
<form name="miscoptions" method="post" action="options.php">
|
||||
<input type="hidden" name="action" value="update" />
|
||||
<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'" />
|
||||
<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'" />
|
||||
<fieldset class="options">
|
||||
<legend>
|
||||
<input name="use_fileupload" type="checkbox" id="use_fileupload" value="1" <?php checked('1', get_settings('use_fileupload')); ?> />
|
||||
@ -123,31 +123,7 @@ include('options-head.php');
|
||||
</table>
|
||||
<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>
|
||||
</fieldset>
|
||||
<fieldset class="options">
|
||||
<legend>
|
||||
<input name="use_geo_positions" type="checkbox" id="use_geo_positions" value="1" <?php checked('1', get_settings('use_geo_positions')); ?> />
|
||||
<label for="use_geo_positions"><?php _e('Use Geographic Tracking Features') ?></label></legend>
|
||||
<table width="100%" cellspacing="2" cellpadding="5" class="editform">
|
||||
<tr>
|
||||
<th width="33%" valign="top" scope="row"><?php _e('Default latitude:') ?> </th>
|
||||
<td>
|
||||
<input name="default_geourl_lat" type="text" id="default_geourl_lat" value="<?php form_option('default_geourl_lat'); ?>" size="50" />
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th valign="top" scope="row"><?php _e('Default longitude:') ?> </th>
|
||||
<td>
|
||||
<input name="default_geourl_lon" type="text" id="default_geourl_lon" value="<?php form_option('default_geourl_lon'); ?>" size="50" />
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th scope="row"> </th>
|
||||
<td><label>
|
||||
<input type="checkbox" name="use_default_geourl" value="1" <?php checked('1', get_settings('use_default_geourl')); ?> />
|
||||
<?php _e('Use default location values if none specified.') ?></label></td>
|
||||
</tr>
|
||||
</table>
|
||||
</fieldset>
|
||||
|
||||
<p>
|
||||
<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>
|
||||
</p>
|
||||
|
@ -4,30 +4,20 @@ require_once('../wp-includes/wp-l10n.php');
|
||||
$title = __('Permalink Options');
|
||||
$parent_file = 'options-general.php';
|
||||
|
||||
$wpvarstoreset = array('action','standalone', 'option_group_id');
|
||||
for ($i=0; $i<count($wpvarstoreset); $i += 1) {
|
||||
$wpvar = $wpvarstoreset[$i];
|
||||
if (!isset($$wpvar)) {
|
||||
if (empty($_POST["$wpvar"])) {
|
||||
if (empty($_GET["$wpvar"])) {
|
||||
$$wpvar = '';
|
||||
} else {
|
||||
$$wpvar = $_GET["$wpvar"];
|
||||
}
|
||||
} else {
|
||||
$$wpvar = $_POST["$wpvar"];
|
||||
}
|
||||
}
|
||||
}
|
||||
require_once('./admin-header.php');
|
||||
if ($user_level <= 8)
|
||||
die(__('You have do not have sufficient permissions to edit the options for this blog.'));
|
||||
|
||||
require('./options-head.php');
|
||||
|
||||
$home = get_settings('home');
|
||||
if ($home != '' && $home != get_settings('siteurl')) {
|
||||
$home_path = parse_url($home);
|
||||
$home_path = $home_root['path'];
|
||||
$root = str_replace($_SERVER["PHP_SELF"], '', $_SERVER["PATH_TRANSLATED"]);
|
||||
$home_path = $root . $home_path . "/";
|
||||
if ( $home != '' && $home != get_settings('siteurl') ) {
|
||||
$home_path = parse_url($home);
|
||||
$home_path = $home_root['path'];
|
||||
$root = str_replace($_SERVER["PHP_SELF"], '', $_SERVER["PATH_TRANSLATED"]);
|
||||
$home_path = $root . $home_path . "/";
|
||||
} else {
|
||||
$home_path = ABSPATH;
|
||||
$home_path = ABSPATH;
|
||||
}
|
||||
|
||||
if (isset($_POST['submit'])) {
|
||||
@ -41,127 +31,82 @@ if (isset($_POST['submit'])) {
|
||||
$category_base = get_settings('category_base');
|
||||
}
|
||||
|
||||
if ( (!file_exists($home_path.'.htaccess') && is_writable($home_path)) || is_writable($home_path.'.htaccess') )
|
||||
$writable = true;
|
||||
else
|
||||
$writable = false;
|
||||
|
||||
if ( strstr($permalink_structure, 'index.php') ) // If they're using
|
||||
$usingpi = true;
|
||||
else
|
||||
$usingpi = false;
|
||||
|
||||
require_once('admin-header.php');
|
||||
if ($user_level <= 6) {
|
||||
die(__("You have do not have sufficient permissions to edit the options for this blog."));
|
||||
}
|
||||
require('./options-head.php');
|
||||
if ( $writable && !$usingpi && $is_apache ) {
|
||||
$rules = explode("\n", mod_rewrite_rules($permalink_structure));
|
||||
insert_with_markers($home_path.'.htaccess', 'WordPress', $rules);
|
||||
}
|
||||
?>
|
||||
|
||||
<?php if (isset($_POST['submit'])) : ?>
|
||||
<div class="updated"><p><?php _e('Permalink structure updated.'); ?></p></div>
|
||||
<?php endif; ?>
|
||||
|
||||
<?php if(isset($_POST['rules'])) {
|
||||
$rules = explode("\n", $_POST['rules']);
|
||||
if(insert_with_markers($home_path.'.htaccess', 'WordPress', $rules)) {
|
||||
?>
|
||||
<div class="updated" id="htupdate"><p><?php _e('mod_rewrite rules written to .htaccess.'); ?></p></div>
|
||||
<?php
|
||||
} else {
|
||||
?>
|
||||
<div class="updated" id="htupdate"><p><?php _e('Failed to write mod_rewrite rules to .htaccess.'); ?></p></div>
|
||||
<?php
|
||||
}
|
||||
}
|
||||
?>
|
||||
|
||||
<div class="wrap">
|
||||
<h2><?php _e('Edit Permalink Structure') ?></h2>
|
||||
<?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>')?>
|
||||
<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>
|
||||
|
||||
<?php if ($is_apache) : ?>
|
||||
<dl>
|
||||
<dt><code>%year%</code></dt>
|
||||
<dd>
|
||||
<?php _e('The year of the post, 4 digits, for example <code>2004</code>') ?>
|
||||
</dd>
|
||||
<dt><code>%monthnum%</code></dt>
|
||||
<dd>
|
||||
<?php _e('Month of the year, for example <code>05</code>') ?>
|
||||
</dd>
|
||||
<dt><code>%day%</code></dt>
|
||||
<dd>
|
||||
<?php _e('Day of the month, for example <code>28</code>') ?>
|
||||
</dd>
|
||||
<dt><code>%hour%</code></dt>
|
||||
<dd>
|
||||
<?php _e('Hour of the day, for example <code>15</code>') ?>
|
||||
</dd>
|
||||
<dt><code>%minute%</code></dt>
|
||||
<dd>
|
||||
<?php _e('Minute of the hour, for example <code>43</code>') ?>
|
||||
</dd>
|
||||
<dt><code>%second%</code></dt>
|
||||
<dd>
|
||||
<?php _e('Second of the minute, for example <code>33</code>') ?>
|
||||
</dd>
|
||||
<dt><code>%postname%</code></dt>
|
||||
<dd>
|
||||
<?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') ?>
|
||||
</dd>
|
||||
<dt><code>%post_id%</code></dt>
|
||||
<dd>
|
||||
<?php _e('The unique ID # of the post, for example <code>423</code>') ?>
|
||||
</dd>
|
||||
<dt><code>%category%</code></dt>
|
||||
<dd>
|
||||
<?php _e('A sanitized version of the category name.') ?>
|
||||
</dd>
|
||||
<dt><code>%author%</code></dt>
|
||||
<dd>
|
||||
<?php _e('A sanitized version of the author name.') ?>
|
||||
</dd>
|
||||
<dt><?php _e('Structure'); ?>: <code>/%year%/%monthnum%/%day%/%postname%/</code></dt>
|
||||
<strong>
|
||||
<dd><?php _e('Result'); ?>: <code><?php echo get_settings('home') . '/' . date('Y') . '/' . date('m') . '/' . date('d') . '/sample-post/'; ?></code></dd>
|
||||
</strong>
|
||||
<dt><?php _e('Structure'); ?>: <code>/archives/%post_id%</code></dt>
|
||||
<strong>
|
||||
<dd><?php _e('Result'); ?>: <code><?php echo get_settings('home'); ?>/archives/123</code></dd>
|
||||
</strong>
|
||||
<dt></dt>
|
||||
</dl>
|
||||
|
||||
<?php _e('<p>So for example a value like:</p>
|
||||
<p><code>/archives/%year%/%monthnum%/%day%/%postname%/</code> </p>
|
||||
<p>would give you a permalink like:</p>
|
||||
<p><code>/archives/2003/05/23/my-cheese-sandwich/</code></p>
|
||||
<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>
|
||||
<p><code>/index.php/archives/%year%/%monthnum%/%day%/%postname%/</code> </p>
|
||||
<p>If you use this option you can ignore the mod_rewrite rules.</p>') ?>
|
||||
<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>
|
||||
|
||||
<?php else : ?>
|
||||
<dl>
|
||||
<dt><?php _e('Structure'); ?>: <code>/index.php/%year%/%monthnum%/%day%/%postname%/</code></dt>
|
||||
<strong>
|
||||
<dd><?php _e('Result'); ?>: <code><?php echo get_settings('home') . '/index.php/' . date('Y') . '/' . date('m') . '/' . date('d') . '/sample-post/'; ?></code></dd>
|
||||
</strong>
|
||||
<dt><?php _e('Structure'); ?>: <code>/index.php/archives/%post_id%</code></dt>
|
||||
<strong>
|
||||
<dd><?php _e('Result'); ?>: <code><?php echo get_settings('home'); ?>/index.php/archives/123</code></dd>
|
||||
</strong>
|
||||
<dt></dt>
|
||||
</dl>
|
||||
<?php endif; ?>
|
||||
|
||||
<form name="form" action="options-permalink.php" method="post">
|
||||
<p><?php _e('Use the template tags above to create a virtual site structure:') ?></p>
|
||||
<p>
|
||||
<input name="permalink_structure" type="text" style="width: 98%;" value="<?php echo $permalink_structure; ?>" />
|
||||
<?php _e('Structure'); ?>: <input name="permalink_structure" type="text" class="code" style="width: 60%;" value="<?php echo $permalink_structure; ?>" size="50" />
|
||||
</p>
|
||||
<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>
|
||||
<p>
|
||||
<input name="category_base" type="text" style="width: 98%;" value="<?php echo $category_base; ?>" />
|
||||
<?php _e('Category base'); ?>: <input name="category_base" type="text" class="code" value="<?php echo $category_base; ?>" size="30" />
|
||||
</p>
|
||||
<p class="submit">
|
||||
<input type="submit" name="submit" value="<?php _e('Update Permalink Structure »') ?>" />
|
||||
</p>
|
||||
</form>
|
||||
<?php
|
||||
if ($permalink_structure) {
|
||||
?>
|
||||
<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>
|
||||
<?php if ( $permalink_structure && !$usingpi && !$writable ) : ?>
|
||||
<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>
|
||||
<form action="options-permalink.php" method="post">
|
||||
<p>
|
||||
<textarea rows="5" style="width: 98%;" name="rules"><?php echo mod_rewrite_rules($permalink_structure); ?>
|
||||
</textarea>
|
||||
</p>
|
||||
<?php
|
||||
|
||||
if ((! file_exists($home_path.'.htaccess') && is_writable($home_path)) || is_writable($home_path.'.htaccess')) {
|
||||
?>
|
||||
<p class="submit">
|
||||
<input type="submit" name="writerules" value="<?php _e('Write mod_rewrite rules to .htaccess »') ?>">
|
||||
</p>
|
||||
<?php } ?>
|
||||
<?php endif; ?>
|
||||
</form>
|
||||
|
||||
<?php
|
||||
} else {
|
||||
?>
|
||||
<p>
|
||||
<?php _e('You are not currently using customized permalinks. No special mod_rewrite rules are needed.') ?>
|
||||
</p>
|
||||
<?php } ?>
|
||||
|
||||
</div>
|
||||
|
||||
<?php
|
||||
require('./admin-footer.php');
|
||||
?>
|
||||
<?php require('./admin-footer.php'); ?>
|
@ -4,44 +4,9 @@ require_once('../wp-includes/wp-l10n.php');
|
||||
$title = __('Writing Options');
|
||||
$parent_file = 'options-general.php';
|
||||
|
||||
function add_magic_quotes($array) {
|
||||
foreach ($array as $k => $v) {
|
||||
if (is_array($v)) {
|
||||
$array[$k] = add_magic_quotes($v);
|
||||
} else {
|
||||
$array[$k] = addslashes($v);
|
||||
}
|
||||
}
|
||||
return $array;
|
||||
}
|
||||
|
||||
if (!get_magic_quotes_gpc()) {
|
||||
$_GET = add_magic_quotes($_GET);
|
||||
$_POST = add_magic_quotes($_POST);
|
||||
$_COOKIE = add_magic_quotes($_COOKIE);
|
||||
}
|
||||
|
||||
$wpvarstoreset = array('action','standalone', 'option_group_id');
|
||||
for ($i=0; $i<count($wpvarstoreset); $i += 1) {
|
||||
$wpvar = $wpvarstoreset[$i];
|
||||
if (!isset($$wpvar)) {
|
||||
if (empty($_POST["$wpvar"])) {
|
||||
if (empty($_GET["$wpvar"])) {
|
||||
$$wpvar = '';
|
||||
} else {
|
||||
$$wpvar = $_GET["$wpvar"];
|
||||
}
|
||||
} else {
|
||||
$$wpvar = $_POST["$wpvar"];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
$standalone = 0;
|
||||
include_once('admin-header.php');
|
||||
include('options-head.php');
|
||||
include_once('./admin-header.php');
|
||||
include('./options-head.php');
|
||||
?>
|
||||
|
||||
<div class="wrap">
|
||||
@ -92,53 +57,56 @@ endforeach;
|
||||
<label for="new_users_can_blog1"><input name="new_users_can_blog" id="new_users_can_blog1" type="radio" value="1" <?php checked('1', get_settings('new_users_can_blog')); ?> /> <?php _e('May submit drafts for review') ?></label><br />
|
||||
<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>
|
||||
</tr>
|
||||
</table>
|
||||
<fieldset class="options">
|
||||
</table>
|
||||
|
||||
<fieldset class="options">
|
||||
<legend><?php _e('Update Services') ?></legend>
|
||||
<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>
|
||||
<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>
|
||||
|
||||
<textarea name="ping_sites" id="ping_sites" style="width: 98%;"><?php form_option('ping_sites'); ?></textarea>
|
||||
</fieldset>
|
||||
<fieldset class="options">
|
||||
</fieldset>
|
||||
|
||||
<fieldset class="options">
|
||||
<legend><?php _e('Writing by e-mail') ?></legend>
|
||||
<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>
|
||||
|
||||
<table width="100%" cellspacing="2" cellpadding="5" class="editform">
|
||||
<tr valign="top">
|
||||
<th scope="row"><?php _e('Mail server:') ?></th>
|
||||
<td><input name="mailserver_url" type="text" id="mailserver_url" value="<?php form_option('mailserver_url'); ?>" size="40" />
|
||||
<label for="port"><?php _e('Port:') ?></label>
|
||||
<input name="mailserver_port" type="text" id="mailserver_port" value="<?php form_option('mailserver_port'); ?>" size="6" />
|
||||
</td>
|
||||
</tr>
|
||||
<tr valign="top">
|
||||
<th width="33%" scope="row"><?php _e('Login name:') ?></th>
|
||||
<td><input name="mailserver_login" type="text" id="mailserver_login" value="<?php form_option('mailserver_login'); ?>" size="40" /></td>
|
||||
</tr>
|
||||
<tr valign="top">
|
||||
<th scope="row"><?php _e('Password:') ?></th>
|
||||
<td>
|
||||
<input name="mailserver_pass" type="text" id="mailserver_pass" value="<?php form_option('mailserver_pass'); ?>" size="40" />
|
||||
</td>
|
||||
</tr>
|
||||
<tr valign="top">
|
||||
<th scope="row"><?php _e('Default post by mail category:') ?></th>
|
||||
<td><select name="default_email_category" id="default_email_category">
|
||||
<table width="100%" cellspacing="2" cellpadding="5" class="editform">
|
||||
<tr valign="top">
|
||||
<th scope="row"><?php _e('Mail server:') ?></th>
|
||||
<td><input name="mailserver_url" type="text" id="mailserver_url" value="<?php form_option('mailserver_url'); ?>" size="40" />
|
||||
<label for="port"><?php _e('Port:') ?></label>
|
||||
<input name="mailserver_port" type="text" id="mailserver_port" value="<?php form_option('mailserver_port'); ?>" size="6" />
|
||||
</td>
|
||||
</tr>
|
||||
<tr valign="top">
|
||||
<th width="33%" scope="row"><?php _e('Login name:') ?></th>
|
||||
<td><input name="mailserver_login" type="text" id="mailserver_login" value="<?php form_option('mailserver_login'); ?>" size="40" /></td>
|
||||
</tr>
|
||||
<tr valign="top">
|
||||
<th scope="row"><?php _e('Password:') ?></th>
|
||||
<td>
|
||||
<input name="mailserver_pass" type="text" id="mailserver_pass" value="<?php form_option('mailserver_pass'); ?>" size="40" />
|
||||
</td>
|
||||
</tr>
|
||||
<tr valign="top">
|
||||
<th scope="row"><?php _e('Default post by mail category:') ?></th>
|
||||
<td><select name="default_email_category" id="default_email_category">
|
||||
<?php
|
||||
//Alreay have $categories from default_category
|
||||
foreach ($categories as $category) :
|
||||
if ($category->cat_ID == get_settings('default_email_category')) $selected = " selected='selected'";
|
||||
else $selected = '';
|
||||
echo "\n\t<option value='$category->cat_ID' $selected>$category->cat_name</option>";
|
||||
echo "\n\t<option value='$category->cat_ID' $selected>$category->cat_name</option>";
|
||||
endforeach;
|
||||
?>
|
||||
</select></td>
|
||||
</tr>
|
||||
</table>
|
||||
</fieldset>
|
||||
<p class="submit">
|
||||
<input type="submit" name="Submit" value="<?php _e('Update Options') ?> »" />
|
||||
</p>
|
||||
</form>
|
||||
</select></td>
|
||||
</tr>
|
||||
</table>
|
||||
</fieldset>
|
||||
<p class="submit">
|
||||
<input type="submit" name="Submit" value="<?php _e('Update Options') ?> »" />
|
||||
</p>
|
||||
</form>
|
||||
</div>
|
||||
<?php include("admin-footer.php") ?>
|
||||
|
||||
<?php include('./admin-footer.php') ?>
|
@ -54,14 +54,6 @@ case 'post':
|
||||
$excerpt = format_to_post($excerpt);
|
||||
$post_title = $_POST['post_title'];
|
||||
$post_categories = $_POST['post_category'];
|
||||
if(get_settings('use_geo_positions')) {
|
||||
$latstr = $_POST['post_latf'];
|
||||
$lonstr = $_POST['post_lonf'];
|
||||
if((strlen($latstr) > 2) && (strlen($lonstr) > 2 ) ) {
|
||||
$post_latf = floatval($_POST['post_latf']);
|
||||
$post_lonf = floatval($_POST['post_lonf']);
|
||||
}
|
||||
}
|
||||
$post_status = $_POST['post_status'];
|
||||
$post_name = $_POST['post_name'];
|
||||
|
||||
@ -112,19 +104,11 @@ case 'post':
|
||||
if ('' != $_POST['advanced']) $post_status = 'draft';
|
||||
if ('' != $_POST['savepage']) $post_status = 'static';
|
||||
|
||||
if((get_settings('use_geo_positions')) && (strlen($latstr) > 2) && (strlen($lonstr) > 2) ) {
|
||||
$postquery ="INSERT INTO $wpdb->posts
|
||||
(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)
|
||||
VALUES
|
||||
('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')
|
||||
";
|
||||
} else {
|
||||
$postquery ="INSERT INTO $wpdb->posts
|
||||
(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)
|
||||
VALUES
|
||||
('0', '$user_ID', '$now', '$now_gmt', '$content', '$post_title', '$excerpt', '$post_status', '$comment_status', '$ping_status', '$post_password', '$post_name', '$trackback', '$now', '$now_gmt')
|
||||
";
|
||||
}
|
||||
|
||||
$result = $wpdb->query($postquery);
|
||||
|
||||
@ -178,9 +162,6 @@ case 'post':
|
||||
}
|
||||
|
||||
if ($post_status == 'publish') {
|
||||
if((get_settings('use_geo_positions')) && ($post_latf != null) && ($post_lonf != null)) {
|
||||
pingGeoUrl($post_ID);
|
||||
}
|
||||
|
||||
if ($post_pingback) {
|
||||
pingback($content, $post_ID);
|
||||
@ -228,8 +209,6 @@ case 'edit':
|
||||
|
||||
$content = $postdata->post_content;
|
||||
$content = format_to_edit($content);
|
||||
$edited_lat = $postdata->post_lat;
|
||||
$edited_lon = $postdata->post_lon;
|
||||
$excerpt = $postdata->post_excerpt;
|
||||
$excerpt = format_to_edit($excerpt);
|
||||
$edited_post_title = format_to_edit($postdata->post_title);
|
||||
@ -291,19 +270,6 @@ case 'editpost':
|
||||
$excerpt = balanceTags($_POST['excerpt']);
|
||||
$excerpt = format_to_post($excerpt);
|
||||
$post_title = $_POST['post_title'];
|
||||
if(get_settings('use_geo_positions')) {
|
||||
$latf = floatval($_POST["post_latf"]);
|
||||
$lonf = floatval($_POST["post_lonf"]);
|
||||
$latlonaddition = "";
|
||||
if( ($latf != null) && ($latf <= 90 ) && ($latf >= -90) && ($lonf != null) && ($lonf <= 360) && ($lonf >= -360) ) {
|
||||
pingGeoUrl($post_ID);
|
||||
$latlonaddition = " post_lat=".$latf.", post_lon =".$lonf.", ";
|
||||
} else {
|
||||
$latlonaddition = " post_lat=null, post_lon=null, ";
|
||||
}
|
||||
} else {
|
||||
$latlonaddition = '';
|
||||
}
|
||||
$prev_status = $_POST['prev_status'];
|
||||
$post_status = $_POST['post_status'];
|
||||
$comment_status = $_POST['comment_status'];
|
||||
@ -369,9 +335,7 @@ $now_gmt = current_time('mysql', 1);
|
||||
post_excerpt = '$excerpt',
|
||||
post_title = '$post_title'"
|
||||
.$datemodif_gmt
|
||||
.$datemodif.","
|
||||
.$latlonaddition."
|
||||
|
||||
.$datemodif.",
|
||||
post_status = '$post_status',
|
||||
comment_status = '$comment_status',
|
||||
ping_status = '$ping_status',
|
||||
@ -468,15 +432,6 @@ case 'delete':
|
||||
if ($user_level < $authordata->user_level)
|
||||
die (sprintf(__('You don’t have the right to delete <strong>%s</strong>’s posts.'), $authordata[1]));
|
||||
|
||||
// send geoURL ping to "erase" from their DB
|
||||
$query = "SELECT post_lat from $wpdb->posts WHERE ID=$post_id";
|
||||
$rows = $wpdb->query($query);
|
||||
$myrow = $rows[0];
|
||||
$latf = $myrow->post_lat;
|
||||
if($latf != null ) {
|
||||
pingGeoUrl($post);
|
||||
}
|
||||
|
||||
$result = $wpdb->query("DELETE FROM $wpdb->posts WHERE ID=$post_id");
|
||||
if (!$result)
|
||||
die(__('Error in deleting...'));
|
||||
|
@ -105,8 +105,6 @@ CREATE TABLE $wpdb->posts (
|
||||
post_title text NOT NULL,
|
||||
post_category int(4) NOT NULL default '0',
|
||||
post_excerpt text NOT NULL,
|
||||
post_lat float default NULL,
|
||||
post_lon float default NULL,
|
||||
post_status enum('publish','draft','private','static') NOT NULL default 'publish',
|
||||
comment_status enum('open','closed','registered_only') NOT NULL default 'open',
|
||||
ping_status enum('open','closed') NOT NULL default 'open',
|
||||
@ -189,10 +187,6 @@ function populate_options() {
|
||||
add_option('what_to_show', 'posts');
|
||||
add_option('date_format', 'F j, Y');
|
||||
add_option('time_format', 'g:i a');
|
||||
add_option('use_geo_positions', 0);
|
||||
add_option('use_default_geourl', 0);
|
||||
add_option('default_geourl_lat', 0);
|
||||
add_option('default_geourl_lon', 0);
|
||||
add_option('weblogs_xml_url', 'http://static.wordpress.org/changes.xml');
|
||||
add_option('links_updated_date_format', 'F j, Y g:i a');
|
||||
add_option('links_recently_updated_prepend', '<em>');
|
||||
@ -219,7 +213,7 @@ function populate_options() {
|
||||
add_option('stylesheet', 'default');
|
||||
|
||||
// Delete unused options
|
||||
$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');
|
||||
$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');
|
||||
foreach ($unusedoptions as $option) :
|
||||
delete_option($option);
|
||||
endforeach;
|
||||
|
@ -400,8 +400,6 @@ function get_postdata($postid) {
|
||||
'Excerpt' => $post->post_excerpt,
|
||||
'Title' => $post->post_title,
|
||||
'Category' => $post->post_category,
|
||||
'Lat' => $post->post_lat,
|
||||
'Lon' => $post->post_lon,
|
||||
'post_status' => $post->post_status,
|
||||
'comment_status' => $post->comment_status,
|
||||
'ping_status' => $post->ping_status,
|
||||
@ -825,55 +823,6 @@ include_once (ABSPATH . WPINC . '/class-xmlrpcs.php');
|
||||
debug_fclose($log);
|
||||
}
|
||||
|
||||
function doGeoUrlHeader($post_list = '') {
|
||||
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";
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function getRemoteFile($host,$path) {
|
||||
$fp = fsockopen($host, 80, $errno, $errstr, 5);
|
||||
if ($fp) {
|
||||
fputs($fp,"GET $path HTTP/1.0\r\nHost: $host\r\n\r\n");
|
||||
while ($line = fgets($fp, 4096)) {
|
||||
$lines[] = $line;
|
||||
}
|
||||
fclose($fp);
|
||||
return $lines;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
function pingGeoURL($blog_ID) {
|
||||
|
||||
$ourUrl = get_settings('home') ."/index.php?p=".$blog_ID;
|
||||
$host="geourl.org";
|
||||
$path="/ping/?p=".$ourUrl;
|
||||
getRemoteFile($host,$path);
|
||||
}
|
||||
|
||||
/* wp_set_comment_status:
|
||||
part of otaku42's comment moderation hack
|
||||
changes the status of a comment according to $comment_status.
|
||||
|
@ -62,7 +62,7 @@ function comments_number($zero='No Comments', $one='1 Comment', $more='% Comment
|
||||
} elseif ($number > 1) {
|
||||
$blah = str_replace('%', $number, $more);
|
||||
}
|
||||
echo $blah;
|
||||
echo apply_filters('comments_number', $blah);
|
||||
}
|
||||
|
||||
function comments_link($file='', $echo=true) {
|
||||
|
@ -1,155 +0,0 @@
|
||||
<?php
|
||||
|
||||
function get_Lat() {
|
||||
global $post;
|
||||
|
||||
if ($post->post_lat != '') {
|
||||
return trim($post->post_lat);
|
||||
} else if(get_settings('use_default_geourl')) {
|
||||
return trim(get_settings('default_geourl_lat'));
|
||||
}
|
||||
|
||||
return '';
|
||||
}
|
||||
|
||||
function get_Lon() {
|
||||
global $post;
|
||||
|
||||
if ($post->post_lon != '') {
|
||||
return trim($post->post_lon);
|
||||
} else if(get_settings('use_default_geourl')) {
|
||||
return trim(get_settings('default_geourl_lon'));
|
||||
}
|
||||
|
||||
return '';
|
||||
}
|
||||
|
||||
function print_Lat() {
|
||||
if(get_settings('use_geo_positions')) {
|
||||
if(get_Lat() > 0) {
|
||||
echo "".get_Lat()."N";
|
||||
} else {
|
||||
echo "".get_Lat()."S";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function print_Lon() {
|
||||
global $id, $postdata;
|
||||
if(get_settings('use_geo_positions')) {
|
||||
if(get_Lon() < 0) {
|
||||
$temp = get_Lon() * -1;
|
||||
echo "".$temp."W";
|
||||
} else {
|
||||
echo "".get_Lon()."E";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function print_PopUpScript() {
|
||||
echo "
|
||||
<script type='text/javascript'>
|
||||
<!-- This script and many more are available free online at -->
|
||||
<!-- The JavaScript Source!! -->
|
||||
function formHandler(form) {
|
||||
var URL = form.site.options[form.site.selectedIndex].value;
|
||||
if(URL != \".\") {
|
||||
popup = window.open(URL,\"MenuPopup\");
|
||||
}
|
||||
}
|
||||
</script> ";
|
||||
}
|
||||
|
||||
function print_UrlPopNav() {
|
||||
$sites = array(
|
||||
array('http://www.acme.com/mapper/?lat='.get_Lat().'&long='.get_Lon().'&scale=11&theme=Image&width=3&height=2&dot=Yes',
|
||||
__('Acme Mapper')),
|
||||
array('http://geourl.org/near/?lat='.get_Lat().'&lon='.get_Lon().'&dist=500',
|
||||
__('GeoURLs near here')),
|
||||
array('http://www.geocaching.com/seek/nearest.aspx?origin_lat='.get_Lat().'&origin_long='.get_Lon().'&dist=5',
|
||||
__('Geocaches near here')),
|
||||
array('http://www.mapquest.com/maps/map.adp?latlongtype=decimal&latitude='.get_Lat().'&longitude='.get_Lon(),
|
||||
__('Mapquest map of this spot')),
|
||||
array('http://www.sidebit.com/ProjectGeoURLMap.php?lat='.get_Lat().'&lon='.get_Lon(),
|
||||
__('SideBit URL Map of this spot')),
|
||||
array('http://confluence.org/confluence.php?lat='.get_Lat().'&lon='.get_Lon(),
|
||||
__('Confluence.org near here')),
|
||||
array('http://www.topozone.com/map.asp?lat='.get_Lat().'&lon='.get_Lon(),
|
||||
__('Topozone near here')),
|
||||
array('http://www.findu.com/cgi-bin/near.cgi?lat='.get_Lat().'&lon='.get_Lon(),
|
||||
__('FindU near here')),
|
||||
array('http://mapserver.maptech.com/api/espn/index.cfm?lat='.get_Lat().'&lon='.get_Lon().'&scale=100000&zoom=50&type=1&icon=0&&scriptfile=http://mapserver.maptech.com/api/espn/index.cfm',
|
||||
__('Maptech near here'))
|
||||
);
|
||||
echo '<form action=""><div>
|
||||
<select name="site" size="1" onchange="formHandler(this.form);" >'."\n";
|
||||
echo '<option value=".">' . sprintf(__("Sites referencing %s x %s"), get_Lat(), get_Lon()) . "</option>\n";
|
||||
foreach($sites as $site) {
|
||||
echo "\t".'<option value="'.$site[0].'">'.$site[1]."</option>\n";
|
||||
}
|
||||
echo '</select></div>
|
||||
</form>'."\n";
|
||||
}
|
||||
|
||||
function longitude_invalid() {
|
||||
if (get_Lon() == null) return true;
|
||||
if (get_Lon() > 360) return true;
|
||||
if (get_Lon() < -360) return true;
|
||||
}
|
||||
|
||||
function print_AcmeMap_Url() {
|
||||
if (!get_settings('use_geo_positions')) return;
|
||||
if (longitude_invalid()) return;
|
||||
echo "http://www.acme.com/mapper?lat=".get_Lat()."&long=".get_Lon()."&scale=11&theme=Image&width=3&height=2&dot=Yes";
|
||||
}
|
||||
|
||||
function print_GeoURL_Url() {
|
||||
if (!get_settings('use_geo_positions')) return;
|
||||
if (longitude_invalid()) return;
|
||||
echo "http://geourl.org/near/?lat=".get_Lat()."&lon=".get_Lon()."&dist=500";
|
||||
}
|
||||
|
||||
function print_GeoCache_Url() {
|
||||
if (!get_settings('use_geo_positions')) return;
|
||||
if (longitude_invalid()) return;
|
||||
echo "http://www.geocaching.com/seek/nearest.aspx?origin_lat=".get_Lat()."&origin_long=".get_Lon()."&dist=5";
|
||||
}
|
||||
|
||||
function print_MapQuest_Url() {
|
||||
if (!get_settings('use_geo_positions')) return;
|
||||
|
||||
if (longitude_invalid()) return;
|
||||
echo "http://www.mapquest.com/maps/map.adp?latlongtype=decimal&latitude=".get_Lat()."&longitude=".get_Lon();
|
||||
}
|
||||
|
||||
function print_SideBit_Url() {
|
||||
if (!get_settings('use_geo_positions')) return;
|
||||
if (longitude_invalid()) return;
|
||||
echo "http://www.sidebit.com/ProjectGeoURLMap.php?lat=".get_Lat()."&lon=".get_Lon();
|
||||
}
|
||||
|
||||
function print_DegreeConfluence_Url() {
|
||||
if (!get_settings('use_geo_positions')) return;
|
||||
if (longitude_invalid()) return;
|
||||
echo "http://confluence.org/confluence.php?lat=".get_Lat()."&lon=".get_Lon();
|
||||
}
|
||||
|
||||
function print_TopoZone_Url() {
|
||||
if (!get_settings('use_geo_positions')) return;
|
||||
if (longitude_invalid()) return;
|
||||
echo "http://www.topozone.com/map.asp?lat=".get_Lat()."&lon=".get_Lon();
|
||||
}
|
||||
|
||||
function print_FindU_Url() {
|
||||
if (!get_settings('use_geo_positions')) return;
|
||||
if (longitude_invalid()) return;
|
||||
echo "http://www.findu.com/cgi-bin/near.cgi?lat=".get_Lat()."&lon=".get_Lon()."&scale=100000&zoom=50&type=1&icon=0&&scriptfile=http://mapserver.maptech.com/api/espn/index.cfm";
|
||||
}
|
||||
|
||||
function print_MapTech_Url() {
|
||||
if (!get_settings('use_geo_positions')) return;
|
||||
if (longitude_invalid()) return;
|
||||
echo "http://mapserver.maptech.com/api/espn/index.cfm?lat=".get_Lat()."&lon=".get_Lon();
|
||||
}
|
||||
|
||||
?>
|
@ -7,9 +7,6 @@ require($curpath . 'template-functions-general.php');
|
||||
/***** Links *****/
|
||||
require($curpath . 'template-functions-links.php');
|
||||
|
||||
/**** // Geo Tags ****/
|
||||
require($curpath . 'template-functions-geo.php');
|
||||
|
||||
/***** Author tags *****/
|
||||
require($curpath . 'template-functions-author.php');
|
||||
|
||||
|
@ -190,5 +190,4 @@ add_filter('single_post_title', 'wptexturize');
|
||||
add_filter('the_title', 'wptexturize');
|
||||
add_filter('the_content', 'wptexturize');
|
||||
add_filter('the_excerpt', 'wptexturize');
|
||||
add_action('wp_head', 'doGeoUrlHeader');
|
||||
?>
|
Loading…
Reference in New Issue
Block a user