Changeset 465373
- Timestamp:
- 11/20/2011 09:36:30 PM (14 years ago)
- Location:
- tm-replace-howdy
- Files:
-
- 8 added
- 4 edited
- 1 copied
-
tags/1.2 (copied) (copied from tm-replace-howdy/trunk)
-
tags/1.2/index.php (modified) (7 diffs)
-
tags/1.2/js (added)
-
tags/1.2/js/tm-replace-howdy-3_1.js (added)
-
tags/1.2/js/tm-replace-howdy-3_2.js (added)
-
tags/1.2/js/tm-replace-howdy-3_3.js (added)
-
tags/1.2/readme.txt (modified) (3 diffs)
-
trunk/index.php (modified) (7 diffs)
-
trunk/js (added)
-
trunk/js/tm-replace-howdy-3_1.js (added)
-
trunk/js/tm-replace-howdy-3_2.js (added)
-
trunk/js/tm-replace-howdy-3_3.js (added)
-
trunk/readme.txt (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
tm-replace-howdy/tags/1.2/index.php
r393250 r465373 5 5 Description: The Replace Howdy Plugin is designed to replace the word "Howdy" in the WordPress backend header with something else. By default it randomly pulls from a list of several replacement words and phrases such as "Hello", "Welcome", and "Get to the choppa". The plugin also comes with a menu where you can limit it to "professional" sounding greetings, set a static word or phrase, or add your own list (which can be by itself or added into the default list for even more variety)! 6 6 Author: David Wood 7 Version: 1. 17 Version: 1.2 8 8 Author URI: http://iamdavidwood.com/ 9 9 Contributors: Micah Wood … … 11 11 ============================================================================================================ 12 12 This software is provided "as is" and any express or implied warranties, including, but not limited to, the 13 implied warranties of merchant ibility and fitness for a particular purpose are disclaimed. In no event shall13 implied warranties of merchantability and fitness for a particular purpose are disclaimed. In no event shall 14 14 the copyright owner or contributors be liable for any direct, indirect, incidental, special, exemplary, or 15 15 consequential damages (including, but not limited to, procurement of substitute goods or services; loss of … … 21 21 ============================================================================================================ 22 22 */ 23 24 define('TM_REPLACE_HOWDY_URL', plugins_url('', __FILE__)); 25 23 26 class tm_replace_howdy { 24 27 private $techm_howdy_fun = array( // Array containing standard greetings … … 57 60 'Konichiwa', 58 61 ), $tm_help; 59 function tm_replace_howdy() { // Initialze the plugin and handle the output (more or less) 60 global $nohowdy, $wp_version; 62 function tm_replace_howdy() { // Initialize the plugin and handle the output (more or less) 63 if(is_admin()) { // Only runs if this is an admin page 64 add_action('admin_menu', array(&$this, 'techm_replace_howdy_start')); // Call function to add admin options menu 65 add_action('admin_init', array(&$this, 'techm_replace_howdy_help')); 66 } 67 global $wp_version, $no_howdy; 68 if(preg_match('/^3\.[3-9]/', $wp_version)) wp_register_script('tm_replace_howdy', TM_REPLACE_HOWDY_URL.'/js/tm-replace-howdy-3_3.js', array('jquery')); 69 elseif(preg_match('/^3\.2/', $wp_version)) wp_register_script('tm_replace_howdy', TM_REPLACE_HOWDY_URL.'/js/tm-replace-howdy-3_2.js', array('jquery')); 70 elseif(preg_match('/^3\.[1|0]/', $wp_version)) wp_register_script('tm_replace_howdy', TM_REPLACE_HOWDY_URL.'/js/tm-replace-howdy-3_1.js', array('jquery')); 71 61 72 $techm_replace_howdy = get_option('techm_replace_howdy_values'); // Get options from DB if they exist 62 73 if(is_array($techm_replace_howdy)) $values = $techm_replace_howdy; // Values stored in DB, use them 63 74 else $values = $this->techm_howdy_fun; // No values in DB, use default. 64 $nohowdy = $values[rand(0,count($values)-1)]; // Get a random item from the array 65 if(is_admin()) { // Only runs if this is an admin page 66 add_action('admin_menu', array(&$this, 'techm_replace_howdy_start')); // Call function to add admin options menu 67 add_action('admin_init', array(&$this, 'techm_replace_howdy_help')); 68 add_action('admin_head', array(&$this, 'techm_replace_howdy_h')); // Add jQuery to header 69 if(preg_match('/^3\.[2-9]/', $wp_version)) add_action('admin_footer', array(&$this, 'techm_replace_howdy_3_2')); // Run replace-howdy if 3.2 or later 70 elseif(preg_match('/^3\.[1|0]/', $wp_version)) add_action('admin_footer', array(&$this, 'techm_replace_howdy_3_1')); // Run replace-howdy if prior to version 3.2 71 } 75 $no_howdy = $values[rand(0,count($values)-1)]; // Get a random item from the array 76 77 if(is_admin()) add_action('admin_enqueue_scripts', array($this, 'enqueue_scripts')); 78 elseif(preg_match('/^3\.[1-2|0]/', $wp_version)) $x = 1; // Doing nothing if version is before 3.3 and not admin area 79 else add_action('wp_enqueue_scripts', array($this, 'enqueue_scripts')); 80 } 81 function enqueue_scripts() { 82 global $no_howdy; 83 wp_enqueue_script('tm_replace_howdy'); 84 wp_localize_script('tm_replace_howdy', 'tmReplaceHowdy', array('noHowdy' => $no_howdy)); 72 85 } 73 86 function techm_replace_howdy_start() { … … 75 88 } 76 89 function techm_replace_howdy_help() { 77 $help = '<h2>Explan ition of modes</h2>90 $help = '<h2>Explanation of modes</h2> 78 91 <p><b>Normal Mode:</b> "Howdy" is replaced by one of the words/phrases in the default list. The default list is available for viewing on <a href="http://technicalmastermind.com/">TechnicalMastermind.com</a></p> 79 92 … … 82 95 <p><b>Static Mode:</b> For much the same reason party pooper mode exists, this mode is there for the people that want it to say one thing and one thing only. You can make it as funny or as boring as you want! You can define this in the "Static replacement word" option.</p> 83 96 84 <p><b>Custom Mode:</b> This mode is for people that like to be unique or just want to add an item or two to the list. To create your own word/phrase list, simply type them all into the field labeled as "Custom Word List". Make sure each word/phrase has no spaces before or after it (between words in a phrase is allowed) and don\'t put a comma (,) after anything, it gets added in later. Sep erate each word/phrase with a pipe(|). On most keyboards the pipe is located on the key between the backspace/delete key and the return/enter key (you will need to hold down shift when typing a pipe character).</p>97 <p><b>Custom Mode:</b> This mode is for people that like to be unique or just want to add an item or two to the list. To create your own word/phrase list, simply type them all into the field labeled as "Custom Word List". Make sure each word/phrase has no spaces before or after it (between words in a phrase is allowed) and don\'t put a comma (,) after anything, it gets added in later. Separate each word/phrase with a pipe(|). On most keyboards the pipe is located on the key between the backspace/delete key and the return/enter key (you will need to hold down shift when typing a pipe character).</p> 85 98 <p><b>Custom Mode Options:</b> Continuing from the custom mode explanation, when you use custom mode there are two variations of it (chosen through the "Custom mode options" menu item). 1) "Custom list + our list", this takes what you put in the "Custom word list" and adds it to our default list of words and phrases. 2) "Custom list only", this mode takes what you enter into the "Custom word list" and uses that as the entire list.</p> 86 99 <p><b>NOTE:</b> For custom defined text, know that ", <username>" is appended to the end of each item when displayed. So no ending commas(,)!</p> … … 133 146 require(dirname(__FILE__) . '/techm_options.php'); // Display the form 134 147 } 135 function techm_replace_howdy_h() { // Load jQuery into wp-head136 wp_enqueue_script('jquery');137 }138 function techm_replace_howdy_3_1() { // Replace "Howdy" if version 3.1.x or older.139 global $nohowdy;140 echo "<script type=\"text/javascript\">141 var nohowdy = \"".$nohowdy."\";142 jQuery('#user_info p')143 .html(144 jQuery('#user_info p')145 .html()146 .replace(/Howdy/,nohowdy)147 );</script>";148 }149 function techm_replace_howdy_3_2() { // Replace "Howdy" if version 3.2 or newer.150 global $nohowdy;151 echo "<script type=\"text/javascript\">152 var nohowdy = \"".$nohowdy."\";153 jQuery('#user_info .hide-if-no-js p')154 .html(155 jQuery('#user_info .hide-if-no-js p')156 .html()157 .replace(/Howdy/,nohowdy)158 );</script>";159 }160 148 } 161 149 new tm_replace_howdy; -
tm-replace-howdy/tags/1.2/readme.txt
r394041 r465373 9 9 Donate link: http://technicalmastermind.com/donate/ 10 10 Requires at least: 3.0 11 Tested up to: 3. 212 Stable tag: 1. 113 Version: 1. 111 Tested up to: 3.3 12 Stable tag: 1.2 13 Version: 1.2 14 14 15 15 == Description == … … 24 24 25 25 == Upgrade Notice == 26 = 1.2 = 27 * Updated plugin to be compatible with WP 3.3 28 * Maintained backwards compatibility through WP 3.0 29 * Moved JavaScript code to separate files 30 * JavaScript is now included using builtin WP methods 26 31 = 1.1 = 27 32 * Updated plugin to be compatible with the new WP 3.2 admin interface! 28 33 * Maintained backwards compatibility through at least WP 3.0. 29 * Optimized and cleaned up the code some to make it easier to read and more effic ent (hopefully).34 * Optimized and cleaned up the code some to make it easier to read and more efficient (hopefully). 30 35 31 36 == Screenshots == … … 34 39 35 40 == Changelog == 41 = 1.2 = 42 * Updated plugin to be compatible with WP 3.3 43 * Maintained backwards compatibility through WP 3.0 44 * Moved JavaScript code to separate files 45 * JavaScript is now included using builtin WP methods 36 46 = 1.1 = 37 47 * Updated plugin to be compatible with the new WP 3.2 admin interface! 38 48 * Maintained backwards compatibility through at least WP 3.0. 39 * Optimized and cleaned up the code some to make it easier to read and more effic ent (hopefully).40 * Cleaned up the admin page by plac eing the bulk of the text in the contextual help (little "help" tab under your username in the admin area)49 * Optimized and cleaned up the code some to make it easier to read and more efficient (hopefully). 50 * Cleaned up the admin page by placing the bulk of the text in the contextual help (little "help" tab under your username in the admin area) 41 51 = 1.0 = 42 52 * Created Plugin! -
tm-replace-howdy/trunk/index.php
r393250 r465373 5 5 Description: The Replace Howdy Plugin is designed to replace the word "Howdy" in the WordPress backend header with something else. By default it randomly pulls from a list of several replacement words and phrases such as "Hello", "Welcome", and "Get to the choppa". The plugin also comes with a menu where you can limit it to "professional" sounding greetings, set a static word or phrase, or add your own list (which can be by itself or added into the default list for even more variety)! 6 6 Author: David Wood 7 Version: 1. 17 Version: 1.2 8 8 Author URI: http://iamdavidwood.com/ 9 9 Contributors: Micah Wood … … 11 11 ============================================================================================================ 12 12 This software is provided "as is" and any express or implied warranties, including, but not limited to, the 13 implied warranties of merchant ibility and fitness for a particular purpose are disclaimed. In no event shall13 implied warranties of merchantability and fitness for a particular purpose are disclaimed. In no event shall 14 14 the copyright owner or contributors be liable for any direct, indirect, incidental, special, exemplary, or 15 15 consequential damages (including, but not limited to, procurement of substitute goods or services; loss of … … 21 21 ============================================================================================================ 22 22 */ 23 24 define('TM_REPLACE_HOWDY_URL', plugins_url('', __FILE__)); 25 23 26 class tm_replace_howdy { 24 27 private $techm_howdy_fun = array( // Array containing standard greetings … … 57 60 'Konichiwa', 58 61 ), $tm_help; 59 function tm_replace_howdy() { // Initialze the plugin and handle the output (more or less) 60 global $nohowdy, $wp_version; 62 function tm_replace_howdy() { // Initialize the plugin and handle the output (more or less) 63 if(is_admin()) { // Only runs if this is an admin page 64 add_action('admin_menu', array(&$this, 'techm_replace_howdy_start')); // Call function to add admin options menu 65 add_action('admin_init', array(&$this, 'techm_replace_howdy_help')); 66 } 67 global $wp_version, $no_howdy; 68 if(preg_match('/^3\.[3-9]/', $wp_version)) wp_register_script('tm_replace_howdy', TM_REPLACE_HOWDY_URL.'/js/tm-replace-howdy-3_3.js', array('jquery')); 69 elseif(preg_match('/^3\.2/', $wp_version)) wp_register_script('tm_replace_howdy', TM_REPLACE_HOWDY_URL.'/js/tm-replace-howdy-3_2.js', array('jquery')); 70 elseif(preg_match('/^3\.[1|0]/', $wp_version)) wp_register_script('tm_replace_howdy', TM_REPLACE_HOWDY_URL.'/js/tm-replace-howdy-3_1.js', array('jquery')); 71 61 72 $techm_replace_howdy = get_option('techm_replace_howdy_values'); // Get options from DB if they exist 62 73 if(is_array($techm_replace_howdy)) $values = $techm_replace_howdy; // Values stored in DB, use them 63 74 else $values = $this->techm_howdy_fun; // No values in DB, use default. 64 $nohowdy = $values[rand(0,count($values)-1)]; // Get a random item from the array 65 if(is_admin()) { // Only runs if this is an admin page 66 add_action('admin_menu', array(&$this, 'techm_replace_howdy_start')); // Call function to add admin options menu 67 add_action('admin_init', array(&$this, 'techm_replace_howdy_help')); 68 add_action('admin_head', array(&$this, 'techm_replace_howdy_h')); // Add jQuery to header 69 if(preg_match('/^3\.[2-9]/', $wp_version)) add_action('admin_footer', array(&$this, 'techm_replace_howdy_3_2')); // Run replace-howdy if 3.2 or later 70 elseif(preg_match('/^3\.[1|0]/', $wp_version)) add_action('admin_footer', array(&$this, 'techm_replace_howdy_3_1')); // Run replace-howdy if prior to version 3.2 71 } 75 $no_howdy = $values[rand(0,count($values)-1)]; // Get a random item from the array 76 77 if(is_admin()) add_action('admin_enqueue_scripts', array($this, 'enqueue_scripts')); 78 elseif(preg_match('/^3\.[1-2|0]/', $wp_version)) $x = 1; // Doing nothing if version is before 3.3 and not admin area 79 else add_action('wp_enqueue_scripts', array($this, 'enqueue_scripts')); 80 } 81 function enqueue_scripts() { 82 global $no_howdy; 83 wp_enqueue_script('tm_replace_howdy'); 84 wp_localize_script('tm_replace_howdy', 'tmReplaceHowdy', array('noHowdy' => $no_howdy)); 72 85 } 73 86 function techm_replace_howdy_start() { … … 75 88 } 76 89 function techm_replace_howdy_help() { 77 $help = '<h2>Explan ition of modes</h2>90 $help = '<h2>Explanation of modes</h2> 78 91 <p><b>Normal Mode:</b> "Howdy" is replaced by one of the words/phrases in the default list. The default list is available for viewing on <a href="http://technicalmastermind.com/">TechnicalMastermind.com</a></p> 79 92 … … 82 95 <p><b>Static Mode:</b> For much the same reason party pooper mode exists, this mode is there for the people that want it to say one thing and one thing only. You can make it as funny or as boring as you want! You can define this in the "Static replacement word" option.</p> 83 96 84 <p><b>Custom Mode:</b> This mode is for people that like to be unique or just want to add an item or two to the list. To create your own word/phrase list, simply type them all into the field labeled as "Custom Word List". Make sure each word/phrase has no spaces before or after it (between words in a phrase is allowed) and don\'t put a comma (,) after anything, it gets added in later. Sep erate each word/phrase with a pipe(|). On most keyboards the pipe is located on the key between the backspace/delete key and the return/enter key (you will need to hold down shift when typing a pipe character).</p>97 <p><b>Custom Mode:</b> This mode is for people that like to be unique or just want to add an item or two to the list. To create your own word/phrase list, simply type them all into the field labeled as "Custom Word List". Make sure each word/phrase has no spaces before or after it (between words in a phrase is allowed) and don\'t put a comma (,) after anything, it gets added in later. Separate each word/phrase with a pipe(|). On most keyboards the pipe is located on the key between the backspace/delete key and the return/enter key (you will need to hold down shift when typing a pipe character).</p> 85 98 <p><b>Custom Mode Options:</b> Continuing from the custom mode explanation, when you use custom mode there are two variations of it (chosen through the "Custom mode options" menu item). 1) "Custom list + our list", this takes what you put in the "Custom word list" and adds it to our default list of words and phrases. 2) "Custom list only", this mode takes what you enter into the "Custom word list" and uses that as the entire list.</p> 86 99 <p><b>NOTE:</b> For custom defined text, know that ", <username>" is appended to the end of each item when displayed. So no ending commas(,)!</p> … … 133 146 require(dirname(__FILE__) . '/techm_options.php'); // Display the form 134 147 } 135 function techm_replace_howdy_h() { // Load jQuery into wp-head136 wp_enqueue_script('jquery');137 }138 function techm_replace_howdy_3_1() { // Replace "Howdy" if version 3.1.x or older.139 global $nohowdy;140 echo "<script type=\"text/javascript\">141 var nohowdy = \"".$nohowdy."\";142 jQuery('#user_info p')143 .html(144 jQuery('#user_info p')145 .html()146 .replace(/Howdy/,nohowdy)147 );</script>";148 }149 function techm_replace_howdy_3_2() { // Replace "Howdy" if version 3.2 or newer.150 global $nohowdy;151 echo "<script type=\"text/javascript\">152 var nohowdy = \"".$nohowdy."\";153 jQuery('#user_info .hide-if-no-js p')154 .html(155 jQuery('#user_info .hide-if-no-js p')156 .html()157 .replace(/Howdy/,nohowdy)158 );</script>";159 }160 148 } 161 149 new tm_replace_howdy; -
tm-replace-howdy/trunk/readme.txt
r394041 r465373 9 9 Donate link: http://technicalmastermind.com/donate/ 10 10 Requires at least: 3.0 11 Tested up to: 3. 212 Stable tag: 1. 113 Version: 1. 111 Tested up to: 3.3 12 Stable tag: 1.2 13 Version: 1.2 14 14 15 15 == Description == … … 24 24 25 25 == Upgrade Notice == 26 = 1.2 = 27 * Updated plugin to be compatible with WP 3.3 28 * Maintained backwards compatibility through WP 3.0 29 * Moved JavaScript code to separate files 30 * JavaScript is now included using builtin WP methods 26 31 = 1.1 = 27 32 * Updated plugin to be compatible with the new WP 3.2 admin interface! 28 33 * Maintained backwards compatibility through at least WP 3.0. 29 * Optimized and cleaned up the code some to make it easier to read and more effic ent (hopefully).34 * Optimized and cleaned up the code some to make it easier to read and more efficient (hopefully). 30 35 31 36 == Screenshots == … … 34 39 35 40 == Changelog == 41 = 1.2 = 42 * Updated plugin to be compatible with WP 3.3 43 * Maintained backwards compatibility through WP 3.0 44 * Moved JavaScript code to separate files 45 * JavaScript is now included using builtin WP methods 36 46 = 1.1 = 37 47 * Updated plugin to be compatible with the new WP 3.2 admin interface! 38 48 * Maintained backwards compatibility through at least WP 3.0. 39 * Optimized and cleaned up the code some to make it easier to read and more effic ent (hopefully).40 * Cleaned up the admin page by plac eing the bulk of the text in the contextual help (little "help" tab under your username in the admin area)49 * Optimized and cleaned up the code some to make it easier to read and more efficient (hopefully). 50 * Cleaned up the admin page by placing the bulk of the text in the contextual help (little "help" tab under your username in the admin area) 41 51 = 1.0 = 42 52 * Created Plugin!
Note: See TracChangeset
for help on using the changeset viewer.