Changeset 401951
- Timestamp:
- 06/28/2011 04:51:59 AM (15 years ago)
- Location:
- mixi-check/trunk
- Files:
-
- 7 edited
-
images/mixi_check_button_5.png (modified) (previous)
-
languages/mixi-check-ja.mo (modified) (previous)
-
languages/mixi-check-ja.po (modified) (2 diffs)
-
mixi-check.php (modified) (1 diff)
-
readme.txt (modified) (3 diffs)
-
screenshot-1.png (modified) (previous)
-
sharing-sources.php (modified) (7 diffs)
Legend:
- Unmodified
- Added
- Removed
-
mixi-check/trunk/languages/mixi-check-ja.po
r297185 r401951 9 9 "Report-Msgid-Bugs-To: http://wordpress.org/tag/mixi-check\n" 10 10 "POT-Creation-Date: 2010-10-03 10:57+0000\n" 11 "PO-Revision-Date: 201 0-10-06 15:58+0900\n"11 "PO-Revision-Date: 2011-06-28 13:47+0900\n" 12 12 "Last-Translator: Keisuke Nemoto <[email protected]>\n" 13 13 "Language-Team: \n" … … 45 45 msgstr "ボタン5" 46 46 47 msgid "Button type" 48 msgstr "ボタンタイプ" 47 msgid "Button" 48 msgstr "ボタン" 49 50 msgid "OGP meta to output" 51 msgstr "OGPメタタグを出力" 52 53 msgid "Namespace" 54 msgstr "名前空間" 49 55 50 56 msgid "Not set mixi check key" -
mixi-check/trunk/mixi-check.php
r394435 r401951 3 3 Plugin Name: mixi Check for Sharedaddy 4 4 Description: Sharing to mixi Check. 5 Version: 1. 0.15 Version: 1.1 6 6 Author: nemooon 7 7 Author URI: http://nemooon.jp/ -
mixi-check/trunk/readme.txt
r394435 r401951 1 1 === mixi Check for Sharedaddy === 2 2 Contributors: nemooon 3 Donate link: http://nemooon.jp/4 3 Tags: mixi, Sharedaddy 5 4 Requires at least: 2.8 6 Tested up to: 3. 1.37 Stable tag: 1. 0.15 Tested up to: 3.2 6 Stable tag: 1.1 8 7 9 8 Add to Sharedaddy support service. … … 15 14 Sharedaddyプラグインにmixiチェックを追加します。 16 15 17 PHP5 Require. 16 **PHP5 REQUIRE** 18 17 19 18 == Installation == … … 31 30 == Changelog == 32 31 32 = 1.1 = 33 * Support OGP option. 34 * Replaced 'Button-5' with transparent images. 35 33 36 = 1.0.1 = 34 37 * Support Jetpack plugin -
mixi-check/trunk/sharing-sources.php
r394435 r401951 18 18 private $button = 'button-1'; 19 19 private $check_key = null; 20 private $ogp_use = false; 21 private $ogp_ns = 'og'; 20 22 21 23 public function __construct( $id, array $settings ) { … … 30 32 if ( isset( $settings['check_key'] ) ) 31 33 $this->check_key = $settings['check_key']; 34 35 if ( isset( $settings['ogp_use'] ) ) 36 $this->ogp_use = $settings['ogp_use']; 37 38 if ( isset( $settings['ogp_ns'] ) ) 39 $this->ogp_ns = $settings['ogp_ns']; 32 40 } 33 41 … … 41 49 42 50 public function display_header(){ 43 44 //オプションでここの出力を変える感じ。 名前空間には "mixi" -> "og" -> 無し の優先順位 45 echo '<meta property="og:title" content="' . get_the_title() . '" />'.PHP_EOL; //タイトル 46 //echo '<meta property="og:description" content="' . get_the_excerpt() . '" />'.PHP_EOL; //本文 47 //echo '<meta property="mixi:content-rating" content="1" />'.PHP_EOL; //18禁 48 49 //デバイス別URLの指定 linkでもmetaでも 50 //echo '<link rel="mixi-check-alternate" type="text/html" media="mixi-device-(smartphone|mobile|docomo|au|softbank)" href="[記事URL]" />'.PHP_EOL; 51 //echo '<meta property="mixi:device-(smartphone|mobile|docomo|au|softbank)" content="[記事URL]" />'.PHP_EOL; 52 53 //サムネイル画像 link or meta 5枚まで JPEG,PNG,GIF 1KB〜400KB 76px〜必須 180px〜推奨 54 //echo '<link rel="mixi-check-image" type="image/jpeg" href="[画像URL]">'.PHP_EOL; 55 //echo '<meta property="mixi:image" content="[画像URL]" />'.PHP_EOL; 56 echo '<meta name="mixi-check-robots" CONTENT="notitle, nodescription, noimage">'.PHP_EOL; 51 if ( $this->ogp_use ) { 52 $ns = $this->ogp_ns; 53 if ( is_home() ) { 54 echo '<meta property="'.$ns.':title" content="' . get_bloginfo( 'title' ) . '" />'.PHP_EOL; 55 echo '<meta property="'.$ns.':description" content="' . get_bloginfo( 'description' ) . '" />'.PHP_EOL; 56 echo '<meta property="'.$ns.':type" content="blog" />'.PHP_EOL; 57 echo '<meta property="'.$ns.':url" content="' . home_url( '/', 'http' ) . '" />'.PHP_EOL; 58 } 59 elseif ( is_singular() ) { 60 the_post(); 61 $post = get_post( get_the_ID() ); 62 echo '<meta property="'.$ns.':title" content="' . $post->post_title . '" />'.PHP_EOL; 63 echo '<meta property="'.$ns.':description" content="' . $post->post_excerpt . '" />'.PHP_EOL; 64 echo '<meta property="'.$ns.':type" content="article" />'.PHP_EOL; 65 echo '<meta property="'.$ns.':url" content="' . get_permalink() . '" />'.PHP_EOL; 66 67 //成年コンテンツ 68 //echo '<meta property="mixi:content-rating" content="1" />'.PHP_EOL; 69 70 //サムネイル画像 71 $images = array(); 72 if ( has_post_thumbnail() ) { 73 list( $src ) = wp_get_attachment_image_src( get_post_thumbnail_id() ); 74 $images[] = $src; 75 } 76 preg_match_all( "/\<img[^\>]*[src] *= *[\"\']{0,1}([^\"\'\ >]*)/i", $post->post_title, $matches ); 77 $images = array_merge( $images, $matches[1] ); 78 foreach ( $images as $image ) { 79 echo '<meta property="'.$ns.':image" content="'.$image.'" />'.PHP_EOL; 80 } 81 82 //自動取得の制御 83 //echo '<meta name="mixi-check-robots" CONTENT="notitle, nodescription, noimage">'.PHP_EOL; 84 85 //デバイス別URLの指定 linkでもmetaでも 86 //echo '<link rel="mixi-check-alternate" type="text/html" media="mixi-device-(smartphone|mobile|docomo|au|softbank)" href="[記事URL]" />'.PHP_EOL; 87 //echo '<meta property="mixi:device-(smartphone|mobile|docomo|au|softbank)" content="[記事URL]" />'.PHP_EOL; 88 89 rewind_posts(); 90 } 91 else { 92 $title = rtrim( wp_title( '|', false, 'right' ), ' |' ); 93 $parse_url = parse_url( home_url( '/' ) ); 94 $url = home_url( preg_replace( '|^'.$parse_url[ 'path' ].'|', '', $_SERVER[ 'REQUEST_URI' ] ), 'http' ); 95 echo '<meta property="'.$ns.':title" content="' . $title . '" />'.PHP_EOL; 96 echo '<meta property="'.$ns.':type" content="blog" />'.PHP_EOL; 97 echo '<meta property="'.$ns.':url" content="' . $url . '" />'.PHP_EOL; 98 } 99 } 57 100 } 58 101 59 102 public function get_display( $post ) { 60 103 if ( !$this->check_key ) return __( 'Not set mixi check key.', 'mixi-check' ); 61 if ( $this->smart ) {104 if ( $this->smart ) 62 105 return '<a href="http://mixi.jp/share.pl" class="mixi-check-button" data-key="'.$this->check_key.'" data-url="'.get_permalink( $post->ID ).'" data-button="'.$this->button.'">Check</a><script type="text/javascript" src="http://static.mixi.jp/js/share.js"></script>'; 63 } 64 else { 106 else 65 107 return $this->get_link( get_permalink( $post->ID ), __( 'mixi Check', 'mixi-check' ), __( 'Click to share on mixi Check', 'mixi-check' ), 'share=mixi-check' ); 66 }67 68 108 } 69 109 … … 113 153 $this->button = 'button-1'; 114 154 $this->check_key = null; 155 $this->ogp_use = false; 156 $this->ogp_ns = 'og'; 115 157 116 158 if ( isset( $data['smart'] ) ) … … 122 164 if ( isset( $data['check_key'] ) ) 123 165 $this->check_key = $data['check_key']; 166 167 if ( isset( $data['ogp_use'] ) ) 168 $this->ogp_use = true; 169 170 if ( isset( $data['ogp_ns'] ) ) 171 $this->ogp_ns = $data['ogp_ns']; 124 172 } 125 173 126 174 public function get_options() { 127 175 return array( 128 'smart' => $this->smart, 129 'button' => $this->button, 130 'check_key' => $this->check_key 176 'smart' => $this->smart, 177 'button' => $this->button, 178 'check_key' => $this->check_key, 179 'ogp_use' => $this->ogp_use, 180 'ogp_ns' => $this->ogp_ns, 131 181 ); 132 182 } … … 143 193 <label><input name="smart" type="checkbox"<?php if ( $this->smart ) echo ' checked="checked"'; ?>/> 144 194 <?php _e( 'Use smart button', $sharedaddy_textdomain ); ?></label><br /> 145 <label><?php _e( 'Button type', 'mixi-check' ); ?></label><br />195 <label><?php _e( 'Button', 'mixi-check' ); ?></label> 146 196 <select name="button"> 147 197 <option value="button-1"<?php if ( $this->button == 'button-1' ) echo ' selected="selected"'; ?>><?php _e( 'button-1', 'mixi-check' ); ?></option> … … 150 200 <option value="button-4"<?php if ( $this->button == 'button-4' ) echo ' selected="selected"'; ?>><?php _e( 'button-4', 'mixi-check' ); ?></option> 151 201 <option value="button-5"<?php if ( $this->button == 'button-5' ) echo ' selected="selected"'; ?>><?php _e( 'button-5', 'mixi-check' ); ?></option> 202 </select> 203 </div> 204 <div class="input"> 205 <label><input name="ogp_use" type="checkbox"<?php if ( $this->ogp_use ) echo ' checked="checked"'; ?>/> 206 <?php _e( 'OGP meta to output', 'mixi-check' ); ?></label><br /> 207 <label><?php _e( 'Namespace', 'mixi-check' ); ?></label> 208 <select name="ogp_ns"> 209 <option value="og"<?php if ( $this->ogp_ns == 'og' ) echo ' selected="selected"'; ?>><?php _e( 'og', 'mixi-check' ); ?></option> 210 <option value="mixi"<?php if ( $this->ogp_ns == 'mixi' ) echo ' selected="selected"'; ?>><?php _e( 'mixi', 'mixi-check' ); ?></option> 152 211 </select> 153 212 </div>
Note: See TracChangeset
for help on using the changeset viewer.