Page 1 of 1

User Input + PHP Server Status [Minecraft]

Posted: Fri Aug 24, 2012 11:28 pm
by xtrapsp
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:



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'); 



?>
But I don't know how to get it to make it so they have to input information

Thanks

Re: User Input + PHP Server Status [Minecraft]

Posted: Mon Aug 27, 2012 11:23 pm
by jacek
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.