Jump to content

MilenKo

Members
  • Posts

    466
  • Joined

  • Last visited

Everything posted by MilenKo

  1. @wbmnfktr Thanks for the shared link, however as it seems it is for embedding twitter items on your website, where I would need to share a link, but I will have a search on their website for the sharing code as I looked yesterday about FB but not TW.
  2. OK, gents, I was able to manage to resolve the issue with the comment sharing by a simple manipulation of $permalink: $permalink .= '%23Comment' . $comment->id; And call the facebook sharing URL to: <a href=\"https://www.facebook.com/sharer/sharer.php?u={$permalink}\" target=\"_blank\" rel=\"noopener\" title=\"Share on Facebook\" class=\"btn btn-social-icon btn-sm btn-facebook\"><span class=\"fa fa-facebook\"></span></a> The only thing left is to manage to open the sharing window in a new window with specific size which would close after submission but that should be the easier part (I thnk) I just need to make the rest of the social medias I am planning to use working and will share the complete code in case someone else looks for such solution. The trick was to use %23 which I've tested earlier but was not working somehow and my best guess is that the cause was the cache which I must have forgotten to clear. Now it works fine so it is considered an easy to have solution ? P.S. After trying quite few java scripts to open the url in a popup, I am still failing to do that and I am only able to open the sharing window as a new page using target="_blank". Any suggestions for the easiest fix?
  3. Thanks @wbmnfktr I will look into that module even though there was a comment that under php 7.3 it fails somehow. Initially I thought it would be just a simple mod_rewrite rule redirect from /url/comment/id to /url#Comment{id} but will look at any options available which would allow me to share the comment url itself but not just a link to the main page. I am just surprised that I did not find much info or a workaround already where the hashtag URL is not a rare thing and would not be accepted by most social medias. Well, I guess there is still a path to go for everythign ?
  4. Hey @wbmnfktr thanks for your response. As the profile is still in mid-development I do not have any og links in my head and to push the link I changed a bit the $permalink in CommentList.php to contain the code: <a href=\"https://www.facebook.com/sharer/sharer.php?u={$permalink}\" target=\"_blank\" rel=\"noopener\" title=\"Share on Facebook\" class=\"btn btn-social-icon btn-sm btn-facebook\"><span class=\"fa fa-facebook\"></span></a> I've been searching this morning and there are tons of pages asking for the same thing and as it appears, Facebook is cutting down anything after the # and that is my problem. My logic is that I have two things to have this addressed: 1. Change the id of the comment and to eliminate the # in the link, however in this scenario it is used as an anchor and I am not sure yet how to achieve that 2. Use hashbang instead (#!) where it should get changed by facebook API to: ?_escaped_fragment_=/#Comment259 - that was just tested now but the URL of facebook after sharing got to: http://example.com/some-category/post1/?fbclid=IwAR2csPtj_VAPy20XTeMm3yM6N5AnqTujXsyO7g6MFK2QCgyULp64ghL9Nco 3. Have some magic with .htaccess to change the way comments would be accessed - somethig like: http://example.com/some-category/post1/comments/259which should satisfy social medias as a link to share 4. Use a url shortener to cover up the #. I am not sure if this would not be an overkil to use goo.gl or bitly to encode the url and then share it. For me, the best approach would be to change the link of accessing the comments (option 3) but how would I do that is the million dollar question ? So far by modifying quickly the url in the CommentList.php I was able to change the url as listed above, but now I have to manage the redirect from that url back to #Comment259 or apply some changes so that the comments are accessed directly by that URL..
  5. Hey all. Since I finished styling my comments and they are as I would want them to appear, I decided to add a comment sharing function so that a visitor can click a button and share the url of the comment to social medias. I did that using a popover with the social buttons and it all functions properly besides the fact that most medias nowadays omit the hashtagged content and just go with the main page. Here is my sharing url to FB : https://www.facebook.com/sharer/sharer.php?u=http://example.com/some-category/post1/#Comment259 And the shared result: http://example.com/some-category/post1 What would be the simplest and best way to share the URL to the comment? So far I've tested replacing # character with %23 but that got omitted as well.
  6. I've styled the reply form to match the original one under the comment list and it looks great, however the only thing left to achieve is to show the reply form under the comment text but not right under the comment author. I am just trying to figure out is the reply form called right under the Reply button or there is another mechanisme that is pushing down the form by a used class in the form or else. I've noticed some clases that were mandatory for the votes to be counting properly and working so I guess it would be a similar case with the reply, however am not able to find the class yet or where to look for it. Other than that, I think the result is quite satisfying even as it is:
  7. Hey all, After being done with the CommentList.php I started checking up the markup of CommentForm.php which would be responsible for the reply form in two spots - under the parent comment (after clicking on Reply button with a depth > 0 setting in Admin of the comment field) and under the list of comments, I was able to setup the second form which appeared fully matching my original markup. However, I was having issues with the form showing after a Reply button where it looked blured and with a different style than the original one: Having noticed that some of the classes in the FieldTypeComment javas are related to the proper functionality of the comments list and forms, is there some classes that I might have omitted that would cause the form to show right under the comment author or it is just a CSS issue that I could deal with on that level? P.S. For sure I could disable the replies and be over with that issue, however I've spent quite some time to understand better how the module works and how could I simplify my next comment markup so it won't make sense to give up now when I am on the final line, isn't it? ?
  8. Hello all. After quite a bit of fiddling and wrapping my head around comments (of course with the kind assistance of @fbg13 and @kongondo I was able to implement the full functionality of comments with rating and votes. As far as it was a bit tough for me to find the way to properly close all the HTML tags as well as to figure out why this or that was not functioning, I've applied some changes to CommentList.php where I mostly added lots of easy to understand notes about the functioning of the code. I am sharing the complete code of my CommentList.php as well as the initial HTML markup and the comment rendering call in my template so that anyone can easily analyze the implementation and apply their own styles when needed. Hope that helps. Please note that I've added a few extra protected options that I used in my markup for the title tag of the Reply and Permalink title. Here is the content of the file: Here is the official comment list markup: And here is the way I called the comment rendering function in my template: If you have any questions, ask, I will be glad to help if I can depending on the markup.
  9. Hey gents, sorry if it is not the right spot to report a little module issue that I've noticed but I am still getting my head around. While implementing comments on a new project, I have tested what would happen if I add a long word with no breaks (for example 60 letters of T or else). As I was expecting it did break my comment list, so I modified the CSS and added an extra line to make the comment appear normally and not break the style. word-wrap: break-word; While approving the comments from the admin, I've noticed that the long "no-break word" have appeared weird on the admin side as well. After modifying the class CommentText to: .CommentItem .CommentContent .CommentText { cursor: pointer; padding-right: 1em; word-wrap: break-word;} It all started appearing properly and the long word got broken to several lines instead of going off the screen. I am attaching a few screenshots to demonstrate the issue. The path to the css is: .../wire/modules/Process/ProcessCommentsManager/ProcessCommentsManager.css (line 103) If it really not appear only with my local environment, until it is fixed, the class might need to be added to the css upon every update as far as the FieldType Comments is part of the core now.
  10. Oh, I will have to check that. Thanks for pointing it out.
  11. Hey all. With the kind assistance of @fbg13 the comment depth functionality was achieved by modifying the CommentList.php and the standard comment rendering. I've added some extra comments to the file so that it is easier to understand and modify. I've noticed that having depth replies has some confusing part where even set to 1, any replies to the parent are still having indent applied to the right. So after having 20-30 replies, the markup would start looking weird: Due to this fact, it could become a bit confusing for users which comment is a reply to what... I will try to set some limits of the indent applied as per @fbg13 suggested modifications and see if that would fit the purpose nicely. At this stage, I would say that the earlier shared function code is looking better in regards to the comments alignment (sort of facebook style) however I should find a way to render the votes in the function. Whichever comes first, I will use it and share the code, but so far we are moving forward... ? Also I need to find a way to allow the users ONLY to UPVOTE or Downvote but not both actions at the same time before the popup message appear stating that the vote has been already placed. My guess is that it should be located in the FieldtypeComments.module where the popup text is, but I have not yet managed to find the way. CommentList.php
  12. Oh boy, I got you confused haven't I? All I am trying to achieve is to have the proper markup for comments rendered. Maybe it would be easier to have a copy of FieldType Comments to my /site/modules and have the markup modifications. I know doing so would make it work properly for all the needs, but so far I got some issues with the depth. Trying to analyze the original markup generated after the comments rendering and mine in order to apply the styles, but as it appears, the default generated markup has a <ul> wrapper where mine does not and besides that every comment is a <li> where in my markup is again <div>. I will post my code of CommentList.php and maybe that would solve most of the issues and have us going... In regards to the reload of the page, you are right, I meant to RELOAD but not to refresh. The total count of the comment votes I guess is saved prior to adding to the page because if I vote for a comment and try to login as someone else a minute later, I see all the total votes that has been added (up/down). I am not yet quite sure how does the module render exactly the comments but it feels like every time someone votes, the page is saved and the upvotes/downvotes counter is modified while only the numbers of the counter change dynamically without a page RELOAD.
  13. OK, so step by step and gradually will go and answer the questions. 1. Do you want Abdi to see the latest (including his) count of up votes to Susan's comment? The same for Mary-Lou. Do you want her to see the latest total of down votes to Singh's comment? - YES (anyone see the up/down votes) 2. When Abdi and Mary-Lou vote, do you wish their votes to be saved to the server immediately? - The default votes shown during the comment rendering are totally fine for me. Abdi and Mary-Lou click on up/down vote and they see their vote added to the total count without a need to refresh the page. In regards to the java script votes limitting - I am not sure if it is a java script or else, but I visit my demo page while I am not logged on as any user (guest) and I am able to rate any of the comments only once before I get the popup message saying: You have already voted for this comment. Presently, the popup is shown if I try to submit a vote for a second time, but it still allows me to press the up and down buttons once before I see the popup. It would make more sense, to click on any of the two buttons (Up/Down vote) and after that to see the popup.
  14. Well, in your example, if Abdi visits the site and decides to vote for Susan, he can ONLY like or dislike her comment. Same applies for any other user. Technically it does not make much sense if I like your comment and don't like it at the same time (which in default functionality is allowed before I get the message that I've already voted). {votes} is used in the commentHeader to show the votes in CommentList.php line 165: if(strpos($out, '{votes}') !== false) { $out = str_replace('{votes}', $this->renderVotes($comment), $out); } That is what I was trying to understand how to achieve... Also, I am planing to allow everyone to share a comment no matter whether they are registered or not and also to see the votes of every comment. So I guess I will have to check the java script which is not allowing a person to vote more than once per session and to modify it to not allow the same user to give a positive and negative response at the same session. In other words a visitor would ONLY be able to appreciate a comment by liking it or not appreciate by dis-liking it (up/down vote). If I use the standard rendering method: I can show the votes (↑1 ↓0) and they are rendered properly, but I had some difficulty applying the markup and also once the depth is reached, the reply button dissappears...
  15. Hey kongondo, that is clear that I can use $comment->downvotes or upvotes,) however that returns the values of up/down votes. If I go that way, I will be forced to use use ajax to refresh the values etc. Isnt there a simpler way to call {votes} in the custom output? Or that is why it is called custom, as I have to figure out the up/down votes using some custom code? I've already figured out how to implement the up/down vote showing as well as the increment, however I had the refresh issue for which you suggested to use Ajax. That is why I was hoping that there will be a simpler way to call: $this->renderVotes($comment), $out); which would show both up/down values and an arrow up/down to change the values. Also, I've tested the ProcessWire voting system and it allows both - up/down votes for a single session. Would you know how I can only allow one to be selected?
  16. Well sorry, it appeared more like a documentation versus the question. So yes, there is still a question - how to render in the function the votes If I manage to render the votes, I won't have to deal with Ajax calls as the function is working fine during the rendering, but how to render those - that is the question of the day ?
  17. No worries, I already posted almost the complete solution to the other topic.
  18. I was working this morning on the depth and I believe I achieved exactly what is needed. As per my markup and needs, ideally I would have the reply button to appear on every comment (even when the depth is reached) which would make a visitor/user reply easier unless they want to post a new comment from the form above/bellow. In regards to the rating, I used a function from the module itself to render the result: $stars = $comment->renderStars() I tried to use something similar on the votes using: $votes = $comment->renderVotes(); however that lead to an error: Method Comment::renderVotes does not exist or is not callable in this context. Would someone know a way to render the votes? To achieve the needed functionality of the depth and markup, I used some code from @fbg13 in this topic . Here is my initial markup: and here is the function code I added to my _func.php: So only the voting is left before I move to style the comment form. P.S. Added a screenshot for the comments appearance and here is how to render the comments in the template: echo getComments($page->_your_comment_field_here_, $page);
  19. Hey there mighty fellas. After a bit of a struggle with editing the comments module, I decided to simplify the things for myself (at least that's what I thought ? ) and use the alternative method suggested by @ryan in the first post of this topic - generating my own output. So I had the markup I wanted to implement in the comments and I almost achieved it, but there are a few things that I can't get my head around: 1. The votes count is working, but is not automatically refreshing so the page has to be reloaded in order to see the numbers 2. The votes allow a user to vote UP and Down at the same time which in my scenario does not make much sense as you either like a comment or don't. 3. How to implement the comment depth. Here is the markup I have so far:
  20. Hey @kongondo Thanks for the shared Dashboard Notes. I will review the code and see if I could implement it in my profile. I did had asked the question about the custom comment list in the FieldType Comment thread but also opened another topic in regards to the voting UP/Down. All I am trying to achieve is to learn how to build a custom markup implement any custom comment markup in any profile.
  21. Hello all. The job offer is withdrawn. I have no power to change the topic so just letting everyone know that I will try to find a way to do it myself or move on with the not nested/threaded comments. Thanks to everyone quoting for the work but it is way beyond my budget to afford it. Best regards and happy coding.
  22. Hey all, I am building a profile and would need someone to assist in implementing a custom markup for comments list and form. What is needed: 1. Nested/Threaded comments with indent as per the original style. The reply button should appear even if the depth limit is reached but the comments would align to the last indent. 2. Votes - it is needed to allow only positive or negative votes per person per session (presently I can click on like and dislike at the same time and it does not fit the purpose) 3. Rating - to be showing on the comments listing as per the rating added during the comment submission. 4. Comment form to be styled as per the markup including a honeypot and akismet. I do not have a big budget as this is a personal idea-project, but we could discuss it if anybody is interested.
  23. Just on time for my learning curve about markup regions and so forth. Thanks for sharing your work ?
  24. Hey @tpr I am super happy to confirm that adding the style to aos.min.css fixed the issue and now my Admin tree is back to its normal state ? I guess we will see a new AOS release some time soon with the fix ? Thank you sincerely!
  25. @tpr Nope, I am on Windows as I've mentioned it earlier (Server 2016 & Windows 10 latest upgrades) but testing it on Linux did the same. I can test it on Mac as well but am not sure that would fix it prior to the fact that @adrian already had the issue on his one. a
×
×
  • Create New...