Changeset 457635
- Timestamp:
- 10/31/2011 08:43:05 AM (14 years ago)
- Location:
- qqpress/trunk
- Files:
-
- 2 edited
-
qqpress.php (modified) (3 diffs)
-
readme.txt (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
qqpress/trunk/qqpress.php
r408132 r457635 18 18 add_action("admin_head", "qc_wp_head"); 19 19 add_action('admin_menu', 'qc_options_add_page'); 20 add_action('admin_menu', 'qqweibo_option_menu'); 20 21 add_action('wp_insert_post', 'qqpress_run'); 21 22 add_option('qqpress_message', '新日志:[title] [permalink]##100', '', 'yes'); … … 31 32 } 32 33 34 //在文章发布页增加是否同步到微博的复选框 35 function qqweibo_option_menu() { 36 if( function_exists('add_meta_box')) { 37 add_meta_box('qqweibo_meta_box', __('腾讯微博同步设置'), 'inner_qqweibo_option_menu', 'post', 'advanced'); 38 } 39 } 40 41 function inner_qqweibo_option_menu($post) { 42 echo '<label for="xx">同步到腾讯微博</label>'; 43 echo '<input id="xx" name="istoqq" type="checkbox" value="1" checked />'; 44 } 45 33 46 //新日志发布时执行 34 47 function qqpress_run($postID) { 35 $post = get_post($postID); //获取日志信息 36 37 //如果该日志并未同步到腾讯微博 38 if (!qqpress_was_qqed($postID)) 39 qqpress_db_update_post($postID, $post->post_status); //改变该日志的同步状态为"qqed" 40 41 qqpress_process_posts(); //同步到腾讯微博 48 if ($_POST['istoqq']) { 49 $post = get_post($postID); //获取日志信息 50 51 //如果该日志并未同步到腾讯微博 52 if (!qqpress_was_qqed($postID)) 53 qqpress_db_update_post($postID, $post->post_status); //改变该日志的同步状态为"qqed" 54 55 qqpress_process_posts($istoqq); //同步到腾讯微博 56 } 42 57 } 43 58 … … 387 402 388 403 return $resp["data"]["id"]; 404 } 405 406 //在文章发布页增加是否同步到微博的复选框 407 add_action('admin_menu', 'qqweibo_option_menu'); 408 function qqweibo_option_menu() { 409 if( function_exists('add_meta_box')) { 410 add_meta_box('qqweibo_meta_box', __( '腾讯微博同步设置'), 'inner_qqweibo_option_menu', 'post', 'advanced'); 411 } 412 } 413 414 function inner_weibo_option_menu($post) { 415 echo '<label for="myplugin_new_field">同步到腾讯微博</label>'; 416 echo '<input name="istoqq" type="checkbox" value="1" checked />'; 389 417 } 390 418 -
qqpress/trunk/readme.txt
r406705 r457635 1 === Plugin Name ===1 === Plugin Name === 2 2 Contributors: cooiky 3 3 Donate link: http://app.hencuo.com/qqpress 4 4 Tags: qq,weibo,腾讯微博,腾讯微博同步,WordPress同步 5 5 Requires at least: 3.0 6 Tested up to: 3. 1.17 Stable tag: 1. 46 Tested up to: 3.2.1 7 Stable tag: 1.5 8 8 9 9 支持将新日志标题和链接同步到腾讯微博,同时支持自定义文章内容预览长度。 10 10 11 11 == Description == 12 发布日志时 同步一条该日志标题和链接到腾讯微博,并可指定文章内容预览字数。12 发布日志时,支持选择是否同步一条该日志标题和链接到腾讯微博,并可指定文章内容预览字数。 13 13 支持自定义消息前缀。 14 14 腾讯微博OAuth授权。 … … 33 33 34 34 == Changelog == 35 = 1.5 = 36 * 2011/10/31 37 * 发布文章时,提供选择是否同步到腾讯微博。 38 35 39 = 1.4 = 36 40 * 2011/07/08
Note: See TracChangeset
for help on using the changeset viewer.