Hmm Im pretty stocked here :S
Seems to be over my level...
I was able to create the database by adding this to runners_log.php
BEFORE ?>
/* G E A R L I S T */
// Do this when user activates the plugin (Install Script)
register_activation_hook( __FILE__, 'gear_list_install');
function gear_list_install(){
global $wpdb;
$table_name = $wpdb->prefix . "gear_list";
if($wpdb->get_var("SHOW TABLES LIKE '$table_name'") != $table_name) {
$sql = "CREATE TABLE " . $table_name . " (
gear_id mediumint(8) unsigned NOT NULL auto_increment,
gear_inuse mediumint(8) unsigned NOT NULL,
gear_name varchar(100) NOT NULL default '',
gear_type varchar(100) NOT NULL default '',
gear_category varchar(50) NOT NULL default '',
gear_price varchar(100) NOT NULL default '',
gear_bought datetime NOT NULL,
gear_comment TEXT NOT NULL default '',
PRIMARY KEY id (gear_id)
);";
require_once(ABSPATH . 'wp-admin/includes/upgrade.php');
dbDelta($sql);
}
}
And adding this to create a new submenu:
AFTER
function runnerslog_converter_toolbox() {
include('Includes/runnerslog_converter_toolbox.php');
}
ADDING
function runnerslog_gear() {
include('Includes/runnerslog_gear.php');
}
AND AFTER
add_submenu_page('runners-log', 'Coverter Toolbox', 'Coverter Toolbox', 'administrator', 'runners-log-converter-toolbox', 'runnerslog_converter_toolbox');
ADDING
add_submenu_page('runners-log', 'Gear List', 'Gear List', 'administrator', 'runners-log-gear-list', 'runnerslog_gear');
Then in Includes I created runnerslog_gear.php
and here we have the problem. The fancy tableeditor need some .js files in the head.
<script type="text/javascript" src="js/prototype.js"></script>
<script type="text/javascript" src="js/scriptaculous-js/scriptaculous.js"></script>
<script type="text/javascript" src="js/lang/lang_vars-en.js"></script>
<script type="text/javascript" src="js/ajax_table_editor.js"></script>
<!-- calendar files -->
<link rel="stylesheet" type="text/css" media="all" href="js/jscalendar/skins/aqua/theme.css" title="win2k-cold-1" />
<script type="text/javascript" src="js/jscalendar/calendar.js"></script>
<script type="text/javascript" src="js/jscalendar/lang/calendar-en.js"></script>
<script type="text/javascript" src="js/jscalendar/calendar-setup.js"></script>
But howto get them into the <head> - I did try something like this to test - but no result.
<?php
add_action('wp_head', 'addtoheader');
function addtoheader() {
echo '<verystrong><verystrong>';
}
?>
So Im pretty sure Im not able to get the editor to work... Maybe I will have a second try tonight.