What's New Generator - Version 1.8.0

Version Description

*

Download this release

Release Info

Developer hidaka.bizplugin
Plugin Icon wp plugin What's New Generator
Version 1.8.0
Comparing to
See all releases

Code changes from version 1.7.0 to 1.8.0

Files changed (4) hide show
  1. admin-ui.php +12 -0
  2. readme.txt +4 -1
  3. whats-new-generator.php +4 -2
  4. whats-new.css +4 -2
admin-ui.php CHANGED
@@ -18,6 +18,7 @@ class WNGAdminUi {
18
  add_settings_field('wng_orderby', '表示順序', array(&$this,'setting_orderby'), $this->file_path, 'main_section');
19
  add_settings_field('wng_number', '表示件数', array(&$this,'setting_number'), $this->file_path, 'main_section');
20
  add_settings_field('wng_newmark', 'NEW!マーク表示期間', array(&$this,'setting_newmark'), $this->file_path, 'main_section');
 
21
  add_settings_field('wng_postlist_url', '一覧ページのurl', array(&$this,'setting_postlist_url'), $this->file_path, 'main_section');
22
  }
23
 
@@ -109,4 +110,15 @@ class WNGAdminUi {
109
  echo "<label><input {$checked} value='{$item}' name='whats_new_options[wng_orderby]' type='radio' /> $item</label><br />";
110
  }
111
  }
 
 
 
 
 
 
 
 
 
 
 
112
  }
18
  add_settings_field('wng_orderby', '表示順序', array(&$this,'setting_orderby'), $this->file_path, 'main_section');
19
  add_settings_field('wng_number', '表示件数', array(&$this,'setting_number'), $this->file_path, 'main_section');
20
  add_settings_field('wng_newmark', 'NEW!マーク表示期間', array(&$this,'setting_newmark'), $this->file_path, 'main_section');
21
+ add_settings_field('wng_dateformat', '日付のフォーマット', array(&$this,'setting_dateformat'), $this->file_path, 'main_section');
22
  add_settings_field('wng_postlist_url', '一覧ページのurl', array(&$this,'setting_postlist_url'), $this->file_path, 'main_section');
23
  }
24
 
110
  echo "<label><input {$checked} value='{$item}' name='whats_new_options[wng_orderby]' type='radio' /> $item</label><br />";
111
  }
112
  }
113
+
114
+ function setting_dateformat() {
115
+ $options = WNG::get_option();
116
+ $items = array("Y年n月j日", "Y-m-d", "Y/m/d", "j/n/Y", "n/j/Y");
117
+ echo "<select id='wng_dateformat' name='whats_new_options[wng_dateformat]'>";
118
+ foreach($items as $item) {
119
+ $selected = ($options['wng_dateformat']==$item) ? 'selected="selected"' : '';
120
+ echo "<option value='$item' $selected>$item</option>";
121
+ }
122
+ echo "</select>";
123
+ }
124
  }
readme.txt CHANGED
@@ -4,7 +4,7 @@ Donate link:
4
  Tags: what's new, update Post page
5
  Requires at least: 3.4
6
  Tested up to: 3.5.1
7
- Stable tag: 1.7.0
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
@@ -39,6 +39,9 @@ What’s New Generatorは、投稿、固定ページ、ウィジェットに新
39
 
40
  == Changelog ==
41
 
 
 
 
42
  = 1.7.0 =
43
  * 新着一覧のタイトルに記事一覧へのリンクを表示する機能を追加
44
  * カテゴリを指定するチェックボックスを削除
4
  Tags: what's new, update Post page
5
  Requires at least: 3.4
6
  Tested up to: 3.5.1
7
+ Stable tag: 1.8.0
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
39
 
40
  == Changelog ==
41
 
42
+ = 1.8.0 =
43
+ * 新着一覧の日付のフォーマットを設定する機能を追加
44
+
45
  = 1.7.0 =
46
  * 新着一覧のタイトルに記事一覧へのリンクを表示する機能を追加
47
  * カテゴリを指定するチェックボックスを削除
whats-new-generator.php CHANGED
@@ -3,7 +3,7 @@
3
  Plugin Name: What's New Generator
4
  Plugin URI: http://residentbird.main.jp/bizplugin/
5
  Description: What's New(新着情報)を指定した固定ページや投稿に自動的に表示するプラグインです。
6
- Version: 1.7.0
7
  Author:WordPress Biz Plugin
8
  Author URI: http://residentbird.main.jp/bizplugin/
9
  */
@@ -68,6 +68,7 @@ class WhatsNewPlugin{
68
  "wng_background_color" => "#f5f5f5",
69
  "wng_newmark" => "7",
70
  "wng_postlist_url" => "",
 
71
  "wng_number" => "10"
72
  );
73
  WNG::update_option( $arr );
@@ -157,7 +158,8 @@ class WhatsNewItem{
157
  $options = WNG::get_option();
158
  $orderby = $options['wng_orderby'];
159
  $this->raw_date = $orderby == '公開日順' ? $post->post_date : $post->post_modified;
160
- $this->date = date("Y年n月j日", strtotime($this->raw_date));
 
161
  $this->title = esc_html( $post->post_title );
162
  $this->url = get_permalink($post->ID);
163
  $this->newmark = $this->is_new();
3
  Plugin Name: What's New Generator
4
  Plugin URI: http://residentbird.main.jp/bizplugin/
5
  Description: What's New(新着情報)を指定した固定ページや投稿に自動的に表示するプラグインです。
6
+ Version: 1.8.0
7
  Author:WordPress Biz Plugin
8
  Author URI: http://residentbird.main.jp/bizplugin/
9
  */
68
  "wng_background_color" => "#f5f5f5",
69
  "wng_newmark" => "7",
70
  "wng_postlist_url" => "",
71
+ "wng_dateformat" => "Y年n月j日",
72
  "wng_number" => "10"
73
  );
74
  WNG::update_option( $arr );
158
  $options = WNG::get_option();
159
  $orderby = $options['wng_orderby'];
160
  $this->raw_date = $orderby == '公開日順' ? $post->post_date : $post->post_modified;
161
+ $dateformat = empty($options['wng_dateformat']) ? "Y年n月j日" : $options['wng_dateformat'];
162
+ $this->date = date($dateformat, strtotime($this->raw_date));
163
  $this->title = esc_html( $post->post_title );
164
  $this->url = get_permalink($post->ID);
165
  $this->newmark = $this->is_new();
whats-new.css CHANGED
@@ -8,6 +8,8 @@ div.whatsnew {
8
  -moz-border-radius: 5px; /* Firefox */
9
  border: 1px Silver solid;
10
  font-size: 100%;
 
 
11
  }
12
 
13
  div.whatsnewtitle {
@@ -61,11 +63,11 @@ div.whatsnew dl {
61
  }
62
 
63
  div.whatsnew dt {
64
- margin: 0 0 0 0.5em;
65
  padding: 0;
66
  border: 0;
67
  float: left;
68
- width: 8.5em;
69
  font-weight: normal;
70
  }
71
 
8
  -moz-border-radius: 5px; /* Firefox */
9
  border: 1px Silver solid;
10
  font-size: 100%;
11
+ word-break:break-all;
12
+ overflow: hidden;
13
  }
14
 
15
  div.whatsnewtitle {
63
  }
64
 
65
  div.whatsnew dt {
66
+ margin: 0 0 0 0.3em;
67
  padding: 0;
68
  border: 0;
69
  float: left;
70
+ width: 8.7em;
71
  font-weight: normal;
72
  }
73