Plugin Directory

Changeset 1546421


Ignore:
Timestamp:
12/06/2016 11:42:45 AM (9 years ago)
Author:
jitenit
Message:

updated to latest version 2

Location:
faq-in-minute/trunk
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • faq-in-minute/trunk/faq.php

    r1354020 r1546421  
    22
    33<style type="text/css">
    4     .panel-heading span
    5     {
    6         margin-top: -21px;
    7         font-size: 15px;
    8         margin-right: -9px;
     4
     5.faq_heading {
     6    background-color: <?php echo $faqsettingdata['faq_in_minute_cat_text_field_0'];?>!important ;
     7    color: <?php echo $faqsettingdata['faq_in_minute_cat_text_field_2']; ?>!important ;
     8    text-decoration: none ;
     9    cursor: pointer;   
     10}
     11    .panel-heading.faq_heading {     
     12    background: <?php echo $faqsettingdata['faq_in_minute_cat_text_field_0'];?>!important ;
     13    color: <?php echo $faqsettingdata['faq_in_minute_cat_text_field_2']; ?>!important ;
     14    text-decoration: none ;
     15    cursor: pointer;
     16     }
     17    .collapsed.faq_link {
     18    box-shadow: 0 0;
    919    }
    10     a.clickable { color: inherit; }
    11     a.clickable:hover { text-decoration:none; }
    12     .panel-heading{
    13         padding:12px 25px;
    14         -webkit-border-radius: 7px;
    15         -moz-border-radius: 7px;
    16         border-radius: 7px;
    17         background-color: #e1e1e1;
    18         border: solid 1px #cacaca;
    19         color:#1d1d1d;
    20         font-size:18px;
    21         font-family: 'OpenSansRegular';
    22     }
    23 
    24     .panel-body{
    25         padding:25px;
    26     }
    27     .panel-heading i{
    28         font-size:25px;
    29         color:#fff;
    30         text-shadow: 0 0 1px rgba(0,0,0,.45);
    31     }
    32     .panel{
    33         box-shadow:none;
    34         margin:1px 0;
    35         border-bottom:none;
    36     }
    37 
    38     .firstleftlable{
    39         background:url(<?php echo plugins_url('images/firstaccordingtab.png', __FILE__); ?>) no-repeat <?php echo $faqsettingdata['faq_in_minute_cat_text_field_0']; ?>;
    40         background-size: auto 100%;
    41     }
    42     .secoendtleftlable{
    43         background:url(<?php echo plugins_url('images/secoendaccordingtab.png', __FILE__); ?>) no-repeat <?php echo $faqsettingdata['faq_in_minute_cat_text_field_0']; ?>;
    44         background-size: auto 100%;
    45     }
    46     .thirdtleftlable{
    47         background:url(<?php echo plugins_url('images/thirdaccordingtab.png', __FILE__); ?>) no-repeat <?php echo $faqsettingdata['faq_in_minute_cat_text_field_0']; ?>;
    48         background-size: auto 100%;
    49     }
    50     .fourtleftlable{
    51         background:url(<?php echo plugins_url('images/fouraccordingtab.png', __FILE__); ?>) no-repeat <?php echo $faqsettingdata['faq_in_minute_cat_text_field_0']; ?>;
    52         background-size: auto 100%;
    53     }
    54 
    5520    .cursor-desing{
    5621        cursor: pointer;
    5722    }
    58    
    59      .new_fq {
    60         color: <?php echo $faqsettingdata['faq_in_minute_cat_text_field_2']; ?>;
    61         cursor: pointer;
    62         font-family: "<?php echo $faqsettingdata['faq_in_minute_cat_select_field_6']; ?>";
    63         font-size: 14.375px;
    64         font-weight:<?php echo $faqsettingdata['faq_in_minute_cat_radio_field_3']; ?>;
    65         outline-style: none;
    66     }
    67 
     23   
    6824</style>
    69 <div id="container">
    70     <div id="content">
    71 
    72         <?php $color_fim = array('firstleftlable', 'secoendtleftlable', 'thirdtleftlable', 'fourtleftlable'); ?>
    73 
    74         <?php
    75         $args = array(
    76             'posts_per_page' => $posts_per_page,
    77             'offset' => 0,
    78             'category' => '',
    79             'category_name' => $cat,
    80             'faqcategory'=>$faqcat,
    81             'orderby' => 'post_date',
    82             'order' => $ord,
    83             'include' => '',
    84             'exclude' => '',
    85             'meta_key' => '',
    86             'meta_value' => '',
    87             'post_type' => 'faq_in_minute_cat',
    88             'post_mime_type' => '',
    89             'post_parent' => 0,
    90             'post_status' => 'publish',
    91         );
    92         $all_data = get_posts($args);
    93 
    94       // echo '<pre>' ;   print_r($all_data) ;
    95 
    96         $post_data_new = get_post($p_id);
    97        
    98     // echo '<pre>' ;   print_r($post_data_new) ;
    99         $i = 0;
    100         $count = 0;
    101 
    102         foreach ($all_data as $a) {
    103 
    104             if ($count == count($color_fim)) {
    105 
    106                 $i = 0;
    107                 $count = 0;
    108             }
    109 
    110             $np_id = $a->ID;
    111             if ($np_id != $post_id) {
    112                 $post_data_new = get_post($np_id);
    113                 ?>
    114 
    115                 <div class="col-md-12 no-padding">
    116                     <div class="panel">
    117                         <div class="panel-heading clickable <?php echo $color_fim[$i] ?> cursor-desing">
    118                             <div class="new_fq panel-title">
    119         <?php echo get_the_title($np_id); ?> 
    120 
    121                             </div>
    122                             <span class="pull-right "><i class="fa fa-minus-circle"></i></span>
    123                         </div>
    124                         <div class="panel-body">
    125         <?php echo apply_filters('the_content', $post_data_new->post_content); ?>
    126                         </div>
    127                     </div>
    128                 </div>
    129         <?php
    130     }
    131     $i++;
    132     $count++;
    133 }
    134 ?>
    135     </div>
    136 </div>
  • faq-in-minute/trunk/faq_all.php

    r1354025 r1546421  
    44 * Plugin URI: twitter.com/jitendra_popat
    55 * Description: Create your Faq in just minute. active plugin.go to admin. add new FAQ. and just simple paste this [showallfaq] in your page or in post. use [showallfaq] or [faq-in-minute] to display list of all FAQ. FAQ with modern Design. And for category base [showallfaq category="categoryname"]
    6  * Version: 1.6
     6 * Version: 2.0
    77 * Author: Jiten IT - Jitendra
    88 * Author URI: twitter.com/jitendra_popat
     
    1111if (!function_exists('faq_details')) {
    1212
    13 // Register Custom Post Type
     13// Register faq Post Type
    1414    function faq_in_minute_cat() {
    15 
    1615        $labels = array(
    1716            'name' => _x('FAQ', 'Post Type General Name', 'text_domain'),
     
    3029            'not_found' => __('Not found', 'text_domain'),
    3130            'not_found_in_trash' => __('Not found in Trash', 'text_domain'),
    32         );
     31            );
    3332        $args = array(
    3433            'label' => __('faq_in_minute_cat', 'text_domain'),
     
    5049            'publicly_queryable' => true,
    5150            'capability_type' => 'page',
    52         );
     51            );
    5352        register_post_type('faq_in_minute_cat', $args);
    5453
     
    6564            'new_item_name' => __('New faqcategory Name'),
    6665            'menu_name' => __('faqcategory'),
    67         );
     66            );
    6867
    6968        $args = array(
     
    7473            'query_var' => true,
    7574            'rewrite' => array('slug' => 'faqcategory'),
    76         );
     75            );
    7776        register_taxonomy('faqcategory', array('faq_in_minute_cat'), $args);
    7877    }
     
    102101        'faq_in_minute_cat_settings_section_callback',
    103102        'pluginPage'
    104     );
     103        );
    105104    add_settings_field(
    106105        'faq_in_minute_cat_text_field_0',
     
    109108        'pluginPage',
    110109        'faq_in_minute_cat_pluginPage_section'
    111     );
     110        );
    112111    add_settings_field(
    113112        'faq_in_minute_cat_text_field_2',
     
    116115        'pluginPage',
    117116        'faq_in_minute_cat_pluginPage_section'
    118     );
    119     add_settings_field(
    120         'faq_in_minute_cat_radio_field_3',
    121         __( 'Bold Font', 'text_domain' ),
    122         'faq_in_minute_cat_radio_field_3_render',
    123         'pluginPage',
    124         'faq_in_minute_cat_pluginPage_section'
    125     );
    126     add_settings_field(
    127         'faq_in_minute_cat_select_field_6',
    128         __( 'Font Family of FAQ', 'text_domain' ),
    129         'faq_in_minute_cat_select_field_6_render',
    130         'pluginPage',
    131         'faq_in_minute_cat_pluginPage_section'
    132     );
     117        );
     118
    133119}
    134120function faq_in_minute_cat_text_field_0_render(  ) {
     
    148134    <?php
    149135}
    150 function faq_in_minute_cat_radio_field_3_render(  ) {
    151 
    152     $options = get_option( 'faq_in_minute_cat_settings' );
    153     $faq_tab_text_bold =  $options['faq_in_minute_cat_radio_field_3'];
    154 
    155      if ($faq_tab_text_bold=="") {
    156         $faq_tab_text_bold ="bold";
    157 } else {
    158  $faq_tab_text_bold = $faq_tab_text_bold ;
    159   } ?>
    160    Yes <input type='radio' name='faq_in_minute_cat_settings[faq_in_minute_cat_radio_field_3]' <?php checked( $faq_tab_text_bold, 'bold' ); ?> value='bold'>
    161     No <input type='radio' name='faq_in_minute_cat_settings[faq_in_minute_cat_radio_field_3]' <?php checked( $faq_tab_text_bold, 'none' ); ?> value='none'>
    162      
    163     <?php
    164 }
    165 function faq_in_minute_cat_select_field_6_render(  ) {
    166 
    167     $options = get_option( 'faq_in_minute_cat_settings' );
    168     ?>
    169     <select name='faq_in_minute_cat_settings[faq_in_minute_cat_select_field_6]'>
    170         <option value='OpenSansRegular' <?php selected( $options['faq_in_minute_cat_select_field_6'], 'OpenSansRegular'); ?>>OpenSansRegular</option>
    171         <option value='Times New Roman' <?php selected( $options['faq_in_minute_cat_select_field_6'], 'Times New Roman' ); ?>>Times New Roman</option>
    172         <option value='Verdana' <?php selected( $options['faq_in_minute_cat_select_field_6'], 'Verdana' ); ?>>Verdana</option>
    173         <option value='Lucida Console' <?php selected( $options['faq_in_minute_cat_select_field_6'], 'Lucida Console' ); ?>>Lucida Console</option>
    174         <option value='Helvetica' <?php selected( $options['faq_in_minute_cat_select_field_6'], 'Helvetica' ); ?>>Helvetica</option>
    175         <option value='Georgia' <?php selected( $options['faq_in_minute_cat_select_field_6'], 'Georgia' ); ?>>Georgia</option>
    176         <option value='Arial' <?php selected( $options['faq_in_minute_cat_select_field_6'], 'Arial' ); ?>>Arial</option> 
    177     </select>
    178 
    179 <?php
    180 }
     136
    181137function faq_in_minute_cat_settings_section_callback(  ) {
    182138    echo __( 'Display your faq in wordpress page or post using [faq-in-minute] or [showallfaq] shortcodes. From here you can change settings for faq. background color,text color,font family etc. ', 'text_domain' );
     
    200156    $_SESSION['path'] = ABSPATH;
    201157
    202 
    203158    extract(shortcode_atts(array(
    204159        "limit" => '',
     
    206161        "faqcategory"=>'',
    207162        "order"=> '',
    208                     ), $atts));
     163        ), $atts));
    209164
    210165    // Define limit
    211     if ($limit) {
     166    if (!empty($limit)) {
    212167        $posts_per_page = $limit;
    213168    } else {
     
    221176    }
    222177
    223      if ($order) {
     178    if ($order) {
    224179        $ord = $order;
    225180    } else {
     
    228183
    229184
    230 if ($faqcategory) {
     185    if ($faqcategory) {
    231186        $faqcat = $faqcategory;
    232187    } else {
    233188        $faqcat = '';
    234189    }
    235 
    236190    include('faq.php');
    237 }
     191
     192    $args = array(
     193        'posts_per_page' => -1,
     194        'category_name' => $cat,
     195        'faqcategory'=>$faqcat,
     196        'orderby' => 'post_date',
     197        'order' => $ord,
     198        'post_type' => 'faq_in_minute_cat',
     199       // 'post_parent' => 0,
     200        'post_status' => 'publish',
     201        );
     202
     203    $output='<div class="panel-group" id="accordion" role="tablist" aria-multiselectable="true">';
     204
     205    $the_query = new WP_Query($args);
     206 //  echo '<pre>'; print_r($faq_query); die();
     207
     208    $i = 1;
     209    while ($the_query->have_posts()):
     210        $the_query->the_post();
     211    $output .= '<div class="panel panel-default">
     212    <div class="panel-heading faq_heading" role="tab" id="headingOne' . $i . '">
     213        <h4 class="panel-title">
     214            <a data-parent="#accordion" data-toggle="collapse" href="#collapseOne' . $i . '" class="accordion-toggle" aria-expanded="true" aria-controls="collapseOne' . $i . '">'
     215                . get_the_title() . '</a></h4>
     216            </div>
     217            <div class="panel-collapse collapse" id="collapseOne' . $i . '" aria-labelledby="headingOne' . $i . '" role="tabpanel">
     218                <div class="panel-body">' . get_the_content() . '</div>
     219            </div>
     220        </div>';
     221        $i++;
     222        endwhile;
     223        wp_reset_postdata();
     224        $output .= '</div>';
     225        return $output;
     226}
    238227
    239228add_shortcode('showallfaq', 'faq_in_minute_shortcut');
     
    242231
    243232function faq_im_scripts() {
    244 
    245233
    246234    wp_register_style('bootstrapmin', plugin_dir_url(__FILE__) . 'css/bootstrapmin.css');
     
    255243function faq_in_minute_script() {
    256244    ?>
    257     <script type="text/javascript">
    258         var $j = jQuery.noConflict();
    259         $j(document).on('click', '.panel div.clickable', function(e) {
    260             var $jthis = $j(this);
    261             if (!$jthis.hasClass('panel-collapsed')) {
    262                 $jthis.parents('.panel').find('.panel-body').slideUp();
    263                 $jthis.addClass('panel-collapsed');
    264                 $jthis.find('i').removeClass('fa-minus-circle').addClass('fa-plus-circle');
    265             } else {
    266                 $jthis.parents('.panel').find('.panel-body').slideDown();
    267                 $jthis.removeClass('panel-collapsed');
    268                 $jthis.find('i').removeClass('fa-plus-circle').addClass('fa-minus-circle');
    269             }
    270         });
    271         $j(document).ready(function() {
    272             $j('.panel-heading span.clickable').click();
    273             $j('.panel div.clickable').click();
    274         });
    275     </script>
    276245    <?php
    277246}
  • faq-in-minute/trunk/readme.txt

    r1434794 r1546421  
    44Donate link: https://twitter.com/jitendra_popat
    55Requires at least: 3.0
    6 Tested up to: 4.5
     6Tested up to: 4.6.1
    77Stable tag: trunk
    88License: GPLv2 or later
     
    9292== Changelog ==
    9393
     94= 2.0 =
     95* solved text above issue in new version.
     96* Updated desing to simple and user friendly.
     97* compatible to latest wordpress version.
     98
    9499= 1.6 =
    95100* Fix losing color code issue in new version.
Note: See TracChangeset for help on using the changeset viewer.