Jump to content

kongondo

PW-Moderators
  • Posts

    7,476
  • Joined

  • Last visited

  • Days Won

    144

Everything posted by kongondo

  1. The error is happening because a Comment object does not have a such a method. If you look at the file CommentList.php, you will see it has a method renderVotes() as well as a renderStars(). Both are passed one argument/parameter, a Comment object. The two methods just implement some string cleanup and html output. The most important thing for you is the number of votes, down and up. You get this using: $comment->downvotes; for down votes $comment->upvotes; for up votes You can wrap those around whatever element you want, e.g. "<span class='down_votes'>{$comment->downvotes}</span>"; "<span class='up_votes'>{$comment->upvotes}</span>"; Then style those as you wish using CSS.
  2. Was there a question in there? ?. Or maybe you are just documenting progress? If not, what is pending?
  3. Quoting from your recent questions in the other thread: 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. #1. Refresh: If you need anything to be automatically refreshed without loading a page, you need to use Ajax. I know of no other technology. Simple steps: On click votes count, capture that event using Ajax (JavaScript) Send the Ajax post (or get) to the specified URL, most likely the current page, so "./" Server-side, the template file that the current page uses checks if an Ajax call has been made, i.e. if($config->ajax) {capture and sanitize form inputs, send response back, usually as JSON) Client-side, the code you used to send your Ajax post is waiting for an answer from the server in a particular format. If that response comes through... Find the inputs on the page you need to refresh and refresh them. Example $config->ajax is here: #2: Up/Down Votes: How do you want to control this? Do you want to stop it client-side or both client-side and server-side? If server-side as well, how are you distinguishing users? Are you requiring users to log in before voting? If client side, you can use JavaScript to enable the HTML elements act like a toggle switch. If voting is mission critical to your system, you cannot rely on client-side prevention alone, hence the server-side checks. Server-side, if you are relying on IP only, that doesn't work always as some users could have dynamic or share IPs. Are you using email and registered users? 3#. Comment Depth: I already answered this question. I pointed you to the code in Dashboard Notes. If you want nested replies/comments, then you need to use a recursive function. If you want to limit output (in your case depth), you will need to use some sort of counter, in this case a count-down counter works well. Both of these are in the code I referred you to in Dashboard Notes. Did you have a look? How did it work for you? What went wrong? Etc...?
  4. Please, no need to double post. You've already started a topic here: I know there are no answers there but I've directed you to some code that can help you implement comment depth. Please let's use your other thread. I'll make a few comments there.
  5. Thanks for sharing your experience! I was on Solus. Please see my thread about that here. I still have it running on a not-so-powerful touch device that came with Win 10. For this touch device, I have subsequently looked around for lighter distros and ended up with Kubuntu and Puppy. I'm yet to replace Solus on the device as I've not been able to make the device boot from the USB! This is off topic but a real puzzler. To install Solus, I booted from a USB stick. Now, to replace it, the computer is refusing to boot from USB! Sigh... I really loved Windows XP. I could go back if they let me :-). I like Windows 7 a lot. Anything above that, meh! I tried Win 10 once and rolled back. I'll hold on as long as I can to Win 7. True, and I have sought help here and elsewhere. What I don't have unfortunately is a lot of time to try out things and hope they work. Sure, Windows has its quirks (duh! :-)), but they are quirks I know how to deal with and have learnt to live with. Solus worked mostly fine (to my delightful surprise) until it didn't. I read all the docs! Some of the best docs I've seen, btw. He/she has done a great job. I'm quite happy with WampServer though, so I don't think I am going back to docker, or anything else for that matter.
  6. Have you asked your questions in the forums to see if you can get help there? I'm not sure what you mean, so I could be off base here. Have you seen Dashboard Notes? I'm using a custom comments render and the comments/replies are indented. If you have a topic, let's take this discussion there.
  7. Hi Karinne, A bit more information perhaps ? ? PW version? Export type (zip or JSON)? How large is the export/import? Have you tried without exporting/importing Multiplier fields?
  8. It does, thanks! An easy finder like page title in 'my language' is what I was after. I'd also want this for page reference fields, pointing to the found pages titles. I'll check the docs. Cheers.
  9. I have a feeling this could (in future) perhaps play nicely with @bernhard's RockFinder?
  10. Hi @bernhard, I've not had a chance to test this yet. Quick question, in multilingual setups, is it language aware? If not, can it be made to be language aware? Many thanks for all the hard work!
  11. Although I don't know what your reasons for using var_dump(), I really recommend that you use the module TracyDebugger instead. It will give you better and cleaner information regarding any ProcessWire objects and their properties.
  12. Cross-posting my Vega Visualisation module (very early WIP) that I mentioned above.
  13. I recently mentioned that I was working (more like messing about quickly :-)) on a Visualisation module based on the awesome chart lib Vega. I haven't touched this module in a while. I only realised today as I was transferring my dev setup to WampServer and testing things out that I'd left this off at a stage where one could view a basic Viz. See the screenshots below. Word of warning: this does not even qualify as pre-alpha in my opinion. It is very early days. It is more of a playground to test ideas. It's also not high in my list of priorities so I don't know when it will be ready... Screenshots Create new viz from list of pre-built visualisations/charts Editing a single visualisation/chart
  14. Success!!! And no, not with Laragon. Laragon I tried all tricks and trips, I shut down antivirus prog, etc, nothing. It was still slow for me and MySQL 5.1 only Devilbox Once I set up SSL, that was the end of being able to log in. For some reason, the TOKEN set on the login page was always different from the one stored server-side that sessionCSRF compared with. Maybe a PHP thing? And so, it was back to Google. I almost bought Mamp Pro but decided to check on an old friend, WAMP, now WampServer. WampServer Wow! A lot has changed since I last used WAMP! It looks sleek and packs a mean punch. It has lots of settings hidden away neatly in its menus. You can change PHP ini settings (stuff like memory, etc) right from within the menu. One is not restricted to one www folder. Each project can have its own folder anywhere on your system. The mysql/data directory can also point to whatever location you want (I know one can do this in Laragon as well). Installing ProcessWire was a breeze as usual. Back- and frontend page load speeds? Using the Blank Profile: 130 - 200ms!!! I haven't tried SSL yet and I am not in a hurry to do this Thanks all!
  15. How old is that installation? Brand new. Is your account an Administrator or user account? Admin. Are there background update processes (downloading, clean up) running? Nope. Does Windows built its file index right now? Not that I am aware of. How about disk read/write performance in task manager? Is that higher than expected? I haven't noticed. Where is your Laragon folder located? C:\laragon for example? Other internal non-SSD drive; But it used to work OK before I moved to linux and back. Is that folder set to "compress" or how it is called to save disk space? Nope. I have enough storage; I don't use compression. Is Windows Defender or any other AntiVirus slowing down file access due to real-time-file-monitoring? I was suspecting this as well, but will confirm. Can you disable AV and test performance? I will and report back. Are there IIS/database services running and listening on the same ports? No. Does it make any difference if you enable/disable laragon autostart? No. Does it make any difference if you disconnect from the internet? I haven't tried but I can't imagine why. Is there a difference if you run Laragon as Administrator? I haven't tried. Are there other host entries or tools like XAMP interfere? I am not using other tools. Do you use another domain ending than .test? Yes. I'll try test. Do you use or are you running a VPN? I don't use VPN.
  16. What's wrong with Windows 7 ??.
  17. Unrelated to laragon, but after switching to HTTPS, PW is throwing the dreaded 'appears to be forged'!! I cannot log into admin. None of the usual remedies (permissions, session fingerprint, etc) are helping. I'm so tired!!!!!!!!!!!!.
  18. No combination of Apache/MySQL worked other than 2.4.xx and 5.1! I gave up and set up Devilbox instead (a bit of a pain to set up in Windows 7) but it is up and running. The speeds are still not great, coming it at about 800ms but at least better than the 1300 I was getting with Laragon. For now, I'll just stick to this and later Google if it's possible to speed up Docker a little bit. It could be the DNS.
  19. I'm talking a brand new ProcessWire blank profile install with only one module (not auto load). Nothing in ready. It is slow in both the back- and front-end. I read something about compatibility but I've not found a list. Funny thing is that even Laragon's own quick add mysql 5.7 (version is 5.7.24) doesn't work. The Apache that shipped with Laragon is VC14. Let try that with MySQL 5.7.19. The other thing that was happening was that I wasn't able to install modules using the Module Class Name interface but that seemed to have resolved itself. Thanks. I have an Win7 64-bit i7-6700k, 32GB RAM, SSD machine. The laragon is the latest full one, laragon mint. Changing PHP versions has not improved the issue. I'll get this version (.19) of MySQL since it is working for both you and Robin and report back. If it is still slow then I'll try docker using Devilbox. Thanks all!
  20. Hi all, Yes, it's me, the chief whinger and moaner ?. You are probably aware that my fling with Linux came to an abrupt (and permanent) stop. I've gone back to my first love Windows. I am using Laragon for my dev needs. For some reason, I am finding it a bit slow....or maybe it's just me? On local dev, Tracy is recording execution time of 1300ms. Visually, page loads seem even slower. Is it just me? I think Laragon used to be faster than this for me? Maybe because I'm coming back from Linux and the page loads seemed to be faster? (that was a docker box). Google and the Laragon forums haven't helped much, mainly telling me to switch to Nginx, others blaming MySQL, etc. Xdebug is not enabled and it is not Tracy slowing things down. Which brings me to my second point. In Laragon I'm stuck with MySQL 5.1. If I switch to 5.7 I get internal server errors. Anyone has any ideas (apart from I need to get more sleep, etc...?). Thanks!
  21. Or a corrupted install? It hasn't been able to Go To Definition of functions/methods, etc. Let me try now that I am on a 'brand new' machine.
  22. Thanks. I've had this all along but it just won't pick it up. Intellisense picks it up fine. I'll try again, thanks.
  23. Mainly directed at @bernhard... Could you please let me know how you got intelephense to work with .module files? I'd like to switch to it from PHP intellisense but I can't get it to work. It will only do .php files. Thanks.
×
×
  • Create New...