Plugin Directory

Changeset 1815460


Ignore:
Timestamp:
02/05/2018 06:19:27 AM (8 years ago)
Author:
grlsr
Message:

version 0.0.1

Location:
sync-wp-steem-comments/trunk
Files:
1 deleted
3 edited

Legend:

Unmodified
Added
Removed
  • sync-wp-steem-comments/trunk/js/pull_steem_comments.js

    r1815421 r1815460  
    88                    </div>';
    99    var commentsDiv = null
    10     if(divid == "")
    11     {
    12         commentsDiv = jQuery("#comments");
    13         if(commentsDiv == null)
    14         {
    15             commentsDiv = jQuery("div[id^='comments']");//id属性以comments开头的所有div标签
    16             if(commentsDiv == null)
    17             {
    18                 commentsDiv = jQuery("div[id$='comments']");
    19             }
    20         }
    21     }else
    22     {
    23         commentsDiv = jQuery("#" + divid);
    24     }
     10    if(divid.length > 0)
     11        commentsDiv = jQuery("#" + divid);       
    2512
    26     if(commentsDiv == null)
     13    if(commentsDiv.length < 1)
     14        commentsDiv = jQuery("#comments");       
     15    if(commentsDiv.length < 1)
     16        commentsDiv = jQuery("div[id^='comments']");//id属性以comments开头的所有div标签   
     17    if(commentsDiv.length < 1)
     18        commentsDiv = jQuery("div[id$='comments']");
     19
     20    if(commentsDiv.length < 1)
    2721    {
    2822        alert("CANNOT find comments id, please setup the \"Comments Div ID\" option.");
     
    138132    return htmlString.format(title, timeString, commentText);
    139133}
    140 function load_steemit_comments_to_json(author, permlink, postid)
    141 {
    142     steem.api.setOptions({ url: 'https://api.steemit.com' }); 
    143     jQuery(document).ready(function () {
    144         jQuery("body").append('<span id="sync-ws-postid">{0}</span>'.format(postid));
    145         steem.api.getContentReplies(author, permlink, contentRepliesCB2Json);                   
    146     });
    147 }
    148 function contentRepliesCB2Json(err, result)
    149 {
    150     if (!err)
    151     {
    152         for (i = 0; i <= result.length - 1; i++) {
    153             var commentJson = {};
    154             //为了获取post_id,在开始前先将一个隐藏的span插入到html中
    155             commentJson['post_id'] = jQuery("#sync-ws-postid").val();
    156             commentJson['steem_parent'] = result[i].parent_permlink;
    157             commentJson['author'] = result[i].author;
    158             commentJson['date'] = new Date(result[i].last_update);
    159             commentJson['comment'] = result[i].body;
    160             commentJson['steem_permlink'] = result[i].permlink;
    161 
    162             ajax_add_comment(commentJson.toJSONString());
    163                        
    164             if(result[i].children > 0)
    165             {
    166                 steem.api.getContentReplies(result[i].author, result[i].permlink, contentRepliesCB2Json);
    167             }       
    168         }
    169     }
    170     else
    171     { alert(err);}
    172 }
    173 function ajax_add_comment(jsonComment)
    174 {
    175     //http://tson.com/wp-content/plugins/sycn-wp-steem-comment/js
    176     var jsPath = window.document.location.href.substring(0, jsPath.lastindexOf('/'));
    177     var pluginDir = jsPath.substring(0, jsPath.lastIndexOf('/'));
    178     jQuery.post(pluginDir+'/comments-post.php', jsonComment, function(result){
    179         //$("span").html(result);
    180     });
    181 }
  • sync-wp-steem-comments/trunk/readme.txt

    r1815421 r1815460  
    1111
    1212Sync WP Steem Comments can sync Steemit and WordPress comments.
    13 Sync WP Steem Comments可以同步Steemit和WordPress的评论。
    1413
    1514== Description ==
    1615
    1716Sync WP Steem Comments can sync Steemit and WordPress comments. [Steemit](https://steemit.com/) is a blockchain-based social media platform where anyone can earn rewards. There are more and more persons using Steemit, and more comments on Steemit. So it's important to pull comments from Steemit to Wordpress.
     17
    1818Sync WP Steem Comments可以同步Steemit和WordPress的评论。[Steemit](https://steemit.com/)是一个基于区块链的社交(博客)系统。在Steemit上你可以通过写文章赚钱。越来越多的人在Steemit上写文章,而且Steemit上的评论相比WordPress也活跃,所以个人认为将Steemit同步到WordPress上对自己的博客很有帮助。
    1919= Features =
     
    2121- Easy to use User Interface
    2222
    23 - 自动同步Steemit和WordPress的评论
    24 - 容易使用
    25 
    2623= What is Steem? =
    2724[Steemit](https://steemit.com/) is a blockchain-based social media platform where anyone can earn rewards.
    28 
    29 [Steemit](https://steemit.com/)是一个基于区块链的社交(博客)系统。在Steemit上你可以通过写文章赚钱。
    3025
    3126= Note =
    3227You will require your Steem _PRIVATE POSTING KEY_ for this plugin to work. Your _PRIVATE POSTING KEY_ is <strong>NOT</strong> stored on our servers.
    3328
    34 需要使用Steemit的**_PRIVATE POSTING KEY**。**_PRIVATE POSTING KEY**不会存储在我们的服务器上。
    35 
    3629= Support =
    3730Please support me by following me on Steemit [@rileyge](https://steemit.com/@rileyge) or if you feel like donating, that would really help a lot on my future Steem developments around WordPress ecosystem. You can contract me using the email: grlsr at 163.com :)
    38 
    39 你可以通过关注我的Steemit帐号[@rileyge](https://steemit.com/@rileyge)。捐赠会有助于我更好的开发此插件,如果你想捐赠,请用邮件 grlsr at 163.com联系我。
    4031
    4132== Installation ==
     
    4435
    4536= Where can I report bugs or contribute to the project? =
    46 = 如何报告BUG,或者为此项目做一点事? =
    4737Bugs can be reported either in our support forum or preferably on the [Sync WP Steem Comments GitHub repository issues](https://github.com/RileyGe/sync-wp-steem-comments/issues).
    4838
    49 你可以到此插件的支持论坛或者[Sync WP Steem Comments GitHub repository issues](https://github.com/RileyGe/sync-wp-steem-comments/issues)上报告BUG。
    50 
    5139= How can I contribute? =
    52 = 如何贡献自己的代码? =
    5340Yes you can! Join in on our [GitHub repository](https://github.com/RileyGe/sync-wp-steem-comments) :)
    5441
    55 不要犹豫,到[GitHub repository](https://github.com/RileyGe/sync-wp-steem-comments)上加入我们 :)
    5642== Screenshots ==
    5743
     
    6147* Initial version in of Sync WP Steem Comments
    6248
    63 * 最初版本
    64 
    6549== Upgrade Notice ==
    6650
    6751= 0.0.1 =
    6852Initial version in of Sync WP Steem Comments.
    69 
    70 最初版本。
  • sync-wp-steem-comments/trunk/sync-wp-steem-comments.php

    r1815421 r1815460  
    4343    ?>
    4444    <div> 
    45         <h2>Sync WP Steemit Comments Setting</h2> 
     45        <h2>Sync WP Steemit Comments Setting</h2>
     46        <style type="text/css">
     47            .sync-ws-admin-span {
     48                width:180px;
     49                text-align:left;                 
     50                display:inline-block;
     51            }
     52        </style>
    4653        <form method="post" action="options.php"> 
    4754            <?php /* 下面这行代码用来保存表单中内容到数据库 */ ?> 
     
    4956 
    5057            <p> 
    51                 <span>Author:</span>
     58                <span class='sync-ws-admin-span'>Author:</span>
    5259                <input name="sync_ws_author" id="sync_ws_author"
    53                 value = '<?php echo get_option('sync_ws_author'); ?>'/>
     60                value = '<?php echo get_option('sync_ws_author'); ?>'/>               
    5461            </p>   
    5562            <p>
    56                 <span>Posting Key:</span> 
     63                <span class='sync-ws-admin-span'>Posting Key:</span> 
    5764                <input name="sync_ws_posting_key" id="sync_ws_posting_key"
    5865                value = '<?php echo get_option('sync_ws_posting_key'); ?>'/>
     66                <span>In this version, the field is not needed!</span>
    5967            </p>
    6068            <p>
    61                 <span>Comments Div ID:</span> 
     69                <span class='sync-ws-admin-span'>Comments Div ID:</span> 
    6270                <input name="sync_ws_comments_divid" id="sync_ws_comments_divid"
    6371                value = '<?php echo get_option('sync_ws_comments_divid'); ?>'/>
     72                <span>Leave it empty if everything is OK.</span>
    6473            </p>
    6574            <p> 
Note: See TracChangeset for help on using the changeset viewer.