Changeset 382164
- Timestamp:
- 05/07/2011 02:42:56 PM (15 years ago)
- Location:
- qqpress/trunk
- Files:
-
- 2 edited
-
qqpress.php (modified) (6 diffs)
-
readme.txt (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
qqpress/trunk/qqpress.php
r381634 r382164 6 6 Plugin URI: http://app.hencuo.com/qqpress 7 7 Description: 新文章发布时,将文章标题和URL发布到你的腾讯微博。 8 Version: 1. 18 Version: 1.2 9 9 */ 10 10 … … 24 24 if (session_id() == "") 25 25 session_start(); 26 if (isset($_POST["qqpress_send"]) && "1" == isset($_POST["qqpress_send"]) && isset($_POST["qqpress_tweet"])) { 27 echo qqpress_publish_2_qq($_POST["qqpress_tweet"]); 28 die(); 29 } 26 30 } 27 31 … … 190 194 if (get_option("qq_oauth_token") != false && get_option("qq_oauth_token_secret") != false) { 191 195 ?> 192 <div class="wrap"> 196 <div class="wrap"><div id="icon-options-general" class="icon32"><br /></div> 193 197 <h2>腾讯微博同步</h2> 194 <div id="message" class="updated fade"><p>授权成功</p></div>198 <div class="updated fade"><p>已成功授权</p></div> 195 199 <p>取消授权请访问:<a href="http://open.t.qq.com/apps/appslist.php" target="_blank">http://open.t.qq.com/apps/appslist.php</a></p> 196 200 </div> … … 216 220 <h2>腾讯微博同步授权</h2> 217 221 <style type="text/css"> 218 .qc_button img{ border:none;}222 .qc_button img{border:none;} 219 223 </style> 220 224 <p id="qc_connect" class="qc_button"> … … 232 236 $message = get_option('qqpress_message'); 233 237 $submitFieldID = 'qqpress_submit_hidden'; 234 238 235 239 if ($_POST[$submitFieldID] == 'Y') { 236 240 update_option('qqpress_message', $_POST['qqpress_form_message']); 237 241 echo '<div class="updated"><p><strong>更新成功</strong></p></div>'; 238 242 } 243 244 $qc_url = WP_PLUGIN_URL.'/'.dirname(plugin_basename (__FILE__)); 239 245 ?> 240 246 <script type="text/javascript"> 247 /*<![CDATA[*/ 248 jQuery(function() { 249 jQuery("#qqpress_tweet").click(function() { 250 var tweet = jQuery.trim(jQuery("#qqpress_tweet_content").val()); 251 if ("" != tweet) { 252 jQuery.ajax({ 253 type : "POST", 254 beforeSend : disable_button, 255 dataType : "text", 256 url : "<?php echo str_replace('%7E', '~', $_SERVER['REQUEST_URI']); ?>", 257 data : "qqpress_tweet=" + tweet + "&qqpress_send=1×tamp=" + (new Date().getTime()), 258 success : show_message 259 }); 260 } else { 261 alert("广播内容不能为空!"); 262 } 263 }); 264 }) 265 266 function disable_button() { 267 jQuery("#qqpress_tweet").attr("disabled", "disabled"); 268 } 269 270 function show_message(data) { 271 jQuery("#qqpress_result").html("发布成功。<a href='http://t.qq.com/p/t/"+data+"' target='_blank'>查看</a>").css("color", "red"); 272 jQuery("#qqpress_tweet").attr("disabled", ""); 273 } 274 /*]]>*/ 275 </script> 241 276 <div class="wrap"> 242 <h2>腾讯微博同步选项</h2> 243 244 <form name="qqpress_form" method="post" action="<?php echo str_replace('%7E', '~', $_SERVER['REQUEST_URI']); ?>"> 245 <input type="hidden" name="qqpress_submit_hidden" value="Y" /> 246 <p><h3>同步内容格式</h3><textarea name="qqpress_form_message" rows="3" cols="80" /><?php echo (get_option('qqpress_message')); ?></textarea></p> 247 <p class="submit"><input type="submit" name="Submit" value="更新" /></p> 248 <p>同步内容支持以下格式: 249 <ul> 250 <li><strong>[title]</strong>:日志标题</li> 251 <li><strong>[permalink]</strong>:自定义的日志永久链接<em>(<a href="http://www.hencuo.com/archives/119" target="_blank">http://www.hencuo.com/archives/119</a>)</em></li> 252 <li><strong>[link]</strong>:默认的日志链接<em>(<a href="http://www.hencuo.com/index.php?p=119" target="_blank">http://www.hencuo.com/index.php?p=119</a>)</em></li> 253 </ul> 254 </p> 255 </form> 277 <div class="tool-box"> 278 <h3>发微博</h3> 279 <textarea id="qqpress_tweet_content" name="qqpress_tweet_content" rows="2" cols="80" />#半醒WP微博同步#</textarea><br /> 280 <input type="button" id="qqpress_tweet" name="qqpress_tweet_button" value=" 广 播 " class="button" /><span id="qqpress_result"></span><br /><br /> 281 282 <h3>腾讯微博同步格式</h3> 283 <p><form name="qqpress_form" method="post" action="<?php echo str_replace('%7E', '~', $_SERVER['REQUEST_URI']); ?>"> 284 <input type="hidden" name="qqpress_submit_hidden" value="Y" /> 285 <label for="qqpress_form_message">同步内容格式:</label> 286 <input type="text" class="regular-text" id="qqpress_form_message" name="qqpress_form_message" value="<?php echo (get_option('qqpress_message')); ?>" /><input type="submit" name="Submit" class="button" value="保存修改" /> 287 </form></p> 288 <p>同步内容支持以下格式: 289 <ul> 290 <li><strong>[title]</strong>:日志标题</li> 291 <li><strong>[permalink]</strong>:自定义的日志永久链接<em>(<a href="http://www.hencuo.com/archives/119" target="_blank">http://www.hencuo.com/archives/119</a>)</em></li> 292 <li><strong>[link]</strong>:默认的日志链接<em>(<a href="http://www.hencuo.com/index.php?p=119" target="_blank">http://www.hencuo.com/index.php?p=119</a>)</em></li> 293 </ul> 294 </p> 295 </div> 256 296 </div> 257 297 <?php … … 292 332 293 333 $resp = $to->post('http://open.t.qq.com/api/t/add?f=1', $params); 334 335 return $resp["data"]["id"]; 294 336 } 295 337 -
qqpress/trunk/readme.txt
r381634 r382164 5 5 Requires at least: 3.0 6 6 Tested up to: 3.1.1 7 Stable tag: 1. 17 Stable tag: 1.2 8 8 9 9 支持将新日志标题和链接同步到腾讯微博。 … … 30 30 31 31 == Changelog == 32 = 1.2 = 33 * 2011/05/07 34 * 增加在插件设置页面直接发微博功能 35 32 36 = 1.11 = 33 37 * 2011/05/06 34 38 * 修正插件在进行微博同步时获取日志永久链接错误的bug 39 35 40 = 1.1 = 36 41 * 2011/05/05
Note: See TracChangeset
for help on using the changeset viewer.