Changeset 1473209
- Timestamp:
- 08/12/2016 04:46:40 PM (10 years ago)
- Location:
- wp-mail-sending-widget-form
- Files:
-
- 29 added
- 4 edited
-
tags/2.0.1 (added)
-
tags/2.0.1/css (added)
-
tags/2.0.1/css/bootstrap.min.css (added)
-
tags/2.0.1/custom.css (added)
-
tags/2.0.1/extra.php (added)
-
tags/2.0.1/fonts (added)
-
tags/2.0.1/fonts/glyphicons-halflings-regular.eot (added)
-
tags/2.0.1/fonts/glyphicons-halflings-regular.svg (added)
-
tags/2.0.1/fonts/glyphicons-halflings-regular.ttf (added)
-
tags/2.0.1/fonts/glyphicons-halflings-regular.woff (added)
-
tags/2.0.1/fonts/glyphicons-halflings-regular.woff2 (added)
-
tags/2.0.1/init.php (added)
-
tags/2.0.1/js (added)
-
tags/2.0.1/js/bootstrap.min.js (added)
-
tags/2.0.1/js/custom.js (added)
-
tags/2.0.1/wpmwp.php (added)
-
tags/2.0.1/wpwp.php (added)
-
trunk/css (added)
-
trunk/css/bootstrap.min.css (added)
-
trunk/extra.php (added)
-
trunk/fonts (added)
-
trunk/fonts/glyphicons-halflings-regular.eot (added)
-
trunk/fonts/glyphicons-halflings-regular.svg (added)
-
trunk/fonts/glyphicons-halflings-regular.ttf (added)
-
trunk/fonts/glyphicons-halflings-regular.woff (added)
-
trunk/fonts/glyphicons-halflings-regular.woff2 (added)
-
trunk/init.php (modified) (2 diffs)
-
trunk/js (added)
-
trunk/js/bootstrap.min.js (added)
-
trunk/js/custom.js (added)
-
trunk/readme.txt (modified) (2 diffs)
-
trunk/wpmwp.php (modified) (5 diffs)
-
trunk/wpwp.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
wp-mail-sending-widget-form/trunk/init.php
r1473196 r1473209 2 2 3 3 /** 4 * Plugin Name: WP mail Widget Plugin4 * Plugin Name: WP mail-sending Widget 5 5 * Plugin URI: http://prashaddey.com 6 6 * Author: Prashad 7 7 * Author URI: http://prashaddey.com 8 * version: 1.018 * version: 2.01 9 9 * Description: This Plugin will create a widget which will help you to create a submit form on the frontend of your website. 10 10 * The form will not only send an email with the infos of the subscribers to your email address but also save those infos on the plugin setting page on your dashboard. … … 18 18 include dirname( __FILE__ ) . '/wpwp.php'; 19 19 20 // Plugin Activation Hook 21 register_activation_hook( __FILE__, 'callback_of_plugin_activation' ); 22 23 // Plugin Activation function 24 // Creating a table for the plugin 25 function callback_of_plugin_activation(){ 26 global $wpdb; 27 $table = $wpdb->prefix . 'a_wp_mail'; 28 $charset_collate = $wpdb->get_charset_collate(); // What does this line do? Allah knows.. 29 30 require_once( ABSPATH . 'wp-admin/includes/upgrade.php' ); 31 $sql = "CREATE TABLE $table ( 32 id INT NOT NULL AUTO_INCREMENT, 33 name varchar(50) NOT NULL, 34 email varchar(50) NOT NULL, 35 phone varchar(20) NOT NULL, 36 UNIQUE KEY id (id) 37 ) $charset_collate;"; 38 dbDelta( $sql ); 39 40 } 41 20 42 new WPWP; 21 43 22 44 23 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 -
wp-mail-sending-widget-form/trunk/readme.txt
r1473196 r1473209 3 3 Requires at least: 3.0.1 4 4 Tested up to: 4.5.3 5 Stable tag: 1.025 Stable tag: 2.0.1 6 6 License: GPLv2 or later 7 7 License URI: http://www.gnu.org/licenses/gpl-2.0.html … … 61 61 62 62 = 1.01 = 63 * Adding two new classes, WPMWP & WPWP. 63 * Added two new classes, WPMWP & WPWP. 64 65 = 2.0.1 = 66 * Added dashboard options page for the plugin. 67 * Added new styles. 68 * Made Responsive and mobile friendly. 64 69 65 70 66 71 72 73 -
wp-mail-sending-widget-form/trunk/wpmwp.php
r1473196 r1473209 18 18 // Creating widget method to display on frontend 19 19 public function widget( $args, $db ){ 20 global $wpdb; 21 20 22 $title = ! empty( $db['title'] ) ? $db['title'] : "Edit this title from your widget option."; 21 23 $admin_mail = ! empty($db['admin_mail']) ? $db['admin_mail'] : ''; 22 24 23 25 ?> 24 26 <?php echo $args['before_widget']; ?> … … 30 32 31 33 <form action="" method="POST"> 32 <label for="id_name">Your Name e:</label> <br>34 <label for="id_name">Your Name:</label> <br> 33 35 <input type="text" name="id_name" id="id_name" value="" placeholder="Enter name.." required> 34 36 <br> … … 42 44 </form> 43 45 44 <p >46 <p style="color: #FFF;"> 45 47 <?php 46 48 if(isset($_POST['submit_form'])){ … … 55 57 $id_email = $_POST['id_email']; 56 58 } 59 60 // SENDING MAIL 57 61 $msg = "Your newly subscriber name is " . $id_name . ", phone number: " . $id_number . " & email address: " . $id_email; 58 59 62 $mail = mail($admin_mail, 'A new subscriber!', $msg); 60 63 … … 66 69 } 67 70 echo $err; 71 72 73 74 // INSERTING TO OUR DATABASE 75 // $tablename = $wpdb->prefix . 'a_wp_mail'; 76 // cols = id, name, email, phone 77 $tablename = $wpdb->prefix . 'a_wp_mail'; 78 $wpdb->insert($tablename, array( 79 'name' => $id_name, 80 'email' => $id_email, 81 'phone' => $id_number 82 )); 83 68 84 69 85 } -
wp-mail-sending-widget-form/trunk/wpwp.php
r1473196 r1473209 8 8 class WPWP{ 9 9 public function __construct(){ 10 11 // Enqueueing Style and Scripts files - FRONTEND 12 add_action('wp_enqueue_scripts', array( &$this, 'callback_of_wp_enqueue') ); 13 14 // Enqueueing Style and Scripts files - BACKEND 15 add_action('admin_enqueue_scripts', array( &$this, 'callback_of_admin_enqueue')); 16 17 // Adding Menu for the plugin 18 add_action('admin_menu', array( &$this, 'callback_of_admin_menu') ); 19 10 20 // Creating Widget 11 21 add_action('widgets_init', array( &$this, 'callback_of_widgets_init') ); 12 13 // Enqueueing Style and Scripts files 14 add_action('wp_enqueue_scripts', array( &$this, 'callback_of_wp_enqueue') ); 22 15 23 } 16 24 17 // ALL Plublic functions 25 26 /******* ALL Plublic functions *******/ 27 18 28 public function callback_of_widgets_init(){ 19 29 register_widget( 'WPMWP' ); 20 30 } 21 31 32 // FRONTEND Enqueue 22 33 public function callback_of_wp_enqueue(){ 23 34 // Enqueueing Style files … … 25 36 26 37 } 38 39 // BACKEND Enqueue 40 public function callback_of_admin_enqueue(){ 41 // Style files 42 wp_enqueue_style( 'bootstrap-css', plugins_url('/css/bootstrap.min.css', __FILE__)); 43 44 // Scripts files 45 wp_enqueue_script( 'bootstrap-script', plugins_url( '/js/bootstrap.min.js', __FILE__ ), array('jquery')); 46 wp_enqueue_script( 'custom-script', plugins_url( '/js/custom.js', __FILE__ ), array('bootstrap-script')); 47 } 48 49 50 // Adding Menu Options 51 public function callback_of_admin_menu(){ 52 add_menu_page('WP mail-sending Widget', 'WP mail Widget', 'manage_options', 'slug-wp-mail-widget', array( &$this, 'callback_of_add_menu_page'), 'dashicons-email', 59); 53 } 54 55 56 // Menu Displaying function 57 public function callback_of_add_menu_page(){ 58 ?> 59 <div class="wrap container"> 60 <h2>WP mail-sending Widget Setting</h2> <br> 61 <form action="options.php" method="POST"> 62 <table class="table table-striped table-hover"> 63 <thead> 64 <tr> 65 <th>#</th> 66 <th>Firstname</th> 67 <th>Email</th> 68 <th>Phone #</th> 69 </tr> 70 </thead> 71 <tbody> 72 <?php 73 74 global $wpdb; 75 $tablename = $wpdb->prefix . 'a_wp_mail'; 76 $sql = "SELECT * FROM $tablename"; 77 $infos = $wpdb->get_results( $sql, 'OBJECT_K' ); 78 $i = 1; 79 80 foreach( $infos as $info ) : 81 ?> 82 <tr> 83 <td><?php echo $i; ?></td> 84 <td><?php echo $info->name; ?></td> 85 <td><?php echo $info->email; ?></td> 86 <td><?php echo $info->phone; ?></td> 87 </tr> 88 <?php 89 $i++; 90 endforeach; 91 ?> 92 93 </tbody> 94 </table> 95 96 97 </form> 98 </div> 99 <?php 100 } 101 102 27 103 }
Note: See TracChangeset
for help on using the changeset viewer.