Changeset 1063465
- Timestamp:
- 01/08/2015 10:20:09 PM (11 years ago)
- Location:
- whats-new-genarator/trunk
- Files:
-
- 4 edited
-
admin-ui.php (modified) (2 diffs)
-
readme.txt (modified) (2 diffs)
-
whats-new-generator.php (modified) (5 diffs)
-
whats-new.css (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
whats-new-genarator/trunk/admin-ui.php
r851866 r1063465 34 34 } 35 35 36 private function is_color( $code ) { 37 if( preg_match('/^#[a-f0-9]{6}$/i', $code ) ){ 38 return true; 39 } 40 return false; 41 } 42 36 43 function validate($input) { 37 if(!preg_match('/^#[a-f0-9]{6}$/i', $input['wng_font_color'])){ 38 $input['wng_font_color'] = "#000"; 44 $this->is_color( $input['wng_font_color'] ) or $input['wng_font_color'] = "#000"; 45 $this->is_color( $input['wng_background_color'] ) or $input['wng_background_color'] = "#f1f5f5"; 46 if ( !is_numeric( $input['wng_number']) || $input['wng_number'] < 1 || $input['wng_number'] > 30){ 47 $input['wng_number'] = 10; 39 48 } 40 if(!preg_match('/^#[a-f0-9]{6}$/i', $input['wng_background_color'])){ 41 $input['wng_background_color'] = "#f5f5f5"; 42 } 43 if ( !is_numeric( $input['wng_newmark']) || $input['wng_newmark'] < 0){ 49 if ( !is_numeric( $input['wng_newmark']) || $input['wng_newmark'] < 0 || $input['wng_newmark'] > 30){ 44 50 $input['wng_newmark'] = 0; 45 }46 if ($input['wng_newmark'] > 30 ){47 $input['wng_newmark'] = 30;48 51 } 49 52 $input['wng_title'] = esc_html( $input['wng_title'] ); … … 101 104 function setting_number() { 102 105 $options = WNG::get_option(); 103 $items = array("3", "5", "7","10", "15", "20"); 104 echo "<select id='wng_number' name='whats_new_options[wng_number]'>"; 105 foreach($items as $item) { 106 $selected = ($options['wng_number']==$item) ? 'selected="selected"' : ''; 107 echo "<option value='$item' $selected>$item</option>"; 108 } 109 echo "</select>"; 106 $value = $options["wng_number"]; 107 echo "<input id='wng_number' name='whats_new_options[wng_number]' size='2' type='text' value='{$value}' />個"; 110 108 } 111 109 -
whats-new-genarator/trunk/readme.txt
r851866 r1063465 4 4 Tags: what's new, update Post page 5 5 Requires at least: 3.5 6 Tested up to: 3.8.17 Stable tag: 1.1 0.06 Tested up to: 4.1 7 Stable tag: 1.11.0 8 8 License: GPLv2 or later 9 9 License URI: http://www.gnu.org/licenses/gpl-2.0.html … … 39 39 40 40 == Changelog == 41 42 = 1.11.0 = 43 * 最新記事の件数を1-30まで設定できるようにしました 41 44 42 45 = 1.10.0 = -
whats-new-genarator/trunk/whats-new-generator.php
r851866 r1063465 4 4 Plugin URI: http://residentbird.main.jp/bizplugin/ 5 5 Description: What's New(新着情報)を指定した固定ページや投稿に自動的に表示するプラグインです。 6 Version: 1.1 0.07 Author: WordPress Biz Plugin6 Version: 1.11.0 7 Author:Hideki Tanaka 8 8 Author URI: http://residentbird.main.jp/bizplugin/ 9 9 */ … … 14 14 class WNG 15 15 { 16 const VERSION = "1.1 0.0";16 const VERSION = "1.11.0"; 17 17 const SHORTCODE = "showwhatsnew"; 18 18 const OPTIONS = "whats_new_options"; … … 52 52 add_action( 'admin_init', array(&$this,'on_admin_init') ); 53 53 add_action( 'admin_menu', array(&$this, 'on_admin_menu')); 54 add_action( 'wp_enqueue_scripts', array(&$this,'on_enqueue_ scripts'));54 add_action( 'wp_enqueue_scripts', array(&$this,'on_enqueue_css_js')); 55 55 add_shortcode( WNG::SHORTCODE, array(&$this,'show_shortcode')); 56 56 add_filter( 'widget_text', 'do_shortcode'); … … 87 87 } 88 88 89 function on_enqueue_ scripts() {89 function on_enqueue_css_js() { 90 90 if ( is_admin() ){ 91 91 return; … … 123 123 $this->background_color = isset($options['wng_background_color']) ? $options['wng_background_color'] : "#f5f5f5"; 124 124 $this->font_color = isset($options['wng_font_color']) ? $options['wng_font_color'] : "#000000"; 125 $this->postlist_url = $options['wng_postlist_url'];125 $this->postlist_url = esc_url( $options['wng_postlist_url'] ); 126 126 127 127 $condition = array(); -
whats-new-genarator/trunk/whats-new.css
r851866 r1063465 34 34 float: left; 35 35 overflow: hidden; 36 width: auto; 36 37 } 37 38 div.wn-head .wn-postlist { 38 39 background: transparent url("./image/list.png") left center no-repeat; 39 padding-left: 1.3em;40 40 font-weight: normal; 41 41 font-size: 90%; … … 43 43 cursor: pointer; 44 44 float: right; 45 width: 4em; 45 46 } 46 47 … … 56 57 border: 0; 57 58 float: left; 58 width: 8. 7em;59 width: 8.1em; 59 60 font-weight: normal; 60 61 overflow: hidden; 62 white-space: nowrap; 61 63 } 62 64 div.wn-item .wn-article { 63 margin: 0 ;65 margin: 0 0 0 8.1em; 64 66 padding: 0 2px; 65 67 overflow: hidden;
Note: See TracChangeset
for help on using the changeset viewer.