Changeset 654989
- Timestamp:
- 01/18/2013 06:15:04 PM (13 years ago)
- Location:
- mj-contact-us/trunk
- Files:
-
- 1 added
- 6 edited
-
css/mj.css (modified) (1 diff)
-
files/includes.php (modified) (1 diff)
-
files/mj-class-html.php (modified) (2 diffs)
-
files/mj-class-process.php (modified) (2 diffs)
-
index.php (modified) (3 diffs)
-
readme.txt (modified) (4 diffs)
-
screenshot-3.jpg (added)
Legend:
- Unmodified
- Added
- Removed
-
mj-contact-us/trunk/css/mj.css
r647410 r654989 137 137 .h-71{ height:71px;} 138 138 #mailform .w-16{width: 16px;} 139 .p-12{padding: 12px;} 140 .h-43{height:43px;} 141 .h-100{height:100px;} 142 .f-13{font-size:13px;} -
mj-contact-us/trunk/files/includes.php
r647410 r654989 1 1 <?php 2 3 ob_start(); 4 $upload_dir = wp_upload_dir(); 5 /* defined variables */ 6 $atn = (isset($_REQUEST['atn'])) ? $_REQUEST['atn'] : ''; 7 DEFINE('NAME', 'mj-contact-us'); 8 DEFINE('IMGPATH' , plugins_url('/'.NAME.'/images/')); 9 DEFINE('CSSPATH' , plugins_url('/'.NAME.'/css/mj.css')); 10 DEFINE('URL' , admin_url('admin.php?page=mj-mainpage')); 11 DEFINE('ACTION' , $atn); 12 2 13 include( plugin_dir_path( __FILE__ ) . '/mj-class-process.php'); 3 include( plugin_dir_path( __FILE__ ) . '/mj-class-html.php'); 14 include( plugin_dir_path( __FILE__ ) . '/mj-class-html.php'); 15 4 16 ?> -
mj-contact-us/trunk/files/mj-class-html.php
r647410 r654989 19 19 20 20 <div id="container"> 21 <h3 id="reply-title"> Contact US</h3>21 <h3 id="reply-title"><?php _e('Contact US') ;?></h3> 22 22 23 23 24 24 <form action="<?php echo get_permalink($post->ID); ?>" method="post" id="mailform"> 25 25 <div class="h-71"> 26 <label for="name"> Name</label>27 <input requiredname="uname" id="uname" type="name" aria-required="true" >26 <label for="name"><?php _e('Name') ;?><?php echo (get_option('MJname')==1)? "*" : "";?></label> 27 <input <?php echo (get_option('MJname')==1)? "required='required'" : "";?> name="uname" id="uname" type="name" aria-required="true" > 28 28 29 29 </div> 30 30 <div class="h-71"> 31 <label for="email"> E-mail</label>32 <input id="email" requiredname="email" type="email" aria-required="true">31 <label for="email"><?php _e('E-mail') ;?><?php echo (get_option('MJemail')==1)? "*" : "";?></label> 32 <input id="email" <?php echo (get_option('MJemail')==1)? "required" : "";?> name="email" type="email" aria-required="true"> 33 33 34 34 </div> 35 35 <div class="h-71"> 36 <label for="subject"> Subject</label>37 <input id="subject" name="subject" requiredtype="subject" size="30" aria-required="true">36 <label for="subject"><?php _e('Subject') ;?><?php echo (get_option('MJsubject')==1)? "*" : "";?></label> 37 <input id="subject" <?php echo (get_option('MJsubject')==1)? "required" : "";?> name="subject" type="subject" size="30" aria-required="true"> 38 38 39 39 </div> 40 40 <div class="h-71"> 41 <label for="url"> Website</label>42 <input id="url" requiredname="url" type="url" value="" aria-required="true">41 <label for="url"><?php _e('Website') ;?><?php echo (get_option('MJwebsite')==1)? "*" : "";?></label> 42 <input id="url" <?php echo (get_option('MJwebsite')==1)? "required" : "";?> name="url" type="url" value="" aria-required="true"> 43 43 </div> 44 44 <div class="h-134"> 45 <label for="message"> Comment</label>46 <textarea id="comment" name="comment" requiredcols="" rows=""></textarea>45 <label for="message"><?php _e('Comment') ;?><?php echo (get_option('MJcomment')==1)? "*" : "";?></label> 46 <textarea id="comment" name="comment" <?php echo (get_option('MJcomment')==1)? "required" : "";?> cols="" rows=""></textarea> 47 47 </div> 48 <?php if(get_option('MJcopytome')==1):?> 48 49 <div class="h-71"> 49 <label for="message"> Send copy to me</label>50 <label for="message"><?php _e('Send copy to me') ;?></label> 50 51 <input type="checkbox" name="copytome" class="w-16" id="copytome" value="1"> 51 52 </div> 52 53 <?php endif; ?> 53 54 <div> 54 <input name="mj_submit" type="submit" id="submit" value=" Send">55 <input name="mj_submit" type="submit" id="submit" value="<?php _e('Send') ;?>"> 55 56 <input type="hidden" name="mj_submit" value="active"> 56 57 <input type="hidden" name="page_id" value="<?php echo $post->ID; ?>"> … … 62 63 63 64 } 65 function AdminOption(){ ?> 66 <div id="wrap"> 67 <div id="container"> 68 <h3 id="reply-title"><?php _e('Contact US Page Settings') ;?></h3> 69 <form action="" method="post" id="mailform"> 70 <div class="h-43"> 71 <label for="name"><?php _e('Email Address to recieve Email address') ;?></label> 72 <input name="MJmailto" class="f-13" id="mailto" type="text" aria-required="true" value="<?php echo get_option('MJmailto');?>" > 73 <small><i><?php _e('if blank then default mail will goes on '.get_option('admin_email'));?></i></small> 74 </div> 75 <div class="h-43"> 76 <label for="name"><?php _e('Copy to me') ;?></label> 77 <input type="checkbox" class="w-16" name="MJcopytome" <?php echo (get_option('MJcopytome')==1)? "checked='checked'" : "";?> value="1"> <?php _e('Enable this option ?'); ?> 78 </div> 79 <div class="h-100"> 80 <label for="name"><?php _e('Other options') ;?></label> 81 <input type="checkbox" class="w-16" name="MJname" <?php echo (get_option('MJname')==1)? "checked='checked'" : "";?> value="1"><?php _e(' - Required Name ?') ;?><br/> 82 <input type="checkbox" class="w-16" name="MJemail" <?php echo (get_option('MJemail')==1)? "checked='checked'" : "";?> value="1"><?php _e(' - Required Email ?') ;?><br/> 83 <input type="checkbox" class="w-16" name="MJsubject" <?php echo (get_option('MJsubject')==1)? "checked='checked'" : "";?> value="1"><?php _e(' - Required Subject ?') ;?><br/> 84 <input type="checkbox" class="w-16" name="MJwebsite" <?php echo (get_option('MJwebsite')==1)? "checked='checked'" : "";?> value="1"><?php _e(' - Required Website ?') ;?><br/> 85 <input type="checkbox" class="w-16" name="MJcomment" <?php echo (get_option('MJcomment')==1)? "checked='checked'" : "";?> value="1"><?php _e(' - Required Comment ?') ;?><br/> 86 </div> 87 <div> 88 <input name="MJact" type="hidden" id="MJact" value="insert"> 89 <input name="Save" type="submit" id="Save" value="<?php _e('Save') ;?>"> 90 </div> 91 </form> 92 </div> 93 </div> 94 <?php 95 } 64 96 } 65 97 -
mj-contact-us/trunk/files/mj-class-process.php
r647410 r654989 9 9 $url = strip_tags($_REQUEST['url']); 10 10 $comment = strip_tags($_REQUEST['comment']); 11 $to = get_option('admin_email');11 $to = (get_option('MJmailto')) ? get_option('MJmailto') : get_option('admin_email'); 12 12 $subject = (empty($subject))? "Contact Us mail" : $subject; 13 13 $message = " … … 116 116 } 117 117 118 function AdminOptionProcess(){ 119 if(isset($_POST['MJact']) && $_POST['MJact']=="insert"){ 120 $MJmailto = (!empty($_POST['MJmailto'])) ? $_POST['MJmailto'] : get_option('admin_email'); 121 $MJcopytome = isset($_POST['MJcopytome'])? 1 :0; 122 $MJname = isset($_POST['MJname'])? 1 :0; 123 $MJemail = isset($_POST['MJemail'])? 1 :0; 124 $MJsubject = isset($_POST['MJsubject'])? 1 :0; 125 $MJwebsite = isset($_POST['MJwebsite'])? 1 :0; 126 $MJcomment = isset($_POST['MJcomment'])? 1 :0; 127 if(is_email($MJmailto)){ 128 update_option('MJmailto',$MJmailto); 129 update_option('MJcopytome',$MJcopytome); 130 update_option('MJname',$MJname); 131 update_option('MJemail',$MJemail); 132 update_option('MJsubject',$MJsubject); 133 update_option('MJwebsite',$MJwebsite); 134 update_option('MJcomment',$MJcomment); 135 echo "<div class='updated p-12' id='message'><div class='p-12'>Success : Data saved Successfully</div></div>"; 136 137 }else{ 138 echo "<div class='error'><div class='p-12'>Error : Please enter valid email address</div></div>"; 139 } 140 } 141 } 142 143 function AdminSwitch(){ 144 switch(ACTION){ 145 case 1: 146 _e('action'); 147 break; 148 149 default : 150 self::AdminOptionProcess(); 151 mjContactHTML::AdminOption(); 152 break; 153 } 154 } 118 155 119 156 } 120 121 157 ?> -
mj-contact-us/trunk/index.php
r647410 r654989 3 3 Plugin Name: MJ Contact us 4 4 Plugin URI: http://mecontact.wordpress.com/mj-contact-us-plugin/ 5 Description: mj contact us a simple form with 4-5 fields to send email address to admin . its a simple contact us form with easy to customize coding standard and easy to customize html standard. <strong>add this code [mjcontactus]in page from admin section to activate plugin form also be sure that you have get_header() function in your header file so that validation can be work properly</strong>5 Description: mj contact us a simple form with 4-5 fields to send email address to admin . its a simple contact us form with easy to customize coding standard and easy to customize html standard. <strong>add this code</strong> [mjcontactus] <strong>in page from admin section to activate plugin form also be sure that you have get_header() function in your header file so that validation can be work properly</strong> 6 6 Author: anil kumar 7 Version: 5. 17 Version: 5.2 8 8 Author URI: http://about.me/anilDhiman 9 9 */ … … 13 13 add_action("wp_enqueue_scripts", "my_jquery_enqueue"); 14 14 add_shortcode('mjcontactus', 'mj_contact_us'); 15 /* add_action('admin_menu', 'mjcontactmenu'); */ 15 add_action('admin_menu', 'AdminIndex'); 16 16 17 function my_jquery_enqueue() { 17 18 wp_deregister_script('mjform'); … … 27 28 28 29 function mj_contact_us(){ 29 $object = new mjContactHTML; 30 $object->mjForm(); 31 $object->send_mail(); 30 $object = new mjContactHTML; 31 $object->mjForm(); 32 $object->send_mail(); 33 } 34 function AdminIndex(){ 35 add_menu_page('Mj Contact US', 'Mj Contact US', 'manage_options', 'mj-mainpage', 'AdminMainPage'); 36 } 37 function AdminMainPage(){ 38 $obj = new mjContactPRO; 39 $obj->AdminSwitch(); 32 40 } 33 34 35 41 ?> -
mj-contact-us/trunk/readme.txt
r647733 r654989 6 6 Requires at least: 3.0.1 7 7 Tested up to: 3.5 8 Stable tag: 5. 18 Stable tag: 5.2 9 9 License: GPLv2 or later 10 10 License URI: http://www.gnu.org/licenses/gpl-2.0.html … … 37 37 38 38 1. Upload 'mj-contactus' file to the `/wp-content/plugins/` directory 39 1. Activate the plugin through the 'Plugins' menu in WordPress40 1. Place `[mjcontactus]` in your page editor or in templates paste this code mj_contact_us();41 39 2. Activate the plugin through the 'Plugins' menu in WordPress 40 3. Place `[mjcontactus]` in your page editor or in templates paste this code mj_contact_us(); 41 4. Do the admin setting as per your requirement 42 42 43 43 == Frequently Asked Questions == … … 54 54 == Screenshots == 55 55 56 1. simple contact us form screen shot. 57 2. validation view of form. 56 1. Simple contact us form screen shot. 57 2. Validation view of form. 58 3. Admin area for setting. 58 59 59 60 == Changelog == 60 = 5.0 = 61 62 = 5.2 = 63 * added admin options 64 * validations are optional 65 66 = 5.1 = 61 67 * add the jquery validation 62 68 * changes in form design … … 71 77 = 5.0 = 72 78 = 5.1 = 79 = 5.2 =
Note: See TracChangeset
for help on using the changeset viewer.