Changeset 1815460
- Timestamp:
- 02/05/2018 06:19:27 AM (8 years ago)
- Location:
- sync-wp-steem-comments/trunk
- Files:
-
- 1 deleted
- 3 edited
-
comments-post.php (deleted)
-
js/pull_steem_comments.js (modified) (2 diffs)
-
readme.txt (modified) (4 diffs)
-
sync-wp-steem-comments.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
sync-wp-steem-comments/trunk/js/pull_steem_comments.js
r1815421 r1815460 8 8 </div>'; 9 9 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); 25 12 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) 27 21 { 28 22 alert("CANNOT find comments id, please setup the \"Comments Div ID\" option."); … … 138 132 return htmlString.format(title, timeString, commentText); 139 133 } 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 else171 { alert(err);}172 }173 function ajax_add_comment(jsonComment)174 {175 //http://tson.com/wp-content/plugins/sycn-wp-steem-comment/js176 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 11 11 12 12 Sync WP Steem Comments can sync Steemit and WordPress comments. 13 Sync WP Steem Comments可以同步Steemit和WordPress的评论。14 13 15 14 == Description == 16 15 17 16 Sync 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 18 18 Sync WP Steem Comments可以同步Steemit和WordPress的评论。[Steemit](https://steemit.com/)是一个基于区块链的社交(博客)系统。在Steemit上你可以通过写文章赚钱。越来越多的人在Steemit上写文章,而且Steemit上的评论相比WordPress也活跃,所以个人认为将Steemit同步到WordPress上对自己的博客很有帮助。 19 19 = Features = … … 21 21 - Easy to use User Interface 22 22 23 - 自动同步Steemit和WordPress的评论24 - 容易使用25 26 23 = What is Steem? = 27 24 [Steemit](https://steemit.com/) is a blockchain-based social media platform where anyone can earn rewards. 28 29 [Steemit](https://steemit.com/)是一个基于区块链的社交(博客)系统。在Steemit上你可以通过写文章赚钱。30 25 31 26 = Note = 32 27 You will require your Steem _PRIVATE POSTING KEY_ for this plugin to work. Your _PRIVATE POSTING KEY_ is <strong>NOT</strong> stored on our servers. 33 28 34 需要使用Steemit的**_PRIVATE POSTING KEY**。**_PRIVATE POSTING KEY**不会存储在我们的服务器上。35 36 29 = Support = 37 30 Please 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联系我。40 31 41 32 == Installation == … … 44 35 45 36 = Where can I report bugs or contribute to the project? = 46 = 如何报告BUG,或者为此项目做一点事? =47 37 Bugs 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). 48 38 49 你可以到此插件的支持论坛或者[Sync WP Steem Comments GitHub repository issues](https://github.com/RileyGe/sync-wp-steem-comments/issues)上报告BUG。50 51 39 = How can I contribute? = 52 = 如何贡献自己的代码? =53 40 Yes you can! Join in on our [GitHub repository](https://github.com/RileyGe/sync-wp-steem-comments) :) 54 41 55 不要犹豫,到[GitHub repository](https://github.com/RileyGe/sync-wp-steem-comments)上加入我们 :)56 42 == Screenshots == 57 43 … … 61 47 * Initial version in of Sync WP Steem Comments 62 48 63 * 最初版本64 65 49 == Upgrade Notice == 66 50 67 51 = 0.0.1 = 68 52 Initial version in of Sync WP Steem Comments. 69 70 最初版本。 -
sync-wp-steem-comments/trunk/sync-wp-steem-comments.php
r1815421 r1815460 43 43 ?> 44 44 <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> 46 53 <form method="post" action="options.php"> 47 54 <?php /* 下面这行代码用来保存表单中内容到数据库 */ ?> … … 49 56 50 57 <p> 51 <span >Author:</span>58 <span class='sync-ws-admin-span'>Author:</span> 52 59 <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'); ?>'/> 54 61 </p> 55 62 <p> 56 <span >Posting Key:</span>63 <span class='sync-ws-admin-span'>Posting Key:</span> 57 64 <input name="sync_ws_posting_key" id="sync_ws_posting_key" 58 65 value = '<?php echo get_option('sync_ws_posting_key'); ?>'/> 66 <span>In this version, the field is not needed!</span> 59 67 </p> 60 68 <p> 61 <span >Comments Div ID:</span>69 <span class='sync-ws-admin-span'>Comments Div ID:</span> 62 70 <input name="sync_ws_comments_divid" id="sync_ws_comments_divid" 63 71 value = '<?php echo get_option('sync_ws_comments_divid'); ?>'/> 72 <span>Leave it empty if everything is OK.</span> 64 73 </p> 65 74 <p>
Note: See TracChangeset
for help on using the changeset viewer.