" . __('Ar PHP is only compatible with WordPress v2.6 and up. You are currently using WordPress v', 'arphp') . $wp_version . "

"; } // Add action to build an arphp page function addPanel() { //Add the Settings and User Panels add_options_page('Ar-PHP', 'Ar-PHP', 10, 'Ar-PHP', array($this, 'arphpSettings')); } // Default settings for this plugin function defaultSettings () { $default = array( 'date' => '0', 'hijri_date' => '0', 'spell_numbers' => '0', 'convert_layout' => '0', 'transliterate' => '0' ); // Set defaults if no values exist if (!get_option('arphp')) { add_option('arphp', $default); } else { // Set Defaults if new value does not exist $arphp = get_option('arphp'); // Check to see if all defaults exists in option table's record, and assign values to empty keys foreach($default as $key => $val) { if (!$arphp[$key]) { $arphp[$key] = $val; $new = true; } } if ($new) { update_option('arphp', $arphp); } } // Run plugin script and buttons if (!current_user_can ('edit_posts') && !current_user_can('edit_pages')) { return; } if (get_user_option ('rich_editing') == 'true') { add_filter('mce_external_plugins', array($this, 'tinymce_arphp_plugin')); add_filter('mce_buttons', array($this, 'tinymce_arphp_buttons')); } } // arphp page settings function arphpSettings() { // Get options from option table $arphp = get_option('arphp'); // Display message if any if ($_POST['notice']) { echo '

' . $_POST['notice'] . '.

'; } ?>