Changeset 1192442
- Timestamp:
- 07/04/2015 02:33:23 PM (11 years ago)
- Location:
- tt-guest-post-submit/trunk
- Files:
-
- 7 added
- 3 edited
-
assets (added)
-
assets/screenshot-1.PNG (added)
-
assets/screenshot-2.PNG (added)
-
assets/screenshot-3.PNG (added)
-
assets/screenshot-4.PNG (added)
-
assets/screenshot-5.PNG (added)
-
images/phone.png (added)
-
readme.txt (modified) (5 diffs)
-
tt-guest-post-submit.php (modified) (9 diffs)
-
ttgps-style.css (modified) (9 diffs)
Legend:
- Unmodified
- Added
- Removed
-
tt-guest-post-submit/trunk/readme.txt
r1069879 r1192442 4 4 Donate link: http://www.technologiestoday.com.au/donate 5 5 Requires at least: 3.0.1 6 Tested up to: 4. 07 Stable tag: 2.26 Tested up to: 4.2.2 7 Stable tag: 3.0 8 8 License: GPLv2 or later 9 9 License URI: http://www.gnu.org/licenses/gpl-2.0.html 10 10 11 Submit your post as guest user. Add featured image and other media to the post. Easy to use but very usefull. 11 Submit your post as guest user. Add featured image and other media to the post. Easy to use but very usefull. 12 12 13 13 == Description == … … 17 17 TT Guest Post Submit is a plugin that enables you to submit posts with the featuted image as a guest or visitor. Author doesn't have to log in or register to the site. This plugin is very handy for the blog sites where different authors are encouraged to submit posts. 18 18 19 Features included in this plugin sare:19 Features included in this plugin are: 20 20 21 21 * Plugin option page - User can customize settings. … … 31 31 * Redirect user to current page or any other page (which can be set from option page) after successful post submission 32 32 * HTML5 submission form with streamlined CSS styles 33 * Minimum Number of Characters required for the post 34 * Maximum resolution for the uploaded images 35 * Specify File types for upload 36 * Specify file size 37 * Restrict the number of images for upload 38 * Display selected categories in submit form 39 * Ability to select more than one category 40 * Add a default category 41 * Enable/Disable comment on the post 42 * Rich text editor 43 * Multiple notification email 44 * New field added 45 * Enable Filter for title 46 * Let the user choose the title of each field 47 * Ability to rearrange the fields in user interface 48 * Enable/Disable redirection to the new published post after post submission 49 * Google reCaptcha implemented 33 50 34 51 Visit the [TT Guest Post Submit](http://www.technologiestoday.com.au/guide-to-use-tt-guest-post-submit-plugin-for-wordpress/) plugin page for step by step guide to use this plugin. … … 42 59 == Screenshots == 43 60 44 1. TT Guest Post Submit Form 61 1. User Interface 62 2. TTGPS-LITE-General Settings Options 63 3. TTGPS-LITE-Other Options 64 4. TTGPS-FULL-General Settings Options 65 5. TTGPS-FULL-Other Options 66 67 45 68 46 69 == Changelog == … … 73 96 * Option to add filtered words from admin panel. 74 97 * WPDEBUG issue fixed 98 99 = 3.0 = 100 101 * Few minor bug fixed which were reported by users 102 * Added phone number field for the frontend submit form 103 * Option Page is re-organized for better user experience 104 * 17 New features added but can only be used in full version. -
tt-guest-post-submit/trunk/tt-guest-post-submit.php
r1007920 r1192442 19 19 public function __construct(){ 20 20 wp_enqueue_style('ttgps-style', plugins_url('ttgps-style.css',__FILE__)); 21 if (is_admin()){ 21 22 /* 23 wp_enqueue_script('tinymce_min', includes_url('js/tinymce/tinymce.min.js',__FILE__)); 24 wp_enqueue_script('tiny_mce', plugins_url('tiny_mce.js',__FILE__)); 25 */ 26 if (is_admin()){ 22 27 add_action( 'admin_menu', array($this, 'ttgps_add_settings_menu') ); 23 28 add_action( 'admin_init', array($this, 'ttgps_init_settings') ); … … 26 31 $this->enable_shortcode(); 27 32 add_action( 'template_redirect', array($this, 'ttgps_template_redirection') ); 33 28 34 } 29 35 … … 46 52 <div id="tt-general" class="wrap"> 47 53 <h2><?php _e('TT Guest Post Submit Options','ttgps_text_domain'); ?></h2> 54 <div id="short-code">Shortcode for this plugin: [tt-submit-post]</div> 48 55 <form name="ttgps_options_form_settings_api" method="post" action="options.php"> 49 56 <?php settings_fields( 'ttgps_settings' ); ?> … … 60 67 61 68 add_settings_section( 'ttgps_general_settings_section', __('General Settings', 'ttgps_text_domain'), array($this, 'ttgps_general_setting_section_callback'), 'ttgps_settings_section' ); 62 add_settings_section( 'ttgps_field_selection_section', __('Field Selection', 'ttgps_text_domain'), array($this, 'ttgps_field_selection_section_callback'), 'ttgps_settings_section' ); 69 add_settings_section( 'ttgps_imageupload_settings_section', __('Image Upload Settings', 'ttgps_text_domain'), array($this, 'ttgps_imageupload_setting_section_callback'), 'ttgps_settings_section' ); 70 add_settings_section( 'ttgps_google_settings_section', __('Google reCAPTCHA Settings', 'ttgps_text_domain'), array($this, 'ttgps_google_setting_section_callback'), 'ttgps_settings_section' ); 71 add_settings_section( 'ttgps_field_selection_section', __('Field Selection', 'ttgps_text_domain'), array($this, 'ttgps_field_selection_section_callback'), 'ttgps_settings_section' ); 63 72 64 add_settings_field( 'ttgps_chk_notifyfield', __('Send Notification via Email', 'ttgps_text_domain'), array($this,'ttgps_display_check_box'), 'ttgps_settings_section', 'ttgps_general_settings_section', array('name' => 'ttgps_chk_notifyfield' )); 65 add_settings_field( 'ttgps_txt_contact_email', __('Email for Notification', 'ttgps_text_domain'), array($this,'ttgps_display_text_field'), 'ttgps_settings_section', 'ttgps_general_settings_section', array( 'name' => 'ttgps_txt_contact_email', 'txt_type' => 'email', 'place_holder' =>'Email Address For Sending Notification' ) ); 66 add_settings_field( 'ttgps_txt_confirmation_msg', __('Post Submit Confirmation Message', 'ttgps_text_domain'), array($this,'ttgps_display_text_field'), 'ttgps_settings_section', 'ttgps_general_settings_section', array( 'name' => 'ttgps_txt_confirmation_msg', 'txt_type' => 'text', 'place_holder' =>'Type Message To Show When Post Submit Successfull' ) ); 67 add_settings_field( 'ttgps_txt_failure_msg', __('Post Submit Failure Message', 'ttgps_text_domain'), array($this,'ttgps_display_text_field'), 'ttgps_settings_section', 'ttgps_general_settings_section', array( 'name' => 'ttgps_txt_failure_msg', 'txt_type' => 'text', 'place_holder' =>'Type Message To Show When Post Submit Fails' ) ); 68 add_settings_field( 'ttgps_txt_redirect', __('Redirect To', 'ttgps_text_domain'), array($this,'ttgps_display_text_field'), 'ttgps_settings_section', 'ttgps_general_settings_section', array( 'name' => 'ttgps_txt_redirect', 'txt_type' => 'text', 'place_holder' =>'URL to Redirect After Post Submit' ) ); 73 /*GENERAL SETTINGS*/ 74 add_settings_field( 'ttgps_chk_notifyfield', __('Send Notification via Email', 'ttgps_text_domain'), array($this,'ttgps_display_check_box'), 'ttgps_settings_section', 'ttgps_general_settings_section', array('name' => 'ttgps_chk_notifyfield' )); 75 add_settings_field( 'ttgps_txt_contact_email', __('Email for Notification', 'ttgps_text_domain'), array($this,'ttgps_display_text_field'), 'ttgps_settings_section', 'ttgps_general_settings_section', array( 'name' => 'ttgps_txt_contact_email', 'txt_type' => 'email', 'place_holder' =>'Email Address For Sending Notification', 'size'=>50 ) ); 76 add_settings_field( 'ttgps_txt_confirmation_msg', __('Post Submit Confirmation Message', 'ttgps_text_domain'), array($this,'ttgps_display_text_field'), 'ttgps_settings_section', 'ttgps_general_settings_section', array( 'name' => 'ttgps_txt_confirmation_msg', 'txt_type' => 'text', 'place_holder' =>'Type Message To Show When Post Submit Successfull', 'size'=>50 ) ); 77 add_settings_field( 'ttgps_txt_failure_msg', __('Post Submit Failure Message', 'ttgps_text_domain'), array($this,'ttgps_display_text_field'), 'ttgps_settings_section', 'ttgps_general_settings_section', array( 'name' => 'ttgps_txt_failure_msg', 'txt_type' => 'text', 'place_holder' =>'Type Message To Show When Post Submit Fails', 'size'=>50 ) ); 78 /*nf*/add_settings_field( 'ttgps_chk_redirecttopost', __('Allow Redirect to Submitted Post', 'ttgps_text_domain'), array($this,'ttgps_display_check_box'), 'ttgps_settings_section', 'ttgps_general_settings_section', array('name' => 'ttgps_chk_redirecttopost', 'note'=>'Only works when user is logged in or Publish Status is set to "Publish" from plugin option', 'disabled'=>'disabled' )); 79 add_settings_field( 'ttgps_txt_redirect', __('Redirect To', 'ttgps_text_domain'), array($this,'ttgps_display_text_field'), 'ttgps_settings_section', 'ttgps_general_settings_section', array( 'name' => 'ttgps_txt_redirect', 'txt_type' => 'text', 'place_holder' =>'URL to Redirect After Post Submit', 'size'=>50 ) ); 69 80 add_settings_field( 'ttgps_drp_status', __('Publish Status', 'ttgps_text_domain'), array($this,'ttgps_display_dropdown'), 'ttgps_settings_section', 'ttgps_general_settings_section', array( 'name' => 'ttgps_drp_status', 'drp_type' => 'post_status' ) ); 70 81 add_settings_field( 'ttgps_drp_account', __('Guest Account', 'ttgps_text_domain'), array($this,'ttgps_display_dropdown'), 'ttgps_settings_section', 'ttgps_general_settings_section', array( 'name' => 'ttgps_drp_account', 'drp_type' => 'guest_account' ) ); 71 add_settings_field( 'ttgps_txt_maxlength', __('Maximum Length of the post', 'ttgps_text_domain'), array($this,'ttgps_display_text_field'), 'ttgps_settings_section', 'ttgps_general_settings_section', array( 'name' => 'ttgps_txt_maxlength', 'txt_type' => 'number', 'place_holder' =>'Number of characters' ) ); 72 add_settings_field( 'ttgps_chk_filter', __('Enable Filter', 'ttgps_text_domain'), array($this,'ttgps_display_check_box'), 'ttgps_settings_section', 'ttgps_general_settings_section', array('name' => 'ttgps_chk_filter' )); 73 add_settings_field( 'ttgps_txta_filter', __('Add Filtered Words', 'ttgps_text_domain'), array($this,'ttgps_display_text_area'), 'ttgps_settings_section', 'ttgps_general_settings_section', array( 'name' => 'ttgps_txta_filter', 'txt_type' => 'area', 'place_holder' =>'Add Filtered Words' ) ); 74 82 /*nf*/add_settings_field( 'ttgps_drp_editortype', __('Content Editor Type', 'ttgps_text_domain'), array($this,'ttgps_display_dropdown'), 'ttgps_settings_section', 'ttgps_general_settings_section', array( 'name' => 'ttgps_drp_account', 'drp_type' => 'editor_type' ) ); 83 /*nf*/add_settings_field( 'ttgps_txt_minlength', __('Minimum Length of the post', 'ttgps_text_domain'), array($this,'ttgps_display_text_field'), 'ttgps_settings_section', 'ttgps_general_settings_section', array( 'name' => 'ttgps_txt_minlength', 'txt_type' => 'number', 'place_holder' =>'Full Version Only', 'disabled' => 'disabled' ) ); 84 add_settings_field( 'ttgps_txt_maxlength', __('Maximum Length of the post', 'ttgps_text_domain'), array($this,'ttgps_display_text_field'), 'ttgps_settings_section', 'ttgps_general_settings_section', array( 'name' => 'ttgps_txt_maxlength', 'txt_type' => 'number', 'place_holder' =>'Number of characters' ) ); 85 /*nf*/add_settings_field( 'ttgps_chk_comment', __('Enable Comment ', 'ttgps_text_domain'), array($this,'ttgps_display_check_box'), 'ttgps_settings_section', 'ttgps_general_settings_section', array('name' => 'ttgps_chk_comment', 'disabled' => 'disabled' )); 86 add_settings_field( 'ttgps_chk_filter', __('Enable Filter For Post Content', 'ttgps_text_domain'), array($this,'ttgps_display_check_box'), 'ttgps_settings_section', 'ttgps_general_settings_section', array('name' => 'ttgps_chk_filter' )); 87 /*nf*/add_settings_field( 'ttgps_chk_filter_title', __('Enable Filter For Post Title', 'ttgps_text_domain'), array($this,'ttgps_display_check_box'), 'ttgps_settings_section', 'ttgps_general_settings_section', array('name' => 'ttgps_chk_filter_title', 'disabled' => 'disabled' )); 88 add_settings_field( 'ttgps_txta_filter', __('Add Filtered Words', 'ttgps_text_domain'), array($this,'ttgps_display_text_area'), 'ttgps_settings_section', 'ttgps_general_settings_section', array( 'name' => 'ttgps_txta_filter', 'txt_type' => 'area', 'place_holder' =>'Add Filtered Words' ) ); 89 /*nf*/add_settings_field( 'ttgps_drp_allowedcategories', __('Select Categories To Display ', 'ttgps_text_domain'), array($this,'ttgps_display_dropdown'), 'ttgps_settings_section', 'ttgps_general_settings_section', array( 'name' => 'ttgps_drp_allowedcategories', 'drp_type' => 'allowed_categories', 'multiple'=>'multiple' ) ); 90 /*nf*/add_settings_field( 'ttgps_drp_defaultategory', __('Select Default Category ', 'ttgps_text_domain'), array($this,'ttgps_display_dropdown'), 'ttgps_settings_section', 'ttgps_general_settings_section', array( 'name' => 'ttgps_drp_defaultategory', 'drp_type' => 'default_category') ); 91 /*nf*/add_settings_field( 'ttgps_drp_captchaselect', __('Select Captcha Type ', 'ttgps_text_domain'), array($this,'ttgps_display_dropdown'), 'ttgps_settings_section', 'ttgps_general_settings_section', array( 'name' => 'ttgps_drp_captchaselect', 'drp_type' => 'select_captcha') ); 92 93 /*IMAGE UPLOAD*/ 94 95 /*nf*/add_settings_field( 'ttgps_txt_filesize', __('Maximum File Size', 'ttgps_text_domain'), array($this,'ttgps_display_text_field'), 'ttgps_settings_section', 'ttgps_imageupload_settings_section', array( 'name' => 'ttgps_txt_filesize', 'txt_type' => 'number', 'place_holder' =>'Full Version Only', 'disabled' => 'disabled' ) ); 96 /*nf*/add_settings_field( 'ttgps_txt_filetype', __('Allowed File Type', 'ttgps_text_domain'), array($this,'ttgps_display_text_field'), 'ttgps_settings_section', 'ttgps_imageupload_settings_section', array( 'name' => 'ttgps_txt_filetype', 'txt_type' => 'text', 'place_holder' =>'Full Version Only ', 'size'=>50, 'disabled' => 'disabled' ) ); 97 /*nf*/add_settings_field( 'ttgps_txt_numberofimages', __('Maximum Number of Images To Upload', 'ttgps_text_domain'), array($this,'ttgps_display_text_field'), 'ttgps_settings_section', 'ttgps_imageupload_settings_section', array( 'name' => 'ttgps_txt_numberofimages', 'txt_type' => 'number', 'place_holder' =>'Full Version Only', 'disabled'=>'disabled' ) ); 98 /*nf*/add_settings_field( 'ttgps_txt_imageheight', __('Maximum Resolution For Image', 'ttgps_text_domain'), array($this,'ttgps_display_text_field'), 'ttgps_settings_section', 'ttgps_imageupload_settings_section', array( 'name' => 'ttgps_txt_imageheight', 'txt_type' => 'number', 'place_holder' =>'Height In Pixel', 'second_field'=>true, 'disabled'=>'disabled' ) ); 99 100 /*GOOGLE RECAPTCHA*/ 101 add_settings_field( 'ttgps_txt_google_sitekey', __('Site Key', 'ttgps_text_domain'), array($this,'ttgps_display_text_field'), 'ttgps_settings_section', 'ttgps_google_settings_section', array( 'name' => 'ttgps_txt_google_sitekey', 'txt_type' => 'text', 'place_holder' =>'Enter Site Key For Your Website', 'size'=>50, 'disabled'=>'disabled' ) ); 102 add_settings_field( 'ttgps_txt_google_secretkey', __('Secret Key', 'ttgps_text_domain'), array($this,'ttgps_display_text_field'), 'ttgps_settings_section', 'ttgps_google_settings_section', array( 'name' => 'ttgps_txt_google_secretkey', 'txt_type' => 'text', 'place_holder' =>'Enter Secret Key For Your Website ', 'size'=>50, 'disabled'=>'disabled' ) ); 103 104 /*FIELD SELECTION*/ 75 105 add_settings_field( 'ttgps_chk_titlefield', __('Add Title Field', 'ttgps_text_domain'), array($this,'ttgps_display_check_box'), 'ttgps_settings_section', 'ttgps_field_selection_section', array('name' => 'ttgps_chk_titlefield', 'req' => true)); 76 106 add_settings_field( 'ttgps_chk_contentfield', __('Add Post Content Field', 'ttgps_text_domain'), array($this,'ttgps_display_check_box'), 'ttgps_settings_section', 'ttgps_field_selection_section', array('name' => 'ttgps_chk_contentfield', 'req' => true)); 77 add_settings_field( 'ttgps_chk_categoryfield', __('Add Category Field', 'ttgps_text_domain'), array($this,'ttgps_display_check_box'), 'ttgps_settings_section', 'ttgps_field_selection_section', array('name' => 'ttgps_chk_categoryfield', 'req' => true));107 add_settings_field( 'ttgps_chk_categoryfield', __('Add Category Field', 'ttgps_text_domain'), array($this,'ttgps_display_check_box'), 'ttgps_settings_section', 'ttgps_field_selection_section', array('name' => 'ttgps_chk_categoryfield', 'req' => true)); 78 108 add_settings_field( 'ttgps_chk_tagsfield', __('Add Tags Field', 'ttgps_text_domain'), array($this,'ttgps_display_check_box'), 'ttgps_settings_section', 'ttgps_field_selection_section', array('name' => 'ttgps_chk_tagsfield', 'req' => true)); 79 109 add_settings_field( 'ttgps_chk_namefield', __('Add Author\'s Name Field', 'ttgps_text_domain'), array($this,'ttgps_display_check_box'), 'ttgps_settings_section', 'ttgps_field_selection_section', array('name' => 'ttgps_chk_namefield', 'req' => true)); 110 /*nf*/add_settings_field( 'ttgps_chk_phonefield', __('Add Author\'s Contact Number Field', 'ttgps_text_domain'), array($this,'ttgps_display_check_box'), 'ttgps_settings_section', 'ttgps_field_selection_section', array('name' => 'ttgps_chk_phonefield', 'req' => true, 'size'=>35)); 80 111 add_settings_field( 'ttgps_chk_emailfield', __('Add Authors\'s Email Field', 'ttgps_text_domain'), array($this,'ttgps_display_check_box'), 'ttgps_settings_section', 'ttgps_field_selection_section', array('name' => 'ttgps_chk_emailfield', 'req' => true)); 81 112 add_settings_field( 'ttgps_chk_websitefield', __('Add Website Field', 'ttgps_text_domain'), array($this,'ttgps_display_check_box'), 'ttgps_settings_section', 'ttgps_field_selection_section', array('name' => 'ttgps_chk_websitefield', 'req' => true)); 82 113 add_settings_field( 'ttgps_chk_captchafield', __('Add Captcha Field', 'ttgps_text_domain'), array($this,'ttgps_display_check_box'), 'ttgps_settings_section', 'ttgps_field_selection_section', array('name' => 'ttgps_chk_captchafield', 'req' => true)); 83 114 add_settings_field( 'ttgps_chk_uploadafield', __('Add Upload Field', 'ttgps_text_domain'), array($this,'ttgps_display_check_box'), 'ttgps_settings_section', 'ttgps_field_selection_section', array('name' => 'ttgps_chk_uploadfield', 'req' => true)); 84 115 /**/add_settings_field( 'ttgps_lbl_litemsg', __('', 'ttgps_text_domain'), array($this,'ttgps_display_label'), 'ttgps_settings_section', 'ttgps_field_selection_section', array('name' => 'ttgps_lbl_litemsg')); 116 add_settings_field( 'ttgps_chk_featuredimagefield', __('Add Featured Image Field', 'ttgps_text_domain'), array($this,'ttgps_display_check_box'), 'ttgps_settings_section', 'ttgps_field_selection_section', array('name' => 'ttgps_chk_featuredimagefield', 'req' => true, 'size'=>35, 'disabled'=>'disabled')); 117 add_settings_field( 'ttgps_chk_uploadafield1', __('Add Additinal File Upload Field', 'ttgps_text_domain'), array($this,'ttgps_display_check_box'), 'ttgps_settings_section', 'ttgps_field_selection_section', array('name' => 'ttgps_chk_uploadfield1', 'req' => true, 'size'=>35, 'disabled'=>'disabled')); 85 118 } 86 119 87 120 public function ttgps_general_setting_section_callback() { 121 echo "<p class='fullv-msg'>Inactive options are available in full version."; 122 echo "<a href='http://technologiestoday.com.au/product/13523/'>Get Full Version</a></p>"; 88 123 echo "<p>".__("General configuration section", 'ttgps_text_domain')."</p>"; 124 125 } 126 127 public function ttgps_imageupload_setting_section_callback() { 128 echo "<p class='fullv-msg'>Inactive options are available in full version."; 129 echo "<a href='http://technologiestoday.com.au/product/13523/'>Get Full Version</a></p>"; 130 echo "<p class='section-msg'>".__("Image Upload settings can be changed here. If you dont want to set any restrictions for the options below you can just leave them empty.", 'ttgps_text_domain')."</p>"; 131 } 132 133 public function ttgps_google_setting_section_callback() { 134 echo "<p class='fullv-msg'>Inactive options are available in full version."; 135 echo "<a href='http://technologiestoday.com.au/product/13523/'>Get Full Version</a></p>"; 136 echo "<p class='section-msg'>".__("Step 1: In order to use Google reCAPTCHA you need to register your website first. To do that click <a href='https://www.google.com/recaptcha/'>here</a>", 'ttgps_text_domain')."<br>"; 137 echo __("Step 2: Click on 'Get reCAPTCHA' button")."<br>"; 138 echo __("Step 3: Login to your Google account and submit the form")."<br>"; 139 echo __("Step 4: Once submit, Google will provide you two informations. #Site key and #Secret key. Enter those keys in the following fields").""; 89 140 } 90 141 91 142 public function ttgps_field_selection_section_callback() { 143 echo "<p class='fullv-msg'>Inactive options are available in full version."; 144 echo "<a href='http://technologiestoday.com.au/product/13523/'>Get Full Version</a></p>"; 92 145 echo "<p>".__("Select fields which you want to be appear on post submit form", 'ttgps_text_domain')."</p>"; 93 146 } … … 96 149 extract( $data ); 97 150 //$options = get_option( 'ttgps_options' ); 98 99 ?> 100 <input type="<?php echo $txt_type ?>" name="ttgps_options[<?php echo $name; ?>]" placeholder="<?php echo $place_holder; ?>" size="50" value="<?php echo esc_html( $this->options[$name] ); ?>"/><br /> 151 ?> 152 <input type="<?php echo $txt_type ?>" name="ttgps_options[<?php echo $name; ?>]" placeholder="<?php echo $place_holder; ?>" <?php if($txt_type=="number"){echo ' min="0"';} ?> size="<?php echo $size; ?>" <?php echo " ".$disabled; ?> value="<?php echo esc_html( $this->options[$name] ); ?>"/> 101 153 <?php 102 } 103 154 if($second_field){ 155 ?> 156 <label> X </label><input type="number" placeholder="Width In Pixel" min="0" name="ttgps_options[<?php echo 'ttgps_txt_imagewidth'; ?>]" disabled value="<?php echo esc_html( $this->options['ttgps_txt_imagewidth'] ); ?>"/> 157 <?php 158 }else{ 159 //echo "<br />"; 160 } 161 } 162 163 public function ttgps_display_label( $data = array() ){ 164 extract($data); 165 ?> 166 <label id="lite-msg" name="ttgps_options[<?php echo $name; ?>]">Following two options are available in full version only replacing "Ädd Upload Field"</label> 167 <?php 168 } 104 169 105 170 public function ttgps_display_text_area( $data = array() ){ … … 113 178 public function ttgps_display_check_box( $data = array() ) { 114 179 extract ( $data ); 180 115 181 $required_item = $name . "_req"; 116 ?> 117 <input type="checkbox" name="ttgps_options[<?php echo $name; ?>]" <?php if (isset($this->options[$name])) echo ' checked="checked" '; ?>/> 182 $field_title = $name . "_title"; 183 $field_order = $name . "_order"; 184 185 //if($name=='ttgps_chk_filter_title' || $name=='ttgps_chk_filter_order'){$disabled = 'disabled';}else{$disabled='';} 186 ?> 187 <input type="checkbox" <?php echo $disabled; ?> name="ttgps_options[<?php echo $name; ?>]" <?php if (isset($this->options[$name])) echo ' checked="checked" '; ?>/> 118 188 <?php 119 189 120 190 if (isset($req) && $req==true){ 121 191 ?> 122 <label id="required-label"><?php _e('Required', 'ttgps_text_domain'); ?></label> <input type="checkbox" name="ttgps_options[<?php echo $required_item; ?>]" <?php if (isset( $this->options[$required_item] )) echo ' checked="checked" '; ?>/> 123 <?php 124 } 192 <label id="required-label"><?php _e('Required', 'ttgps_text_domain'); ?></label> <input type="checkbox" name="ttgps_options[<?php echo $required_item; ?>]" <?php echo $disabled; ?> <?php if (isset( $this->options[$required_item] )) echo ' checked="checked" '; ?>/> 193 <label id="order-label"><?php _e('Order', 'ttgps_text_domain'); ?></label><input id="num-ord" type="number" disabled min="0" name="ttgps_options[<?php echo $field_order; ?>]" value="<?php echo esc_html( $this->options[$field_order] ); ?>"/> 194 <label id="title-label"><?php _e('Title', 'ttgps_text_domain'); ?></label><input type="text" disabled name="ttgps_options[<?php echo $field_title; ?>]" placeholder="<?php echo "Custom Title For This Field - (Full Version Only)"; ?>" size="50" value="<?php echo esc_html( $this->options[$field_title] ); ?>"/> 195 <label id="optional-label"><?php _e('(Optional)', 'ttgps_text_domain'); ?><br /> 196 <?php 197 } 125 198 } 126 199 127 200 public function ttgps_display_dropdown( $data = array() ) { 128 201 extract($data); 202 $disflag = false; 129 203 if ($drp_type == 'post_status'){ 130 204 $drp_array = array('Publish', 'Pending', 'Draft'); 131 205 }else if($drp_type == 'guest_account'){ 132 $drp_array = get_users(); 133 134 } 135 ?> 136 <select name="ttgps_options[<?php echo $name; ?>]" > 137 <?php 206 $drp_array = get_users(); 207 }else if($drp_type == 'editor_type'){ 208 $drp_array = array('Simple', 'Rich Text(Full) - Full Version Only', 'Rich Text(Tiny) - Full Version Only'); 209 $disflag = true; 210 }else if($drp_type == 'select_captcha'){ 211 $drp_array = array('Easy Captcha', 'Google reCAPTCHA'); 212 $disflag = true; 213 }else if($drp_type == 'allowed_categories' || $drp_type == 'default_category'){ 214 $args = array( 215 'orderby' => 'name', 216 'order' => 'ASC' 217 ); 218 $drp_array = get_categories($args); 219 $disflag = true; 220 $lite = true; 221 } 222 ?> 223 <select name="ttgps_options[<?php echo $name; ?>]" <?php if(isset($multiple)){echo $multiple;} ?> <?php if($lite){echo " disabled='disabled'";}?> > 224 <?php 225 if($drp_type == 'allowed_categories' || $drp_type == 'default_category'){ 226 ?> 227 <option value="">Available in Full Version</option> 228 <?php 229 } 230 231 $counter = 1; 138 232 foreach($drp_array as $drp_item){ 139 233 if($drp_type == 'guest_account'){?> 140 234 <option value="<?php echo $drp_item->display_name; ?>" <?php echo selected( $this->options['ttgps_drp_account'], $drp_item->display_name ); ?> > <?php echo $drp_item->display_name; ?></option> 141 <?php }else{ ?> 142 <option value="<?php echo $drp_item; ?>" <?php echo selected( $this->options['ttgps_drp_status'], $drp_item ); ?> ><?php echo $drp_item; ?></option> 235 <?php }else if($drp_type == 'allowed_categories' || $drp_type == 'default_category'){ ?> 236 <option value="<?php echo $drp_item->cat_ID; ?>"><?php echo $drp_item->name; ?></option> 237 <?php }else{ 238 if($disflag && $counter>1){$disabled = 'disabled';}else{$disabled = '';} 239 ?> 240 <option value="<?php echo $drp_item; ?>" <?php echo $disabled . selected( $this->options['ttgps_drp_status'], $drp_item ); ?> ><?php echo $drp_item; ?></option> 143 241 <?php } 144 } ?> 242 ++$counter; 243 } ?> 145 244 </select> 146 245 <?php … … 199 298 $template_str .= (isset($this->options['ttgps_chk_contentfield_req']) && $this->options['ttgps_chk_contentfield_req']=="on") ? ' required="required" ' : ' '; 200 299 $template_str .= 'placeholder="'.__("Write Your Post Contents", "ttgps_text_domain").'"></textarea>'; 300 201 301 } 202 302 if(isset($this->options['ttgps_chk_categoryfield']) && $this->options['ttgps_chk_categoryfield'] == "on"){ … … 224 324 $template_str .= 'placeholder="'.__("Your Name Here", "ttgps_text_domain").'">'; 225 325 } 326 if(isset($this->options['ttgps_chk_phonefield']) && $this->options['ttgps_chk_phonefield'] == "on"){ 327 $template_str .= '<input type="text" class="txtinput" title="'.__("Please Enter Author\'s Contact Number", "ttgps_text_domain").'" x-moz-errormessage="'.__("Please Enter Author\'s Contact Number", "ttgps_text_domain").'" id="phone" name="phone" size="72"'; 328 $template_str .= (isset($this->options['ttgps_chk_phonefield_req']) && $this->options['ttgps_chk_phonefield_req']=="on") ? ' required="required" ' : ' '; 329 $template_str .= 'placeholder="'.__((isset($this->options['ttgps_chk_phonefield_title'])&&$this->options['ttgps_chk_phonefield_title']!='')? $this->options['ttgps_chk_phonefield_title']:"Your Contact Number Here", "ttgps_text_domain").'">'; 330 ++$field_counter; 331 } 332 226 333 if(isset($this->options['ttgps_chk_emailfield']) && $this->options['ttgps_chk_emailfield'] == "on"){ 227 334 $template_str .= '<input type="email" class="txtinput" title="'.__("Please Enter a Valid Email Address", "ttgps_text_domain").'" x-moz-errormessage="'.__("Please Enter a Valid Email Address", "ttgps_text_domain").'" id="email" name="email" size="72"'; … … 294 401 295 402 296 297 403 add_action( 'init', 'ttgps_plugin_init' ); 298 404 function ttgps_plugin_init() { -
tt-guest-post-submit/trunk/ttgps-style.css
r945411 r1192442 1 1 2 2 /** the form elements **/ 3 4 3 5 #ttgps-form { box-sizing: border-box; } 4 6 … … 24 26 } 25 27 28 #ttgps-form .wp-editor-wrap{ 29 padding: 5px 2px 2px 2px; 30 margin: 50px 0 20px 0; 31 background-color: #E5E5E5; 32 border-radius: 3px; 33 } 34 26 35 #ttgps-form .txtinput:focus, #ttgps-form textarea:focus { 27 36 color: #333; … … 34 43 35 44 #ttgps-form input#title { 36 background: #fff url('images/title.png') 5px 4px no-repeat;45 background: #fff url('images/title.png') 5px 7px no-repeat; 37 46 } 38 47 #ttgps-form input#tags { 39 background: #fff url('images/tags.png') 5px 4px no-repeat; 40 margin-bottom: 50px; 48 background: #fff url('images/tags.png') 5px 7px no-repeat; 41 49 } 42 50 #ttgps-form input#author { 43 background: #fff url('images/user.png') 5px 4px no-repeat;51 background: #fff url('images/user.png') 5px 7px no-repeat; 44 52 } 45 53 #ttgps-form input#email { 46 background: #fff url('images/email.png') 5px 4px no-repeat;54 background: #fff url('images/email.png') 5px 7px no-repeat; 47 55 } 48 56 #ttgps-form input#site { 49 background: #fff url('images/website.png') 5px 4px no-repeat; 57 background: #fff url('images/website.png') 5px 7px no-repeat; 58 } 59 #ttgps-form input#phone { 60 background: #fff url('images/phone.png') 5px 7px no-repeat; 50 61 } 51 62 #ttgps-form input#code { … … 56 67 57 68 58 #ttgps-form textarea.txtblock {69 #ttgps-form textarea.txtblock{ 59 70 background: #fff url('images/speech.png') 5px 4px no-repeat; 60 71 } … … 64 75 float: left; 65 76 width: 90%; 66 margin-right: 50px; 77 margin-right: 50px; 78 margin-bottom: 20px; 67 79 } 68 80 … … 169 181 margin-bottom: 20px; 170 182 margin-right: 20px; 171 float: left;183 /*float: left;*/ 172 184 } 173 185 … … 176 188 padding: 8px 75px 8px 5px; 177 189 margin-bottom: 20px; 178 width: 100%;190 /*width: 100%;*/ 179 191 } 180 192 … … 187 199 padding: 5px 25px 5px 55px; 188 200 font-family: "Helvetica Neue", Arial, sans-serif; 189 width: 100%;201 /*width: 100%;*/ 190 202 font-weight: bold; 191 203 font-size: 16px; … … 220 232 box-shadow: 1px 3px 5px #CFCFCF; 221 233 } 234 235 .fullv-msg{ 236 background-color: #CEE3F6; 237 color: #045FB4; 238 padding: 10px; 239 border-radius: 5px; 240 font-weight: bold; 241 box-shadow: 0 1px 2px rgba(144, 144, 144, 0.4); 242 -moz-box-shadow: 0 1px 2px rgba(144, 144, 144, 0.4); 243 -webkit-box-shadow: 0 1px 2px rgba(144, 144, 144, 0.4); 244 } 245 246 .fullv-msg a{ 247 background-color: #045FB4; 248 color: #ffffff; 249 border-radius: 5px; 250 text-decoration: none; 251 padding: 5px; 252 margin-left: 20px; 253 } 254 #title-label, #required-label, #order-label{ 255 margin: 0 5px 0 20px; 256 } 257 #optional-label{ 258 color: #cfcfcf; 259 } 260 .header-table{ 261 border: 1px solid #cfcfcf; 262 width: 100%; 263 } 264 265 input#num-ord{ 266 width: 50px; 267 } 268 label.err-msg{ 269 text-align: center; 270 font-size: 20px; 271 padding:10px 0 20px 0; 272 color: #0099cc; 273 } 274 275 #lite-msg{ 276 background-color: #808080; 277 padding: 5px 10px; 278 color: #fff; 279 } 280 #short-code{ 281 color:#FFFFFF; 282 font-size: 14px; 283 margin-top: 15px; 284 background-color: #999999; 285 padding: 5px; 286 border-radius: 8px; 287 }
Note: See TracChangeset
for help on using the changeset viewer.