Newpost Catch - Version 1.0.0

Version Description

  • First stable version.

=

Download this release

Release Info

Developer s56bouya
Plugin Icon wp plugin Newpost Catch
Version 1.0.0
Comparing to
See all releases

Version 1.0.0

class.php ADDED
@@ -0,0 +1,134 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * NewpostCatch class
4
+ **/
5
+ if ( !class_exists('NewpostCatch') ) {
6
+ class NewpostCatch extends WP_Widget {
7
+ /*** plugin variables ***/
8
+ var $version = "1.0.0";
9
+ var $pluginDir = "";
10
+
11
+ /*** plugin structure ***/
12
+ function NewpostCatch() {
13
+ /** widget settings **/
14
+ $widget_ops = array( 'description' => 'Thumbnails in new articles.' );
15
+
16
+ /** widget actual processes **/
17
+ parent::WP_Widget(false, $name = 'Newpost Catch', $widget_ops );
18
+
19
+ /** plugin path **/
20
+ if (empty($this->pluginDir)) $this->pluginDir = WP_PLUGIN_URL . '/newpost-catch';
21
+
22
+ /** default thumbnail **/
23
+ $this->default_thumbnail = $this->pluginDir . "/no_thumb.png";
24
+
25
+ /** charset **/
26
+ $this->charset = get_bloginfo('charset');
27
+
28
+ /** print stylesheet **/
29
+ add_action( 'wp_head', array(&$this, 'NewpostCatch_print_stylesheet') );
30
+
31
+ /** activate textdomain for translations **/
32
+ add_action( 'init', array(&$this, 'NewpostCatch_textdomain') );
33
+ }
34
+
35
+ /** plugin localization **/
36
+ function NewpostCatch_textdomain() {
37
+ load_plugin_textdomain ( 'newpost-catch', false, basename( rtrim(dirname(__FILE__), '/') ) . '/languages' );
38
+ }
39
+
40
+ /** insert header stylesheet **/
41
+ function NewpostCatch_print_stylesheet() {
42
+ $css_path = ( @file_exists(TEMPLATEPATH.'/css/newpost-catch.css') ) ? get_stylesheet_directory_uri().'/css/newpost-catch.css' : plugin_dir_url( __FILE__ ).'style.css';
43
+ echo "\n"."<!-- Newpost Catch ver".$this->version." -->"."\n".'<link rel="stylesheet" href="' . $css_path . '" type="text/css" media="screen" />'."\n"."<!-- End Newpost Catch ver".$this->version." -->"."\n";
44
+ }
45
+
46
+ /**�� create widget ��**/
47
+ function widget($args, $instance) {
48
+ extract( $args );
49
+
50
+ $title = apply_filters('NewpostCatch_widget_title', $instance['title']);
51
+ $width = apply_filters('NewpostCatch_widget_width', $instance['width']);
52
+ $height = apply_filters('NewpostCatch_widget_height', $instance['height']);
53
+ $number = apply_filters('NewpostCatch_widget_number', $instance['number']);
54
+
55
+ echo $before_widget;
56
+
57
+ if ( $title ) echo $before_title . $title . $after_title;
58
+ query_posts($query_string . "&showposts=" . $number );
59
+ ?>
60
+ <ul id="npcatch" >
61
+ <?php if( have_posts() ) : ?>
62
+ <?php while( have_posts() ) : the_post(); ?>
63
+ <li>
64
+ <span class="thumb"><a href="<?php the_permalink(); ?>" title="<?php the_title(); ?>">
65
+ <?php if( has_post_thumbnail() ) : ?>
66
+ <?php \n . the_post_thumbnail( array( $width , $height ),array( 'alt' => $title_attr , 'title' => $title_attr )); ?>
67
+ <?php else : ?>
68
+ <img src="<?php echo $this->default_thumbnail ?>" width="<?php echo $width ?>" height="<?php echo $height ?>" >
69
+ <?php endif; ?>
70
+ </a></span>
71
+ <span class="title"><a href="<?php the_permalink(); ?>" title="<?php the_title(); ?>"><?php the_title(); ?>
72
+ <?php if ( $instance['date']['active'] ) { ?>
73
+ <span class="date"><?php the_time('[Y/m/d]' , '' , '' ); ?></span>
74
+ <?php } ?>
75
+ </a></span>
76
+ </li>
77
+ <?php endwhile; ?>
78
+ <?php else : ?>
79
+ <p>no post</p>
80
+ <?php endif; ?>
81
+ </ul>
82
+ <?php
83
+ echo $after_widget;
84
+ }
85
+ /**�� create widget ��**/
86
+
87
+ /** @see WP_Widget::update **/
88
+ // updates each widget instance when user clicks the "save" button
89
+ function update($new_instance, $old_instance) {
90
+
91
+ $instance = $old_instance;
92
+
93
+ $instance['title'] = ($this->magicquotes) ? htmlspecialchars( stripslashes(strip_tags( $new_instance['title'] )), ENT_QUOTES ) : htmlspecialchars( strip_tags( $new_instance['title'] ), ENT_QUOTES );
94
+ $instance['width'] = is_numeric($new_instance['width']) ? $new_instance['width'] : 10;
95
+ $instance['height'] = is_numeric($new_instance['height']) ? $new_instance['height'] : 10;
96
+ $instance['number'] = is_numeric($new_instance['number']) ? $new_instance['number'] : 5;
97
+ $instance['date']['active'] = $new_instance['date'];
98
+
99
+ //return $instance;
100
+ return $instance;
101
+ }
102
+
103
+ /** @see WP_Widget::form **/
104
+ function form($instance) {
105
+ $title = esc_attr($instance['title']);
106
+ $width = esc_attr($instance['width']);
107
+ $height = esc_attr($instance['height']);
108
+ $number = esc_attr($instance['number']);
109
+ $defaults = array( 'date' => array( 'active' => false ) );
110
+ ?>
111
+ <p>
112
+ <label for="<?php echo $this->get_field_id('title'); ?>"><?php _e('Title:' , 'newpost-catch'); ?>
113
+ <input id="<?php echo $this->get_field_id('title'); ?>" name="<?php echo $this->get_field_name('title'); ?>" type="text" class="widefat" value="<?php echo $title; ?>" /></label>
114
+ </p>
115
+ <p>
116
+ <?php _e('Thumbnail Size' , 'newpost-catch'); ?><br />
117
+ <label for="<?php echo $this->get_field_id('width'); ?>"><?php _e('Width:' , 'newpost-catch'); ?>
118
+ <input id="<?php echo $this->get_field_id('width'); ?>" name="<?php echo $this->get_field_name( 'width' ); ?>" type="number" style="width:30px" value="<?php echo $width; ?>" /> px</label>
119
+ <br />
120
+ <label for="<?php echo $this->get_field_id('height'); ?>"><?php _e('Height:' , 'newpost-catch'); ?>
121
+ <input id="<?php echo $this->get_field_id('height'); ?>" name="<?php echo $this->get_field_name('height'); ?>" type="number" style="width:30px;" value="<?php echo $height; ?>" /> px</label>
122
+ </p>
123
+ <p>
124
+ <label for="<?php echo $this->get_field_id('number'); ?>"><?php _e('Showposts:' , 'newpost-catch'); ?>
125
+ <input style="width:30px;" id="<?php echo $this->get_field_id('number'); ?>" name="<?php echo $this->get_field_name('number'); ?>" type="number" value="<?php echo $number; ?>" /></label> <?php _e('Posts', 'newpost-catch'); ?>
126
+ </p>
127
+ <p>
128
+ <input type="checkbox" class="checkbox" <?php echo ($instance['date']['active']) ? 'checked="checked"' : ''; ?> id="<?php echo $this->get_field_id( 'date' ); ?>" name="<?php echo $this->get_field_name( 'date' ); ?>" /> <label for="<?php echo $this->get_field_id( 'date' ); ?>"><?php _e('Display date', 'newpost-catch'); ?></label>
129
+ </p>
130
+ <?php
131
+ }
132
+ }
133
+ }
134
+ ?>
languages/newpost-catch-ja.mo ADDED
Binary file
languages/newpost-catch-ja.po ADDED
@@ -0,0 +1,37 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ msgid ""
2
+ msgstr ""
3
+ "Project-Id-Version: Newpost Catch\n"
4
+ "Report-Msgid-Bugs-To: \n"
5
+ "POT-Creation-Date: 2012-03-19 +900\n"
6
+ "PO-Revision-Date: \n"
7
+ "Last-Translator: Tetsuya Imamura <plugins@imamura.biz>\n"
8
+ "Language-Team: Tetsuya Imamura <wpdev@imamura.biz>\n"
9
+ "MIME-Version: 1.0\n"
10
+ "Content-Type: text/plain; charset=UTF-8\n"
11
+ "Content-Transfer-Encoding: 8bit\n"
12
+ "X-Poedit-Language: Japanese\n"
13
+ "X-Poedit-Country: JAPAN\n"
14
+ "X-Poedit-SourceCharset: utf-8\n"
15
+
16
+ #: newpost-catch/class.php:112
17
+ msgid "Title:"
18
+ msgstr "タイトル:"
19
+
20
+ msgid "Thumbnail Size"
21
+ msgstr "サムネイルのサイズ"
22
+
23
+ msgid "Width:"
24
+ msgstr "幅:"
25
+
26
+ msgid "Height:"
27
+ msgstr "高さ:"
28
+
29
+ msgid "Showposts:"
30
+ msgstr "投稿件数"
31
+
32
+ msgid "Posts"
33
+ msgstr "件"
34
+
35
+ msgid "Display date"
36
+ msgstr "投稿日(チェックすると表示)"
37
+
languages/newpost-catch.pot ADDED
@@ -0,0 +1,41 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Copyright 2012 Newpost Catch
2
+ msgid ""
3
+ msgstr ""
4
+ "Project-Id-Version: Newpost Catch\n"
5
+ "Report-Msgid-Bugs-To: \n"
6
+ "POT-Creation-Date: 2012-03-19 +900\n"
7
+ "PO-Revision-Date: \n"
8
+ "Last-Translator: Tetsuya Imamura <wpdev@imamura.biz>\n"
9
+ "Language-Team: Tetsuya Imamura <wpdev@imamura.biz>\n"
10
+ "MIME-Version: 1.0\n"
11
+ "Content-Type: text/plain; charset=UTF-8\n"
12
+ "Content-Transfer-Encoding: 8bit\n"
13
+
14
+ #: newpost-catch/class.php:112
15
+ msgid "Title:"
16
+ msgstr ""
17
+
18
+ #: newpost-catch/class.php:116
19
+ msgid "Thumbnail Size"
20
+ msgstr ""
21
+
22
+ #: newpost-catch/class.php:117
23
+ msgid "Width:"
24
+ msgstr ""
25
+
26
+ #: newpost-catch/class.php:120
27
+ msgid "Height:"
28
+ msgstr ""
29
+
30
+ #: newpost-catch/class.php:124
31
+ msgid "Showposts:"
32
+ msgstr ""
33
+
34
+ #: newpost-catch/class.php:125
35
+ msgid "Posts"
36
+ msgstr ""
37
+
38
+ #: newpost-catch/class.php:128
39
+ msgid "Display date"
40
+ msgstr ""
41
+
newpost-catch.php ADDED
@@ -0,0 +1,34 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /*
3
+ Plugin Name: Newpost Catch
4
+ Plugin URI: http://www.imamura.biz/blog/
5
+ Description: Thumbnails in new articles setting widget.
6
+ Version: 1.0.0
7
+ Author: Tetsuya Imamura
8
+ Text Domain: newpost-catch
9
+ Author URI: http://www.imamura.biz/blog/
10
+ License: GPL2
11
+ */
12
+
13
+ //Includes
14
+ include "class.php";
15
+
16
+ //Hook
17
+ add_action('widgets_init', create_function('', 'return register_widget("NewpostCatch");'));
18
+
19
+ /* Copyright 2012 Tetsuya Imamura (email : wordpress@imamura.biz)
20
+
21
+ This program is free software; you can redistribute it and/or modify
22
+ it under the terms of the GNU General Public License, version 2, as
23
+ published by the Free Software Foundation.
24
+
25
+ This program is distributed in the hope that it will be useful,
26
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
27
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
28
+ GNU General Public License for more details.
29
+
30
+ You should have received a copy of the GNU General Public License
31
+ along with this program; if not, write to the Free Software
32
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
33
+ */
34
+ ?>
no_thumb.png ADDED
Binary file
readme.txt ADDED
@@ -0,0 +1,41 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ === Plugin Name ===
2
+ Contributors: s56bouya
3
+ Donate link: http://www.imamura.biz/
4
+ Tags: widget, plugin, posts, sidebar, image, images
5
+ Requires at least: 3.3.1
6
+ Tested up to: 3.3.1
7
+ Stable tag: 1.0.0
8
+
9
+ Thumbnails in new articles setting widget.
10
+
11
+ == Description ==
12
+
13
+ Thumbnails in new articles setting widget.
14
+
15
+ == Installation ==
16
+
17
+ **Required PHP5.**
18
+
19
+ 1. Unzip "Newpost Catch" archive.
20
+ 2. Upload folder 'newpost-catch' to the `/wp-content/plugins/` directory
21
+ 3. Activate the plugin through the 'Plugins' menu in WordPress
22
+ 4. Add the widget to your sidebar from Appearance->Widgets and configure the widget options.
23
+
24
+ == Frequently Asked Questions ==
25
+
26
+ I think that the more you do not even question...
27
+
28
+ == Screenshots ==
29
+
30
+ 1. To display the eye-catching(Thumbnail) set to Latest Post.
31
+ 2. Localized support is in order.
32
+ 3. Is simple to add the side bar, to set the size of the thumbnail, posts, post date
33
+
34
+ == Changelog ==
35
+
36
+ = 1.0.0 =
37
+ * First stable version.
38
+
39
+ == Upgrade Notice ==
40
+
41
+ Now plans to update various
screenshot-1.png ADDED
Binary file
screenshot-2.png ADDED
Binary file
style.css ADDED
@@ -0,0 +1,116 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*
2
+ Newpost Catch StyleSheet
3
+
4
+ Please to customize as you like.
5
+ */
6
+
7
+ #npcatch li{
8
+ -webkit-transition: all 300ms linear;
9
+ -moz-transition: all 300ms linear;
10
+ -o-transition: all 300ms linear;
11
+ -ms-transition: all 300ms linear;
12
+ transition: all 300ms linear;
13
+ overflow:hidden;
14
+ clear:both;
15
+ margin:0px 0px 0px;
16
+ }
17
+
18
+ #npcatch .thumb{
19
+ -webkit-transition: all 200ms linear;
20
+ -moz-transition: all 200ms linear;
21
+ -o-transition: all 200ms linear;
22
+ -ms-transition: all 200ms linear;
23
+ transition: all 200ms linear;
24
+ float:left;
25
+ padding:5px 10px;
26
+ }
27
+
28
+ #npcatch .title{
29
+ opacity: 0.8;
30
+ -webkit-transition: all 200ms linear;
31
+ -moz-transition: all 200ms linear;
32
+ -o-transition: all 200ms linear;
33
+ -ms-transition: all 200ms linear;
34
+ transition: all 200ms linear;
35
+ width:135px;
36
+ float:left;
37
+ padding:5px 5px 5px 0px;
38
+ }
39
+
40
+ #npcatch li:hover{
41
+ background:#ffffff;
42
+ }
43
+
44
+ #npcatch li:hover .thumb{
45
+ color: transparent;
46
+ -webkit-animation: moveFromTop 400ms ease;
47
+ -moz-animation: moveFromTop 400ms ease;
48
+ -ms-animation: moveFromTop 400ms ease;
49
+ }
50
+
51
+ #npcatch li:hover .title{
52
+ -webkit-animation: moveFromTop 500ms ease;
53
+ -moz-animation: moveFromTop 500ms ease;
54
+ -ms-animation: moveFromTop 500ms ease;
55
+ }
56
+
57
+ #npcatch li:hover .title a{
58
+ color:#000000;
59
+ }
60
+
61
+ #npcatch li:hover .date{
62
+ }
63
+
64
+
65
+ /** Define Webkit **/
66
+
67
+ @-webkit-keyframes moveFromTop {
68
+ from {
69
+ -webkit-transform: translateY(-300%);
70
+ }
71
+ to {
72
+ -webkit-transform: translateY(0%);
73
+ }
74
+ }
75
+ @-moz-keyframes moveFromTop {
76
+ from {
77
+ -moz-transform: translateY(-300%);
78
+ }
79
+ to {
80
+ -moz-transform: translateY(0%);
81
+ }
82
+ }
83
+ @-ms-keyframes moveFromTop {
84
+ from {
85
+ -ms-transform: translateY(-300%);
86
+ }
87
+ to {
88
+ -ms-transform: translateY(0%);
89
+ }
90
+ }
91
+
92
+ @-webkit-keyframes moveFromBottom {
93
+ from {
94
+ -webkit-transform: translateY(200%);
95
+ }
96
+ to {
97
+ -webkit-transform: translateY(0%);
98
+ }
99
+ }
100
+ @-moz-keyframes moveFromBottom {
101
+ from {
102
+ -moz-transform: translateY(200%);
103
+ }
104
+ to {
105
+ -moz-transform: translateY(0%);
106
+ }
107
+ }
108
+ @-ms-keyframes moveFromBottom {
109
+ from {
110
+ -ms-transform: translateY(200%);
111
+ }
112
+ to {
113
+ -ms-transform: translateY(0%);
114
+ }
115
+ }
116
+