Version Description
*
Download this release
Release Info
Developer | hidaka.bizplugin |
Plugin | What's New Generator |
Version | 1.9.0 |
Comparing to | |
See all releases |
Code changes from version 1.8.0 to 1.9.0
- admin-ui.php +12 -2
- readme.txt +6 -3
- whats-new-admin.js +1 -0
- whats-new-generator.php +6 -4
- whats-new.css +22 -29
- whatsnew-view.php +12 -14
admin-ui.php
CHANGED
@@ -13,6 +13,7 @@ class WNGAdminUi {
|
|
13 |
add_settings_section('main_section', '表示設定', array(&$this,'section_text_fn'), $this->file_path);
|
14 |
add_settings_field('wng_title', 'タイトル', array(&$this,'setting_title'), $this->file_path, 'main_section');
|
15 |
add_settings_field('wng_background_color', 'タイトル背景色', array(&$this,'setting_background_color'), $this->file_path, 'main_section');
|
|
|
16 |
add_settings_field('wng_content_type', '表示するコンテンツ', array(&$this,'setting_content_type'), $this->file_path, 'main_section');
|
17 |
add_settings_field('wng_category_name', 'カテゴリーのスラッグ', array(&$this,'setting_category_name'), $this->file_path, 'main_section');
|
18 |
add_settings_field('wng_orderby', '表示順序', array(&$this,'setting_orderby'), $this->file_path, 'main_section');
|
@@ -26,12 +27,15 @@ class WNGAdminUi {
|
|
26 |
$file = $this->file_path;
|
27 |
$option_name = WNG::OPTIONS;
|
28 |
$shortcode = "[" . WNG::SHORTCODE . "]";
|
29 |
-
include_once('admin-view.php');
|
30 |
$info = new WhatsNewInfo();
|
31 |
-
include_once('whatsnew-view.php');
|
32 |
}
|
33 |
|
34 |
function validate($input) {
|
|
|
|
|
|
|
35 |
if(!preg_match('/^#[a-f0-9]{6}$/i', $input['wng_background_color'])){
|
36 |
$input['wng_background_color'] = "#f5f5f5";
|
37 |
}
|
@@ -69,6 +73,12 @@ class WNGAdminUi {
|
|
69 |
echo "<input id='wng_background_color' name='whats_new_options[wng_background_color]' size='10' type='text' value='{$value}' />";
|
70 |
}
|
71 |
|
|
|
|
|
|
|
|
|
|
|
|
|
72 |
function setting_newmark() {
|
73 |
$options = WNG::get_option();
|
74 |
$value = $options["wng_newmark"];
|
13 |
add_settings_section('main_section', '表示設定', array(&$this,'section_text_fn'), $this->file_path);
|
14 |
add_settings_field('wng_title', 'タイトル', array(&$this,'setting_title'), $this->file_path, 'main_section');
|
15 |
add_settings_field('wng_background_color', 'タイトル背景色', array(&$this,'setting_background_color'), $this->file_path, 'main_section');
|
16 |
+
add_settings_field('wng_font_color', 'タイトル文字色', array(&$this,'setting_font_color'), $this->file_path, 'main_section');
|
17 |
add_settings_field('wng_content_type', '表示するコンテンツ', array(&$this,'setting_content_type'), $this->file_path, 'main_section');
|
18 |
add_settings_field('wng_category_name', 'カテゴリーのスラッグ', array(&$this,'setting_category_name'), $this->file_path, 'main_section');
|
19 |
add_settings_field('wng_orderby', '表示順序', array(&$this,'setting_orderby'), $this->file_path, 'main_section');
|
27 |
$file = $this->file_path;
|
28 |
$option_name = WNG::OPTIONS;
|
29 |
$shortcode = "[" . WNG::SHORTCODE . "]";
|
30 |
+
include_once( dirname(__FILE__) . '/admin-view.php');
|
31 |
$info = new WhatsNewInfo();
|
32 |
+
include_once( dirname(__FILE__) . '/whatsnew-view.php');
|
33 |
}
|
34 |
|
35 |
function validate($input) {
|
36 |
+
if(!preg_match('/^#[a-f0-9]{6}$/i', $input['wng_font_color'])){
|
37 |
+
$input['wng_font_color'] = "#000";
|
38 |
+
}
|
39 |
if(!preg_match('/^#[a-f0-9]{6}$/i', $input['wng_background_color'])){
|
40 |
$input['wng_background_color'] = "#f5f5f5";
|
41 |
}
|
73 |
echo "<input id='wng_background_color' name='whats_new_options[wng_background_color]' size='10' type='text' value='{$value}' />";
|
74 |
}
|
75 |
|
76 |
+
function setting_font_color() {
|
77 |
+
$options = WNG::get_option();
|
78 |
+
$value = $options["wng_font_color"];
|
79 |
+
echo "<input id='wng_font_color' name='whats_new_options[wng_font_color]' size='10' type='text' value='{$value}' />";
|
80 |
+
}
|
81 |
+
|
82 |
function setting_newmark() {
|
83 |
$options = WNG::get_option();
|
84 |
$value = $options["wng_newmark"];
|
readme.txt
CHANGED
@@ -2,9 +2,9 @@
|
|
2 |
Contributors: WordPress BizPlugin
|
3 |
Donate link:
|
4 |
Tags: what's new, update Post page
|
5 |
-
Requires at least: 3.
|
6 |
-
Tested up to: 3.
|
7 |
-
Stable tag: 1.
|
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.8.0 =
|
43 |
* 新着一覧の日付のフォーマットを設定する機能を追加
|
44 |
|
2 |
Contributors: WordPress BizPlugin
|
3 |
Donate link:
|
4 |
Tags: what's new, update Post page
|
5 |
+
Requires at least: 3.5
|
6 |
+
Tested up to: 3.7.1
|
7 |
+
Stable tag: 1.9.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.9.0 =
|
43 |
+
* 新着一覧のタイトル文字色を設定する機能追加
|
44 |
+
|
45 |
= 1.8.0 =
|
46 |
* 新着一覧の日付のフォーマットを設定する機能を追加
|
47 |
|
whats-new-admin.js
CHANGED
@@ -1,3 +1,4 @@
|
|
1 |
jQuery(document).ready(function($){
|
2 |
$('#wng_background_color').wpColorPicker();
|
|
|
3 |
});
|
1 |
jQuery(document).ready(function($){
|
2 |
$('#wng_background_color').wpColorPicker();
|
3 |
+
$('#wng_font_color').wpColorPicker();
|
4 |
});
|
whats-new-generator.php
CHANGED
@@ -3,12 +3,12 @@
|
|
3 |
Plugin Name: What's New Generator
|
4 |
Plugin URI: http://residentbird.main.jp/bizplugin/
|
5 |
Description: What's New(新着情報)を指定した固定ページや投稿に自動的に表示するプラグインです。
|
6 |
-
Version: 1.
|
7 |
Author:WordPress Biz Plugin
|
8 |
Author URI: http://residentbird.main.jp/bizplugin/
|
9 |
*/
|
10 |
|
11 |
-
include_once "admin-ui.php";
|
12 |
new WhatsNewPlugin();
|
13 |
|
14 |
class WNG
|
@@ -66,6 +66,7 @@ class WhatsNewPlugin{
|
|
66 |
"wng_orderby" => "公開日順",
|
67 |
"wng_category_name" => "",
|
68 |
"wng_background_color" => "#f5f5f5",
|
|
|
69 |
"wng_newmark" => "7",
|
70 |
"wng_postlist_url" => "",
|
71 |
"wng_dateformat" => "Y年n月j日",
|
@@ -92,7 +93,7 @@ class WhatsNewPlugin{
|
|
92 |
|
93 |
function show_whatsnew(){
|
94 |
$info = new WhatsNewInfo();
|
95 |
-
include('whatsnew-view.php');
|
96 |
}
|
97 |
|
98 |
function show_shortcode(){
|
@@ -117,7 +118,8 @@ class WhatsNewInfo{
|
|
117 |
public function __construct(){
|
118 |
$options = WNG::get_option();
|
119 |
$this->title = esc_html( $options['wng_title'] );
|
120 |
-
$this->background_color = $options['wng_background_color'];
|
|
|
121 |
$this->postlist_url = $options['wng_postlist_url'];
|
122 |
|
123 |
$condition = array();
|
3 |
Plugin Name: What's New Generator
|
4 |
Plugin URI: http://residentbird.main.jp/bizplugin/
|
5 |
Description: What's New(新着情報)を指定した固定ページや投稿に自動的に表示するプラグインです。
|
6 |
+
Version: 1.9.0
|
7 |
Author:WordPress Biz Plugin
|
8 |
Author URI: http://residentbird.main.jp/bizplugin/
|
9 |
*/
|
10 |
|
11 |
+
include_once( dirname(__FILE__) . "/admin-ui.php" );
|
12 |
new WhatsNewPlugin();
|
13 |
|
14 |
class WNG
|
66 |
"wng_orderby" => "公開日順",
|
67 |
"wng_category_name" => "",
|
68 |
"wng_background_color" => "#f5f5f5",
|
69 |
+
"wng_font_color" => "#000000",
|
70 |
"wng_newmark" => "7",
|
71 |
"wng_postlist_url" => "",
|
72 |
"wng_dateformat" => "Y年n月j日",
|
93 |
|
94 |
function show_whatsnew(){
|
95 |
$info = new WhatsNewInfo();
|
96 |
+
include( dirname(__FILE__) . '/whatsnew-view.php');
|
97 |
}
|
98 |
|
99 |
function show_shortcode(){
|
118 |
public function __construct(){
|
119 |
$options = WNG::get_option();
|
120 |
$this->title = esc_html( $options['wng_title'] );
|
121 |
+
$this->background_color = isset($options['wng_background_color']) ? $options['wng_background_color'] : "#f5f5f5";
|
122 |
+
$this->font_color = isset($options['wng_font_color']) ? $options['wng_font_color'] : "#000000";
|
123 |
$this->postlist_url = $options['wng_postlist_url'];
|
124 |
|
125 |
$condition = array();
|
whats-new.css
CHANGED
@@ -1,42 +1,41 @@
|
|
1 |
@CHARSET "UTF-8";
|
2 |
|
3 |
-
|
4 |
margin:10px 0;
|
5 |
-
|
6 |
-
border-radius:
|
7 |
-
-
|
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 |
-
|
16 |
margin: 0;
|
17 |
padding: 5px 10px;
|
18 |
-
background-color: WhiteSmoke;
|
19 |
box-shadow: 1px 1px 4px #ccc;
|
20 |
-webkit-box-shadow: 1px 1px 4px #ccc;
|
21 |
-moz-box-shadow: 1px 1px 4px #ccc;
|
22 |
border: 0;
|
23 |
border-bottom: 1px Silver solid;
|
24 |
-
border-top-left-radius:
|
25 |
-
border-top-right-radius:
|
26 |
-
-webkit-border-top-left-radius:
|
27 |
-
-webkit-border-top-right-radius:
|
28 |
-
-moz-border-radius-topleft:
|
29 |
-
-moz-border-radius-topright:
|
|
|
30 |
}
|
31 |
|
32 |
-
|
33 |
font-weight: bold;
|
34 |
font-size: 100%;
|
35 |
text-align: left;
|
36 |
float:left;
|
37 |
}
|
38 |
|
39 |
-
|
40 |
background: transparent url('./image/list.png') left center no-repeat;
|
41 |
padding-left:1.3em;
|
42 |
font-weight: normal;
|
@@ -46,34 +45,28 @@ div.all-post {
|
|
46 |
float:right;
|
47 |
}
|
48 |
|
49 |
-
|
50 |
-
div.whatsnew dd:after, div.whatsnewtitle:after {
|
51 |
-
content: "";
|
52 |
-
clear: both;
|
53 |
-
height: 0;
|
54 |
-
display: block;
|
55 |
-
visibility: hidden;
|
56 |
-
}
|
57 |
-
|
58 |
-
|
59 |
-
div.whatsnew dl {
|
60 |
margin: 5px 0;
|
61 |
padding: 0;
|
62 |
border: 0;
|
|
|
63 |
}
|
64 |
|
65 |
-
|
|
|
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 |
|
74 |
-
|
75 |
margin: 0;
|
76 |
-
padding: 0
|
|
|
77 |
}
|
78 |
|
79 |
.newmark {
|
1 |
@CHARSET "UTF-8";
|
2 |
|
3 |
+
.whatsnew {
|
4 |
margin:10px 0;
|
5 |
+
border-radius: 3px; /* CSS3 */
|
6 |
+
-webkit-border-radius: 3px; /* Safari,Google Chrome */
|
7 |
+
-moz-border-radius: 3px; /* Firefox */
|
|
|
8 |
border: 1px Silver solid;
|
9 |
font-size: 100%;
|
10 |
word-break:break-all;
|
11 |
overflow: hidden;
|
12 |
}
|
13 |
|
14 |
+
.wn-head {
|
15 |
margin: 0;
|
16 |
padding: 5px 10px;
|
|
|
17 |
box-shadow: 1px 1px 4px #ccc;
|
18 |
-webkit-box-shadow: 1px 1px 4px #ccc;
|
19 |
-moz-box-shadow: 1px 1px 4px #ccc;
|
20 |
border: 0;
|
21 |
border-bottom: 1px Silver solid;
|
22 |
+
border-top-left-radius: 3px; /* 左上 */
|
23 |
+
border-top-right-radius: 3px; /* 右上 */
|
24 |
+
-webkit-border-top-left-radius: 3px; /* 左上 */
|
25 |
+
-webkit-border-top-right-radius: 3px; /* 右上 */
|
26 |
+
-moz-border-radius-topleft: 3px; /* 左上 */
|
27 |
+
-moz-border-radius-topright: 3px; /* 右上 */
|
28 |
+
overflow: hidden;
|
29 |
}
|
30 |
|
31 |
+
.wn-title {
|
32 |
font-weight: bold;
|
33 |
font-size: 100%;
|
34 |
text-align: left;
|
35 |
float:left;
|
36 |
}
|
37 |
|
38 |
+
.wn-postlist {
|
39 |
background: transparent url('./image/list.png') left center no-repeat;
|
40 |
padding-left:1.3em;
|
41 |
font-weight: normal;
|
45 |
float:right;
|
46 |
}
|
47 |
|
48 |
+
.wn-item {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
49 |
margin: 5px 0;
|
50 |
padding: 0;
|
51 |
border: 0;
|
52 |
+
overflow: hidden;
|
53 |
}
|
54 |
|
55 |
+
|
56 |
+
.wn-date {
|
57 |
margin: 0 0 0 0.3em;
|
58 |
padding: 0;
|
59 |
border: 0;
|
60 |
float: left;
|
61 |
width: 8.7em;
|
62 |
font-weight: normal;
|
63 |
+
overflow: hidden;
|
64 |
}
|
65 |
|
66 |
+
.wn-article {
|
67 |
margin: 0;
|
68 |
+
padding: 0 2px;
|
69 |
+
overflow: hidden;
|
70 |
}
|
71 |
|
72 |
.newmark {
|
whatsnew-view.php
CHANGED
@@ -1,28 +1,26 @@
|
|
1 |
<div class='whatsnew'>
|
2 |
-
<div class='
|
3 |
-
|
4 |
-
|
5 |
-
<div class='wntitle'>
|
6 |
<?php echo $info->title; ?>
|
7 |
</div>
|
8 |
<?php if (!empty($info->postlist_url)): ?>
|
9 |
-
<div class='
|
10 |
<a href="<?php echo $info->postlist_url; ?>">一覧へ</a>
|
11 |
</div>
|
12 |
<?php endif; ?>
|
13 |
</div>
|
14 |
-
|
15 |
-
<
|
16 |
-
|
17 |
-
<dt>
|
18 |
<?php echo $item->date; ?>
|
19 |
-
</
|
20 |
-
<
|
21 |
<?php if ( $item->newmark ): ?>
|
22 |
<span class='newmark'>NEW!</span>
|
23 |
<?php endif; ?>
|
24 |
<a href="<?php echo $item->url; ?>"><?php echo $item->title; ?> </a>
|
25 |
-
</
|
26 |
-
|
27 |
-
|
28 |
</div>
|
1 |
<div class='whatsnew'>
|
2 |
+
<div class='wn-head'
|
3 |
+
<?php echo "style='background-color: {$info->background_color}; color : {$info->font_color};'" ; ?>>
|
4 |
+
<div class='wn-title'>
|
|
|
5 |
<?php echo $info->title; ?>
|
6 |
</div>
|
7 |
<?php if (!empty($info->postlist_url)): ?>
|
8 |
+
<div class='wn-postlist'>
|
9 |
<a href="<?php echo $info->postlist_url; ?>">一覧へ</a>
|
10 |
</div>
|
11 |
<?php endif; ?>
|
12 |
</div>
|
13 |
+
<?php foreach($info->items as $item): ?>
|
14 |
+
<div class='wn-item'>
|
15 |
+
<div class='wn-date'>
|
|
|
16 |
<?php echo $item->date; ?>
|
17 |
+
</div>
|
18 |
+
<div class='wn-article'>
|
19 |
<?php if ( $item->newmark ): ?>
|
20 |
<span class='newmark'>NEW!</span>
|
21 |
<?php endif; ?>
|
22 |
<a href="<?php echo $item->url; ?>"><?php echo $item->title; ?> </a>
|
23 |
+
</div>
|
24 |
+
</div>
|
25 |
+
<?php endforeach; ?>
|
26 |
</div>
|