Plugin Directory

Changeset 1192442


Ignore:
Timestamp:
07/04/2015 02:33:23 PM (11 years ago)
Author:
rashed.latif
Message:

Update to 3.0

Location:
tt-guest-post-submit/trunk
Files:
7 added
3 edited

Legend:

Unmodified
Added
Removed
  • tt-guest-post-submit/trunk/readme.txt

    r1069879 r1192442  
    44Donate link: http://www.technologiestoday.com.au/donate
    55Requires at least: 3.0.1
    6 Tested up to: 4.0
    7 Stable tag: 2.2
     6Tested up to: 4.2.2
     7Stable tag: 3.0
    88License: GPLv2 or later
    99License URI: http://www.gnu.org/licenses/gpl-2.0.html
    1010
    11 Submit your post as guest user. Add featured image and other media to the post. Easy to use but very usefull.
     11Submit your post as guest user. Add featured image and other media to the post. Easy to use but very usefull. 
    1212
    1313== Description ==
     
    1717TT 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.
    1818
    19 Features included in this plugins are:
     19Features included in this plugin are:
    2020
    2121* Plugin option page - User can customize settings.
     
    3131* Redirect user to current page or any other page (which can be set from option page) after successful post submission
    3232* 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
    3350
    3451Visit 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.
     
    4259== Screenshots ==
    4360
    44 1. TT Guest Post Submit Form
     611. User Interface
     622. TTGPS-LITE-General Settings Options
     633. TTGPS-LITE-Other Options
     644. TTGPS-FULL-General Settings Options
     655. TTGPS-FULL-Other Options
     66
     67
    4568
    4669== Changelog ==
     
    7396* Option to add filtered words from admin panel.
    7497* 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  
    1919    public function __construct(){
    2020        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()){
    2227        add_action( 'admin_menu', array($this, 'ttgps_add_settings_menu') );
    2328            add_action( 'admin_init', array($this, 'ttgps_init_settings') );
     
    2631        $this->enable_shortcode();
    2732    add_action( 'template_redirect', array($this, 'ttgps_template_redirection')  );
     33
    2834    }
    2935   
     
    4652    <div id="tt-general" class="wrap">
    4753            <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>
    4855            <form name="ttgps_options_form_settings_api" method="post" action="options.php">
    4956        <?php settings_fields( 'ttgps_settings' ); ?>
     
    6067       
    6168    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' );
    6372       
    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  ) );
    6980        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' ) );
    7081    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*/
    75105        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));
    76106    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));
    78108    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));
    79109    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));
    80111        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));
    81112    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));
    82113        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));
    83114        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'));
    85118    }
    86119   
    87120    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>";
    88123    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")."";
    89140    }
    90141   
    91142    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>";
    92145        echo "<p>".__("Select fields which you want to be appear on post submit form", 'ttgps_text_domain')."</p>";
    93146    }
     
    96149    extract( $data );
    97150    //$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] ); ?>"/>
    101153    <?php
    102     }
    103 
     154        if($second_field){
     155            ?>
     156            <label>&nbsp;X&nbsp;</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    }
    104169   
    105170    public function ttgps_display_text_area( $data = array() ){
     
    113178    public function ttgps_display_check_box( $data = array() ) {
    114179    extract ( $data );
     180
    115181    $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" '; ?>/>
    118188    <?php
    119189   
    120190    if (isset($req) && $req==true){
    121191    ?>
    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        }
    125198    }
    126199
    127200    public function ttgps_display_dropdown( $data = array() ) {
    128201    extract($data);
     202        $disflag = false;
    129203    if ($drp_type == 'post_status'){
    130204        $drp_array = array('Publish', 'Pending', 'Draft'); 
    131205    }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;
    138232        foreach($drp_array as $drp_item){
    139233        if($drp_type == 'guest_account'){?>
    140234            <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>   
    143241        <?php }
    144         } ?>
     242                ++$counter;
     243            } ?>
    145244    </select>
    146245    <?php
     
    199298                    $template_str .= (isset($this->options['ttgps_chk_contentfield_req']) && $this->options['ttgps_chk_contentfield_req']=="on") ? ' required="required" ' : ' ';
    200299                    $template_str .= 'placeholder="'.__("Write Your Post Contents", "ttgps_text_domain").'"></textarea>';
     300                   
    201301                    }
    202302                    if(isset($this->options['ttgps_chk_categoryfield']) && $this->options['ttgps_chk_categoryfield'] == "on"){   
     
    224324                    $template_str .= 'placeholder="'.__("Your Name Here", "ttgps_text_domain").'">';       
    225325                    }
     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                                   
    226333                    if(isset($this->options['ttgps_chk_emailfield']) && $this->options['ttgps_chk_emailfield'] == "on"){
    227334                    $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"';
     
    294401
    295402
    296 
    297403add_action( 'init', 'ttgps_plugin_init' );
    298404function ttgps_plugin_init() {
  • tt-guest-post-submit/trunk/ttgps-style.css

    r945411 r1192442  
    11
    22/** the form elements **/
     3
     4
    35#ttgps-form { box-sizing: border-box; }
    46
     
    2426}
    2527
     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
    2635#ttgps-form .txtinput:focus, #ttgps-form textarea:focus {
    2736    color: #333;
     
    3443
    3544#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;
    3746}
    3847#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;
    4149}
    4250#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;
    4452}
    4553#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;
    4755}
    4856#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;
    5061}
    5162#ttgps-form input#code {
     
    5667
    5768
    58 #ttgps-form textarea.txtblock {
     69#ttgps-form textarea.txtblock{
    5970    background: #fff url('images/speech.png') 5px 4px no-repeat;
    6071}
     
    6475    float: left;
    6576    width: 90%;
    66     margin-right: 50px;
     77    margin-right: 50px;
     78    margin-bottom: 20px;
    6779}
    6880
     
    169181    margin-bottom: 20px;
    170182    margin-right: 20px;
    171     float: left;
     183    /*float: left;*/
    172184}
    173185
     
    176188    padding: 8px 75px 8px 5px;
    177189    margin-bottom: 20px;
    178     width: 100%;
     190    /*width: 100%;*/
    179191}
    180192
     
    187199    padding: 5px 25px 5px 55px;
    188200    font-family: "Helvetica Neue", Arial, sans-serif;
    189     width: 100%;
     201    /*width: 100%;*/
    190202    font-weight: bold;
    191203    font-size: 16px;
     
    220232    box-shadow: 1px 3px 5px #CFCFCF;
    221233}
     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
     265input#num-ord{
     266    width: 50px;
     267}
     268label.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.