Bonjour à tous,
Im travail sur MinepressUK, un projet pour moi à apprendre php et à libérer une alternative libre de la minepress à venir (étrangement tous les deux avaient la même idée en même temps)
Je me demandais si il y aurait de toute manière possible de faire en sorte que lorsque quelqu'un des entrées dans un formulaire paramètres leur adresse ip du serveur qu'il montrera une carte dynamique.
Première utilisation
Lorsque vous démarrez CraftBukkit, vous devriez être capable de naviguer vers http://yourserverip:8123/ dans votre navigateur. Dans le cas où vous exécutez CraftBukkit sur le PC vous travaillez actuellement sur, vous pouvez naviguer vers http://localhost:8123/ . Vous devriez être capable de voir les joueurs qui sont en jeu. Notez que la carte n'est pas encore rendu, donc l'arrière-plan sera noir.
Si vous prévoyez utiliser le convertisseur HD, maintenant serait un bon moment de le faire. Activer deftemplatesuffix : embauche dans le haut de la configuration.txt. Plus d'informations sur deftemplatesuffix sont disponibles dans les paramètres du plugin de Base.
Si vous voulez juste voir Dynmap travailler, utilisez la commande suivante dans le jeu : /dynmap fullrender. Le wiki contient plus d'informations sur les commandes et les autorisations. La carte devrait se révéler peu à peu dans le navigateur, donnez-lui quelque temps. Les messages d'avancement indiquent que Dynmap travaille et qu'il montrera alors le rendu est terminé.
donc tout ce qu'ils ont à écrire dans la zone d'entrée est leur http://
iphere et il ajoutera automatiquement le port
Voici ce que j'ai pour l'instant :
<?php
/*
Plugin Name: Minepress Dynmap Plugin
Plugin URI: removed
Description: A Minepress plugin which allows the user to integrate the Minecraft
Dynmap
Author: Bradly Spicer
Version: 0.02
Author URI: removed
*/
/* Runs when plugin is activated */
register_activation_hook(__FILE__,'minecraft_dynmap_install');
/* Runs on plugin deactivation*/
register_deactivation_hook( __FILE__, 'minecraft_dynmap_remove' );
function minecraft_dynmap_install() {
/* Creates new database field */
add_option("minecraft_dynmap_data", 'Default', '', 'yes');
}
function hello_world_remove() {
/* Deletes the database field */
delete_option('minecraft_dynmap_data');
if ( is_admin() ){
/* Call the html code */
add_action('admin_menu', 'minecraft_dynmap_admin_menu');
function minecraft_dynmap_admin_menu() {
add_options_page('Dynmap', 'Dynmap', 'administrator',
'hello-world', 'hello_world_html_page');
}
}
?>
The above code, is placed under is_admin() which means it only runs in the wordpress
admin area.
The below function has the html code for the settings page, containing the form and
notice how the php tag is split to accomodate the html code.
and the coding part is..
<?php
function minecraft_dynmap_html_page() {
?>
<div>
<h2>Dynmap Options</h2>
<form method="post" action="options.php">
<?php wp_nonce_field('update-options'); ?>
<table width="510">
<tr valign="top">
<th width="92" scope="row">Enter your server Ip:</th>
<td width="406">
<input name="hello_world_data" type="text" id="minecraft_dynmap_data"
value="<?php echo get_option('minecraft_dynmap_data'); ?>" />
(ex. minecraft_dynmap)</td>
</tr>
</table>
<input type="hidden" name="action" value="update" />
<input type="hidden" name="page_options" value="minecraft_dynmap_data" />
<p>
<input type="submit" value="<?php _e('Save Changes') ?>" />
</p>
</form>
</div>
- <?php
- /*
- Plugin Name: Minepress Dynmap Plugin
- Plugin URI: removed
- Description: A Minepress plugin which allows the user to integrate the Minecraft
-
- Dynmap
- Author: Bradly Spicer
- Version: 0.02
- Author URI: removed
- */
-
- /* Runs when plugin is activated */
- register_activation_hook(__FILE__,'minecraft_dynmap_install');
-
- /* Runs on plugin deactivation*/
- register_deactivation_hook( __FILE__, 'minecraft_dynmap_remove' );
-
- function minecraft_dynmap_install() {
- /* Creates new database field */
- add_option("minecraft_dynmap_data", 'Default', '', 'yes');
- }
-
- function hello_world_remove() {
- /* Deletes the database field */
- delete_option('minecraft_dynmap_data');
-
- if ( is_admin() ){
-
- /* Call the html code */
- add_action('admin_menu', 'minecraft_dynmap_admin_menu');
-
- function minecraft_dynmap_admin_menu() {
- add_options_page('Dynmap', 'Dynmap', 'administrator',
- 'hello-world', 'hello_world_html_page');
- }
- }
- ?>
- The above code, is placed under is_admin() which means it only runs in the wordpress
-
- admin area.
- The below function has the html code for the settings page, containing the form and
-
- notice how the php tag is split to accomodate the html code.
-
- and the coding part is..
- <?php
- function minecraft_dynmap_html_page() {
- ?>
- <div>
- <h2>Dynmap Options</h2>
-
- <form method="post" action="options.php">
- <?php wp_nonce_field('update-options'); ?>
-
- <table width="510">
- <tr valign="top">
- <th width="92" scope="row">Enter your server Ip:</th>
- <td width="406">
- <input name="hello_world_data" type="text" id="minecraft_dynmap_data"
- value="<?php echo get_option('minecraft_dynmap_data'); ?>" />
- (ex. minecraft_dynmap)</td>
- </tr>
- </table>
-
- <input type="hidden" name="action" value="update" />
- <input type="hidden" name="page_options" value="minecraft_dynmap_data" />
-
- <p>
- <input type="submit" value="<?php _e('Save Changes') ?>" />
- </p>
-
- </form>
- </div>