Jump to content

netcarver

PW-Moderators
  • Posts

    1,960
  • Joined

  • Last visited

  • Days Won

    42

Everything posted by netcarver

  1. Is your website built using ProcessWire?
  2. You're misquoting me, @bernhard :) Could you try this... <script> var evtSource = new EventSource("sse.php") evtSource.addEventListener('ping', function(event) { var data = JSON.parse(event.data) console.log(data) }, false) </script>
  3. Hi @3fingers Right, so the demo video I posted did this using a few separate parts. An event generator wrote messages into a Redis pubsub channel, and I had a long-running ReactPHP process subscribed to the channel which would then take those events from Redis and send them via SSE to any connected listeners. A little custom JS in the website's home page would connect via SSE to the server and would be asynchronously invoked when an SSE message came in. The JS was really simple, it parsed the incoming SSE message to grab an html id and the new content for that part of the DOM and then do the change (along with a little CSS styling to highlight the swap.) The most difficult part was running the ReactPHP process. In your case, you could replace the back end event generator with a hook and just publish a change when the PW admin control is changed. Anyone connected would then have their screen updated immediately. PM me if you want to discuss directly.
  4. @ryan As a possible alternative to having something polling for changes, have you considered some kind of server side push technology for signalling changes to the connected browsers as mentioned above by @Ivan Gretsky? I've been playing with using a thin ReactPHP layer that sends DOM mutation messages to clients using SSE (which has really good support in browsers) and have about 20 lines of vanilla JS in the browser that does the element replace in the DOM when it gets a message over SSE (though htmx could be used for this too). None of the connections in the video are polling. nifty-reactivedash-demo.mp4
  5. Anyone seeing issues with the generated thumbnail for vimeo-based embedded videos? Currently just getting a stripy image back from vimeo no matter what video is embedded. Pressing play works - the video is streamed and played without issue, it's just the thumbnail from vimeo that's the problem. Looks like this...
  6. Have been using porkbun.com for years. Just for registrations; my DNS and hosting is elsewhere. Porkbun cover .uk, .org.uk and .co.uk domains as well as all the usual suspects.
  7. Nice, thank you Robin. Seems to work well.
  8. @jds43 That would probably be indicative of your server side code running more than just your ajax section. It's probably not what you are outputting in the rendered htmx you just posted. In the example kongondo posted above, the ajax route ends by calling $this->halt() to finish off PWs processing after echoing out the html. Is your code doing this? NB it is only possible to use halt() in some situations (like template files, IIRC) so you'll need to do that or just call exit(); if in a different context.
  9. Any difference in PHP versions between these two setups?
  10. This requires a more recent version of PW than 3.0.165 - I'm currently using 3.0.182.
  11. Please do. And thank-you for what you've already shared. I just started using this today and it's looking good so far.
  12. Ok, like @rick said, please try to use the absolute path if possible. If that doesn't work I'd then want to check that the u9...9 user actually has access to PW's files. If that user is not the same user as the HTTP server user (like apache) then sometimes this can be an issue.
  13. Ok, so there are no errors in the apache/PHP Logs but what about in PWs log Error/Exception logs?
  14. @Manaus Take a look at Lakeland Trails from @Pete at Nifty Solutions. Almost 52 thousand users. Might be worth pinging him to ask more about the actual pros/cons of doing it that way.
  15. Hi @horst, thanks for the reply, but unfortunately not. I have found a work-around that I can use for now by hooking the login register pro login-form processing which happens before the session::login hook gets called, and removing it there does work.
  16. Hello wonderful PW-philes, I have a situation where I'd like to prevent system notifications from being stored when a self-registered user logs in or out (or fails to log in.) These events just clutter up the systemUser's notification list so I thought I'd add a hook early in the hook chain that works out if it's a self-registered user logging in and then just remove the System Notification module's hook by using removeHook(). Sure enough, I can find the target hook in the hooks returned by the system - and seemingly remove it from the hooks array - but the hook is still executed no matter how I call removeHook(). Here's the things I've tried in my hi-priority session::login hook that don't work... $id = $this->findSystemNotificationLoginHook(); $event->removeHook($id); $this->removeHook($id); parent::removeHook($id); $this->session->removeHook($id); wire()->session->removeHook($id); I've also tried targetting the actual instance by attaching to wire()->session->addHookAfter('login'...) as well - and tried doing addHookBefore(). I'm guessing that it's actually too late to remove the hook when I make the call as the hook array associated with this event is already being processed by PW and it's working its way through a local copy of the event's hooks. Does anyone have a way of removing a later hook from an event-in-progress? I can't just cancel the event as there may be other, lower priority hooks on the session::login event that I'm targetting.
  17. Never used it, but I know some folks use Wistia to host video content.
  18. Ok, so I can find the sha's of the commits via the history of the ProcessWire.php page on GH here - but I still think it would be nice to be able to reference by tag in git :)
  19. @ryan Just wanted to track down an issue I'm having with PW and a module that's in the works. The module works fine on PW v3.0.181 but not on 3.0.165 so I wanted to go back through the tags on github, bisecting the tag space till I nailed down the minimum version I need to declare in my module. However, the list of tags seems to be very sparse on GH compared to the versions as notified in your blog posts. Could you be persuaded to add a git tag when you bump the version in wire/core/ProcessWire.php file and to push the tags to GH as well? This would make it really easy to install any given version by tag from git/github and allow an easier match with the information published in the blog as well. As always, thanks and best wishes.
  20. I think you should be able to move the offending module directory/file out of the site/modules folder into a temporary directory. That might restore your site's operation enough to go into the admin interface where you can clean things up if you need to.
  21. Just bumped this to version 0.5.0 which adds the ability to have a sandbox server token that gets used if the site is in debug mode.
  22. I think Roland's excellent Admin on Steroids module can help you. There is an option to display the template of pages along with the options button in the tree menu. Look for this option and turn it on; Then you should be shown the template as you hover over the items in the page tree. Here's the correct template (client_index) being shown for a page on my local site; Hope that helps!
×
×
  • Create New...