留言版

欢迎留言评论!

发表评论?

103 条评论。

  1. 马帮电商代运营

    涨知识啊,学习了

  2. 也喜欢玩域名 哈哈哈

  3. 看到你这边也有confluence的一些文章,想请教下confluence接入LDAP统一身份认证怎么配置,我LDAP使用的是ipa-server,在配置中好些配置都摸不清该怎么填写,可否指教一下

  4. 这主题配色好丑啊

  5. 这个站点和你站点下面的那些链接站点都是你自己一个人弄的吗?

  6. 测试升级后是否正确20140421

  7. 请教Tscccn版主,JIRA有些需求与SVN代码关联后,再单击‘Subversion Commits’ 整个活动页都会消失,即不显示。但有些需求却是正确的,能显示SVN关联的代码,同样前面活动页消失的,若通过其它需求切换到‘工作日志’后也能显示活动页,就是不能切换至‘Subversion Commits’ 。

    此问题应如何处理,我的JIRA版本为4.4.4

  8. function post_to_sina_weibo($post_ID) {
    if( wp_is_post_revision($post_ID) ) return;
    $get_post_info = get_post($post_ID);
    $get_post_centent = get_post($post_ID)->post_content;
    //去掉文章内的html编码的空格、换行、tab等符号(如果你文章的编码格式是这样子,可以将下面的”//”去掉即开启此功能)
    //$get_post_centent = str_replace(“\t”, ” “, str_replace(“\n”, ” “, str_replace(” “, ” “, $get_post_centent)));
    $get_post_title = get_post($post_ID)->post_title;
    if ( $get_post_info->post_status == ‘publish’ && $_POST[‘original_post_status’] != ‘publish’ ) {
    $request = new WP_Http;
    $status = ‘【’ . strip_tags( $get_post_title ) . ‘】 ‘ . mb_strimwidth(strip_tags( apply_filters(‘the_content’, $get_post_centent)),0, 132,’…’) . ‘ 全文地址:’ . get_permalink($post_ID) ;
    $api_url = ‘https://api.weibo.com/2/statuses/update.json’;
    $body = array( ‘status’ => $status, ‘source’=>’493983281’);
    $headers = array( ‘Authorization’ => ‘Basic ‘ . ‘账号:密码’ );
    /*
    如果你使用改方法,请注释掉上面$headers = array( ‘Authorization’ => ‘Basic ‘ . ‘1fFjYc3uQHZpcF32fS5jb146MxFeY19DYF53aWfzNA==’ );
    换成如下代码
    //你的新浪微博登陆名
    $username = ” ;
    //你的新浪微博登陆密码
    $password = ” ;
    $headers = array( ‘Authorization’ => ‘Basic ‘ . base64_encode(‘$username:$password’));
    */
    $result = $request->post( $api_url , array( ‘body’ => $body, ‘headers’ => $headers ) );
    }
    }
    add_action(‘publish_post’, ‘post_to_sina_weibo’, 0);

    • 你这么写是有错误的,把你博客里的删除掉,用下面的试试,记得改username 和password那块啊

      function post_to_sina_weibo($post_ID) {
      if( wp_is_post_revision($post_ID) ) return;
      $get_post_info = get_post($post_ID);
      $get_post_centent = get_post($post_ID)->post_content;
      $get_post_title = get_post($post_ID)->post_title;
      if ( $get_post_info->post_status == ‘publish’ && $_POST[‘original_post_status’] != ‘publish’ ) {
      $request = new WP_Http;
      $status = ‘【’ . strip_tags( $get_post_title ) . ‘】 ‘ . mb_strimwidth(strip_tags( apply_filters(‘the_content’, $get_post_centent)),0, 132,’…’) . ‘ 全文地址:’ . get_permalink($post_ID) ;
      $api_url = ‘https://api.weibo.com/2/statuses/update.json’;
      $body = array( ‘status’ => $status, ‘source’=>’493983281’);
      //你的新浪微博登陆名
      $username = ” ;
      //你的新浪微博登陆密码
      $password = ” ;
      $headers = array( ‘Authorization’ => ‘Basic ‘ . base64_encode(‘$username:$password’));
      $result = $request->post( $api_url , array( ‘body’ => $body, ‘headers’ => $headers ) );
      }
      }
      add_action(‘publish_post’, ‘post_to_sina_weibo’, 0);

  9. function post_to_sina_weibo($post_ID) {
    if( wp_is_post_revision($post_ID) ) return;
    $get_post_info = get_post($post_ID);
    $get_post_centent = get_post($post_ID)->post_content;
    //去掉文章内的html编码的空格、换行、tab等符号(如果你文章的编码格式是这样子,可以将下面的”//”去掉即开启此功能)
    //$get_post_centent = str_replace(“\t”, ” “, str_replace(“\n”, ” “, str_replace(” “, ” “, $get_post_centent)));
    $get_post_title = get_post($post_ID)->post_title;
    if ( $get_post_info->post_status == ‘publish’ && $_POST[‘original_post_status’] != ‘publish’ ) {
    $request = new WP_Http;
    $status = ‘【’ . strip_tags( $get_post_title ) . ‘】 ‘ . mb_strimwidth(strip_tags( apply_filters(‘the_content’, $get_post_centent)),0, 132,’…’) . ‘ 全文地址:’ . get_permalink($post_ID) ;
    $api_url = ‘https://api.weibo.com/2/statuses/update.json’;
    $body = array( ‘status’ => $status, ‘source’=>’493983281’);
    $headers = array( ‘Authorization’ => ‘Basic ‘ . ‘密码’ );
    /*
    如果你使用改方法,请注释掉上面$headers = array( ‘Authorization’ => ‘Basic ‘ . ‘1fFjYc3uQHZpcF32fS5jb146MxFeY19DYF53aWfzNA==’ );
    换成如下代码
    //你的新浪微博登陆名
    $username = ” ;
    //你的新浪微博登陆密码
    $password = ” ;
    $headers = array( ‘Authorization’ => ‘Basic ‘ . base64_encode(‘$username:$password’));
    */
    $result = $request->post( $api_url , array( ‘body’ => $body, ‘headers’ => $headers ) );
    }
    }
    add_action(‘publish_post’, ‘post_to_sina_weibo’, 0);

  10. 楼主你好,感谢你的分享,但为什么我在functions.php增添代码后还是不行,我的主题是下载的,我网站倒是已经申请好了,哈哈。。谢谢你的帮助。已经粉你微博啦

发表评论


此站点使用Akismet来减少垃圾评论。了解我们如何处理您的评论数据