Plugin Directory

Changeset 1719995


Ignore:
Timestamp:
08/27/2017 02:16:34 AM (9 years ago)
Author:
mirajnetxp
Message:

ver 3

Location:
ticker-pro/trunk
Files:
12 added
5 edited

Legend:

Unmodified
Added
Removed
  • ticker-pro/trunk/includes/form-handler.php

    r1719156 r1719995  
    1717            );
    1818        }
    19     } elseif (!empty($_POST['delete_ticker']) && !empty($_POST['ticker_id']) && is_numeric($_POST['ticker_id']) && wp_verify_nonce($_POST['ticker_pro_nonce'], 'ticker_pro_nonce_delete')) {
     19    }elseif (!empty($_POST['delete_ticker']) && !empty($_POST['ticker_id']) && is_numeric($_POST['ticker_id']) && wp_verify_nonce($_POST['ticker_pro_nonce'], 'ticker_pro_nonce_delete')) {
    2020
    2121        global $wpdb;
     
    3131    if (wp_verify_nonce($_POST['ticker_pro_nonce'], 'ticker_pro_nonce_options')) {
    3232        $options = $_POST['ticker_pro'];
    33 
    34         if (empty($options['itemSpeed']) or empty($options['cursorSpeed']) or  !is_numeric($options['itemSpeed']) or !is_numeric($options['cursorSpeed'])) {
    35 //           Cheking the user input
    36 //           
     33       
     34        $options['ticker_heading_bd']=trim($options['ticker_heading_bd'],"#");   //Triming hex color code
     35       
     36       
     37        if (empty($options['itemSpeed']) or empty($options['cursorSpeed']) or  !is_numeric($options['itemSpeed']) or !is_numeric($options['cursorSpeed']) or !ctype_xdigit($options['ticker_heading_bd']) or strlen($options['ticker_heading_bd'])!=6) {
     38            //Cheking the user input
     39                   
    3740//             ---------Admin notice--------
    3841            add_action('admin_notices', function() {
     
    4548        } else {
    4649//            Update options
     50     
     51   
     52           
    4753            isset($options['pauseOnHover']) ? $options['pauseOnHover'] = true : $options['pauseOnHover'] = false;
    4854            update_option('ticker_pro_options', $options);
  • ticker-pro/trunk/includes/form-view.php

    r1719156 r1719995  
    2424                    <h2>Ticker Pro Options</h2>
    2525                    <table class="table">
     26
     27
     28                        <tr>
     29                            <th>
     30                                <label for="ticker_heading_bd">Ticker Heading Bacgroung</label>
     31                            </th>
     32                            <td>
     33                                <div id="ticker_heading_bd" class="input-group colorpicker-component">
     34                                    <input class="form-control"  type="text " required value="<?php echo $option['ticker_heading_bd'] ?>" name="ticker_pro[ticker_heading_bd]" class="form-control" />
     35                                    <span class="input-group-addon"><i></i></span>
     36                                </div>
     37                            </td>
     38                        </tr>
    2639                        <tr>
    2740                            <th>
     
    2942                            </th>
    3043                            <td>
    31                                 <input type=""  required id="itemSpeed" name="ticker_pro[itemSpeed]" value="<?php echo $option['itemSpeed'] ?>"/>
     44                                <input type=""  class="form-control" required id="itemSpeed" name="ticker_pro[itemSpeed]" value="<?php echo $option['itemSpeed'] ?>"/>
    3245                            </td>
    33 
    3446                        </tr>
    3547                        <tr>
    3648                            <th><label for="cursorSpeed">Ticker Cursor Speed</label></th>
    3749                            <td>
    38                                 <input id="cursorSpeed" required name="ticker_pro[cursorSpeed]" value="<?php echo $option['cursorSpeed'] ?>"/>
     50                                <input id="cursorSpeed" class="form-control" required name="ticker_pro[cursorSpeed]" value="<?php echo $option['cursorSpeed'] ?>"/>
    3951                            </td>
    4052                        </tr>
     
    4456                            </th>
    4557                            <td>
    46                                 <input type="checkbox" id="pauseOnHover" name="ticker_pro[pauseOnHover]"  <?php echo checked($option['pauseOnHover']) ?> />
     58                                <input class="form-control" type="checkbox" id="pauseOnHover" name="ticker_pro[pauseOnHover]"  <?php echo checked($option['pauseOnHover']) ?> />
    4759                            </td>
    4860                        </tr>
  • ticker-pro/trunk/includes/plugin_init.php

    r1719156 r1719995  
    4141        'finishOnHover' => true, // Whether or not to complete the ticker item instantly when moused over
    4242        'fadeInSpeed' => 600, // Speed of the fade-in animation
    43         'fadeOutSpeed' => 300    // Speed of the fade-out animation
     43        'fadeOutSpeed' => 300,   // Speed of the fade-out animation
     44        'ticker_heading_bd'=>'ff0000'
    4445    );
    4546   
  • ticker-pro/trunk/plugin_script.php

    r1719156 r1719995  
    88    wp_enqueue_style('ticker_pro_admin_css', plugin_dir_url(__FILE__) . 'css/main.css');
    99    wp_enqueue_style('bootstrap_admin_css', plugin_dir_url(__FILE__) . 'css/bootstrap.min.css');
     10
     11//    color picker
     12    wp_enqueue_style('bootstrap-colorpicker_css', plugin_dir_url(__FILE__) . 'color-picker/css/bootstrap-colorpicker.min.css');
     13    wp_enqueue_script('bootstrap-colorpicker_js', plugin_dir_url(__FILE__) . 'color-picker/js/bootstrap-colorpicker.min.js', array('jquery'), 2.5, true);
     14    wp_enqueue_script('bootstrap-colorpicker_activator_js', plugin_dir_url(__FILE__) . 'color-picker/js/bootstrap-colorpicker-activator.js', array('jquery'), null, true);
    1015}
    1116
     
    2126
    2227function ticker_init_script() {
    23         $option = get_option('ticker_pro_options');
    24                 $itemSpeed =$option['itemSpeed'];
    25                 $cursorSpeed=$option['cursorSpeed'];
    26                 $pauseOnHover=$option['pauseOnHover'];
    27                 $pauseOnHover?$pauseOnHover='true':$pauseOnHover='false';
    28 //                $finishOnHover=$option['finishOnHover'];
    29 //               
    30 //                $fade=$option['fade=$option'];
    31 //                $fadeInSpeed=$option['fadeInSpeed'];
    32 //                $fadeOutSpeed=$option['fadeOutSpeed'];
     28    $option = get_option('ticker_pro_options');
     29    $itemSpeed = $option['itemSpeed'];
     30    $cursorSpeed = $option['cursorSpeed'];
     31    $pauseOnHover = $option['pauseOnHover'];
     32    $pauseOnHover ? $pauseOnHover = 'true' : $pauseOnHover = 'false';
     33    $finishOnHover = $option['finishOnHover'];
     34
     35    $fade = $option['fade=$option'];
     36    $fadeInSpeed = $option['fadeInSpeed'];
     37    $fadeOutSpeed = $option['fadeOutSpeed'];
    3338    ?>
    3439    <script type="text/javascript">
    3540        jQuery(document).ready(function () {
    3641            jQuery('.ticker').ticker(
    37             {
    38                 itemSpeed: <?php echo $itemSpeed ?>, // The pause on each ticker item before being replaced
    39                 cursorSpeed: <?php echo $cursorSpeed ?>, // Speed at which the characters are typed
    40                 pauseOnHover: <?php echo $pauseOnHover ?>, // Whether to pause when the mouse hovers over the ticker
    41                 finishOnHover: true, // Whether or not to complete the ticker item instantly when moused over
    42                 cursorOne: '_', // The symbol for the first part of the cursor
    43                 cursorTwo: '-', // The symbol for the second part of the cursor
    44                 fade: true, // Whether to fade between ticker items or not
    45                 fadeInSpeed: 600, // Speed of the fade-in animation
    46                 fadeOutSpeed: 300    // Speed of the fade-out animation
    47             });
     42                    {
     43                        itemSpeed: <?php echo $itemSpeed ?>, // The pause on each ticker item before being replaced
     44                        cursorSpeed: <?php echo $cursorSpeed ?>, // Speed at which the characters are typed
     45                        pauseOnHover: <?php echo $pauseOnHover ?>, // Whether to pause when the mouse hovers over the ticker
     46                        finishOnHover: true, // Whether or not to complete the ticker item instantly when moused over
     47                        cursorOne: '_', // The symbol for the first part of the cursor
     48                        cursorTwo: '-', // The symbol for the second part of the cursor
     49                        fade: true, // Whether to fade between ticker items or not
     50                        fadeInSpeed: 600, // Speed of the fade-in animation
     51                        fadeOutSpeed: 300    // Speed of the fade-out animation
     52                    });
    4853        });
    4954
     
    5156
    5257    <?php
    53 
    5458}
    5559
    56 add_action('wp_head', 'ticker_init_script', 1000);
     60add_action('wp_footer', 'ticker_init_script', 1000);
    5761
    5862function ticker_style() {
     63    $option = get_option('ticker_pro_options');
     64   
    5965    ?>
    6066    <style>
    6167        .ticker {
    62             width: 500px;
     68            width: 100%;
    6369            margin: 10px auto;
     70            background-color: #f5f5f5;
    6471        }
    6572        /* The HTML list gets replaced with a single div,
     
    6976            display: inline;
    7077            word-wrap: break-word;
     78
    7179        }
    72     </style>   
     80        .ticker strong{
     81            background-color: #<?php echo $option['ticker_heading_bd'] ?>;
     82            padding: 2px 15px;
     83            border-radius: 0px 1000px 1000px 0px;
     84        }
     85    </style> 
     86
    7387    <?php
    74 
    7588}
    7689
  • ticker-pro/trunk/ticker-pro.php

    r1719156 r1719995  
    33/*
    44  Plugin Name:Ticker Pro
    5   Plugin URI: https://github.com/mirajnetxp/ticker-pro/blob/master/ticker-pro.zip
     5  Plugin URI: https://wordpress.org/plugins/ticker-pro/
    66  Description:Ticker Pro probably the simplest and lightweight ticker in the world. Which display your ticker ony any page or post.
    7   Version: 2.0
     7  Version: 3.0
    88  Author: Md Miraj Khan
    99  Author URI: https://www.upwork.com/o/profiles/users/_~012282969fe4714e35/
     
    4747require_once( TICKER_PRO_PLUGIN_DIR . '/includes/plugin_shortcode.php' );
    4848require_once( TICKER_PRO_PLUGIN_DIR . '/includes/form-view.php' );
    49 require_once( TICKER_PRO_PLUGIN_DIR . '/includes/plugin-options.php' );
     49//require_once( TICKER_PRO_PLUGIN_DIR . '/includes/plugin-options.php' );
    5050
    5151
     
    7070    }
    7171
    72     add_action('admin_menu', 'ticker_pro_menu');
    73 
    74    
    75 
    76    
     72    add_action('admin_menu', 'ticker_pro_menu');
    7773}
Note: See TracChangeset for help on using the changeset viewer.