Hey guys,
Been looking for a half decent php forum, heard about this one. So I'm going to explain what I need help on haha.
Format: Wordpress
Difficulty: Beginner-Intermediate (I'm just confused as hell)
Basically I want it so that the user inputs data into a settings page (Wordpress plugin) and this data is called into a shortcode and displayed. This is what I have so far:
[syntax=php]
function my_plugin_menu() {
add_options_page( 'Minepress Dynmap Plugin Options', 'Minepress Dynmap Plugin Options', 'manage_options', 'my-unique-identifier', 'mp_dynmap_plugin_options' );
}
function my_plugin_options() {
if ( !current_user_can( 'manage_options' ) ) {
wp_die( __( 'You do not have sufficient permissions to access this page.' ) );
}
echo '<div class="wrap">';
echo '<p>Here is where the form would go if I actually had options.</p>';
echo '</div>';
}
/******
* OutCome
******/
function mpm_dynmap_shortcode() {
$minepress_options = get_option('minepress');
if($minepress_options['101'] == '') {
echo 'Oops! No Dynmap server specified!';
} else {
echo '<iframe src="' . $minepress_options['101'] . ':' . ($minepress_options['102'] == '' ? '8123' : $minepress_options['102']) . '" width="100%" height="' . ($minepress_options['103'] == '' ? '500' : $minepress_options['103']) . '">';
}
}
add_shortcode('mp-dynmap', 'mpm_dynmap_shortcode');
?>[/syntax]
But I don't know how to get it to make it so they have to input information
Thanks
User Input + PHP Server Status [Minecraft]
Re: User Input + PHP Server Status [Minecraft]
WordPress is not something I have ever worked with, I think they have their own support forum for plugins though ? Might be best of asking there.