Getting started:
Related tutorials:
| <?php | |
| function plugin_install_count_shortcode( $atts ) { | |
| $a = shortcode_atts( array( | |
| 'plugin' => NULL, | |
| ), $atts ); | |
| if( ! $a['plugin'] ) { | |
| return; | |
| } | |
| <?php | |
| /** | |
| * Performs a search | |
| * | |
| * This class is used to perform search functions in a MySQL database | |
| * | |
| * @version 1.0 | |
| * @author John Morris <[email protected]> | |
| */ | |
| class search { |
| <?php | |
| /* Created by Hirsh Agarwal of H2 Micro (www.h2micro.com) */ | |
| //Call the function every time the search query is updated | |
| function search ($searchQuery){ | |
| //Fields | |
| $searchResult = array(); | |
| //Define Server Variables |
| /* | |
| Assuming jQuery Ajax instead of vanilla XHR | |
| */ | |
| //Get Github Authorization Token with proper scope, print to console | |
| $.ajax({ | |
| url: 'https://api.github.com/authorizations', | |
| type: 'POST', | |
| beforeSend: function(xhr) { | |
| xhr.setRequestHeader("Authorization", "Basic " + btoa("USERNAME:PASSWORD")); |
| #Get the size of each table, ordered by largest to smallest | |
| SELECT table_name AS "Tables", | |
| round(((data_length + index_length) / 1024 / 1024), 2) "Size in MB" | |
| FROM information_schema.TABLES | |
| WHERE table_schema = "YOU+TABLE+NAME+HERE" | |
| ORDER BY (data_length + index_length) DESC; | |
| #Get the size of the entire DB | |
| SELECT table_schema "DB Name", | |
| Round(Sum(data_length + index_length) / 1024 / 1024, 1) "DB Size in MB" |
| <?php | |
| /* | |
| -- the SQL database table | |
| create table form_ajax ( | |
| ID varchar(5) not null, | |
| Name varchar(100), | |
| Address varchar(100), | |
| Phone varchar(20), | |
| Email varchar(255), |
| CREATE TABLE IF NOT EXISTS `country` ( | |
| `id` int(11) NOT NULL AUTO_INCREMENT, | |
| `iso` char(2) NOT NULL, | |
| `name` varchar(80) NOT NULL, | |
| `nicename` varchar(80) NOT NULL, | |
| `iso3` char(3) DEFAULT NULL, | |
| `numcode` smallint(6) DEFAULT NULL, | |
| `phonecode` int(5) NOT NULL, | |
| PRIMARY KEY (`id`) | |
| ) ENGINE=MyISAM DEFAULT CHARSET=latin1; |
Getting started:
Related tutorials:
| <?php | |
| /** | |
| * All custom functions should be defined in this class | |
| * and tied to WP hooks/filters w/in the constructor method | |
| */ | |
| class Custom_Functions { | |
| // Custom metaboxes and fields configuration |
| <?php | |
| /** | |
| * @author James Morris <[email protected]> | |
| */ | |
| $html = <<<'EOF' | |
| <html> | |
| <body> | |
| <h1>Foo</h1> | |
| <div id="content"> |