PluginProbe
Simple Ticker / 2.03
Simple Ticker v2.03
trunk 1.0 1.01 1.02 1.03 1.04 1.05 1.06 1.07 2.00 2.01 2.02 2.03 2.04 2.05 2.06 2.07 2.08 2.09 2.10 2.11 3.00 3.01 3.02 3.03 All 33 releases
simple-ticker / lib / SimpleTickerRegist.php

SimpleTickerRegist.php in Simple Ticker 2.03, at lib/SimpleTickerRegist.php

92 lines 2.8 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * Simple Ticker
4 *
5 * @package SimpleTicker
6 * @subpackage SimpleTicker registered in the database
7 Copyright (c) 2016- Katsushi Kawamori (email : dodesyoswift312@gmail.com)
8 This program is free software; you can redistribute it and/or modify
9 it under the terms of the GNU General Public License as published by
10 the Free Software Foundation; version 2 of the License.
11
12 This program is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 GNU General Public License for more details.
16
17 You should have received a copy of the GNU General Public License
18 along with this program; if not, write to the Free Software
19 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
20 */
21
22 $simpletickerregist = new SimpleTickerRegist();
23
24 class SimpleTickerRegist {
25
26 /* ==================================================
27 * Construct
28 * @since 1.06
29 */
30 public function __construct() {
31
32 add_action('admin_init', array($this, 'register_settings'));
33
34 }
35
36 /* ==================================================
37 * Settings register
38 * @since 1.0
39 */
40 public function register_settings(){
41
42 $woo_sales_text_tag = '%regular_price% %sale_price% %dis_rate_price% %dis_rate_percent% %to_date% %interval_day% %interval_time%';
43
44 $simple_ticker_tbl = array(
45 'speed' => 150,
46 'ticker1' => array(
47 'text' => '',
48 'color' => '#ff0000'
49 ),
50 'ticker2' => array(
51 'text' => '',
52 'color' => '#ffff00'
53 ),
54 'ticker3' => array(
55 'text' => '',
56 'color' => '#008000'
57 ),
58 'sticky_posts' => array(
59 'display' => TRUE,
60 'title_color' => '#ff0000',
61 'content_color' => '#000000'
62 ),
63 'woo_sales' => array(
64 'display' => FALSE,
65 'color' => '#000000',
66 'text' => $woo_sales_text_tag
67 )
68 );
69
70 if ( get_option('simple_ticker') ) {
71 $simple_ticker_settings = get_option('simple_ticker');
72 if ( !array_key_exists( "speed", $simple_ticker_settings ) ) {
73 // ver 2.00 later
74 $simple_ticker_settings['speed'] = 150;
75 update_option( 'simple_ticker', $simple_ticker_settings );
76 }
77 if ( !array_key_exists( "woo_sales", $simple_ticker_settings ) ) {
78 // ver 2.00 later
79 $simple_ticker_settings['woo_sales']['display'] = FALSE;
80 $simple_ticker_settings['woo_sales']['color'] = '#000000';
81 $simple_ticker_settings['woo_sales']['text'] = $woo_sales_text_tag;
82 update_option( 'simple_ticker', $simple_ticker_settings );
83 }
84 } else {
85 update_option( 'simple_ticker', $simple_ticker_tbl );
86 }
87
88 }
89
90 }
91
92 ?>