Pete

Administrators
  • Content Count

    3,777
  • Joined

  • Last visited

  • Days Won

    52

Pete last won the day on September 10 2017

Pete had the most liked content!

Community Reputation

3,494 Excellent

1 Follower

About Pete

  • Rank
    Forum Admin
  • Birthday October 4

Profile Information

  • Gender
    Male
  • Location
    Buckley, Wales

Recent Profile Visitors

36,386 profile views
  1. There might be a way to workaround this though. What I really don't want to do is write a plugin for the forum software since they change stuff so often and I've seen plugin module developers over there get ticked off as they don't get any warning when core functionality changes or is removed. What I could potentially do is add a button that only the topic starter and moderators can see (easy enough logic in the templates - survives upgrades usually too which is something you have to worry about with this software) that then sends an AJAX request to a standalone script with a standalone table that stores "useful answer" information. It should then technically be possible to check that table using as little forum-related code as possible. It needs some looking into, but the question I asked here needs some debate first I think: Again, still not making any promises. I find that when I make promises sometimes years go by without me actually doing what I said I'd do The rare exception being the Dev Directory actually happening
  2. Ugh... spoke too soon. I thought the software stored the "best answer" in a separate table maybe but it's a field in the topic table, so you can only set one post ID per topic and not multiple
  3. I've found a module that looks like it lets you set a "best answer" on a normal discussion topic, so as not to break the discussion flow. I've asked the author if he thinks it's technically possible to change the code to mark more than one answer as "best" and am awaiting his answer. But the question I have is this: how should the best answer/answers even be displayed? When we used Q&A forums in the past people didn't like the fact that the best answer appeared right at the top and removed it from its original position in the topic, so should it be that the best answer appears right below the first post (the question) as well as where it originally was in the thread, highlighted in both cases? I think that makes the most sense and if we can get it to work for multiple answers then that's even better. I don't mind leaving it that only moderators and the original poster select the best answers - I think there are enough moderators here to flag the best content without implementing voting buttons. I'm not suggesting voting buttons are wrong, but there's no easy way to use them to automatically turn a reply into a best answer without a lot of custom code - and Iike I say the forum code is very confusing! Anyway, no promises on any of this.
  4. Thanks, I just tried it out on my local dev copy and they've not improved on any of the flaws. You still can't set more than one answer as the best You can't reply to answers (like StackExchange does) so there can be no discussion as upvotes/downvotes break the flow You can't mix and match QA topics and normal topics in the same forum (less of an issue for a Getting Support forum) Any of the sorting (by date or votes) is per-member and not set in the admin So the big problem is it breaks the discussion flow completely still. I'll have a poke around and see if there are any third-party modules that might do what we want because this is still very incomplete in terms of features unfortunately.
  5. We can change as many forums as you like to Q&A forums but yes there were issues with it. Here's where someone hits the nail on the head when requesting the forum devs make it more like StackExchange: https://invisioncommunity.com/forums/topic/438364-qa-forum-types-add-comment-feature-please/ So SE lets you comment on the chosen answer. The forum software pulls the chosen answer out of the topic flow (from memory) and the upvoting/downvoting means you can't have a meaningful conversation in a Q&A topic. I will have a look on a local copy to see if they've updated the functionality since we last looked used it but I honestly wouldn't count on it - they seem to spend more time on implementing cross-device support for emojis than improving some useful features (okay so that's a bit harsh, but they do seem to have a weird priority to their feature rollouts).
  6. You want an updated video? But I remember it when it was nearly new! *checks video date, feels old* I had a similar experience to others - I was looking for a CMS that could meet my non-standard requirements - I remember seeing the site and some of the docs back then and being confused. Fortunately I came back to it a few weeks later and finally watched the video and that sold it to me instantly.
  7. Pete

    It might actually be useful to do session_start actually since it doesn't matter that the forum software then wipes it out as it'll get wiped out in turn by PW's session again later on. I shall have a play.
  8. Pete

    Oooh, follow-up question - how would I go about accessing a variable stored in PW's session at this stage: $this->addHookBefore("Session::init", function(HookEvent $event) { I'm guessing there's a way to temporarily get the session data at that point maybe? Just thought of a scenario where I'd need to grab a variable from PW's session and check it before running the external script (so I don't always need to keep running the script if I already have the data in the PW session - seems wasteful to load a bunch of external classes every time).
  9. Pete

    Thanks, changing it to this worked: $this->wire('files')->compileInclude(wire('config')->paths->root . 'talk/init.php', array('includes'=>true,'namespace'=>true,'modules'=>true,'skipIfNamespace'=>true)); I guess it was a different combination of options else it wanted them to be named (likely the latter now I look at it more closely). Got there in the end - thanks guys! P.S. you've just both helped me do a better forum member integration for the new PW website by the way Making two very different scripts play nice was NOT easy!
  10. Pete

    I actually thought I was onto a winner with this little gem: $this->wire('files')->compileInclude(wire('config')->paths->root . 'talk/init.php', [false, false, false, true]); See notes here: https://processwire.com/api/ref/wirefiletools/compile-include/ I thought that would work as the included file DOES have a namespace at the top, though not a PW one, and the last option should have skipped it You beat me to it by seconds, but alas it doesn't seem to be doing the job.
  11. Pete

    Thanks, this seems to work great! Now if only I could get FileCompiler to stop compiling the externally-included application files I'd be onto a winner (wasn't expecting it to go crazy and it breaks on a crucial file!). Seems the only way to stop that is to add // FileCompiler=0 to the top of the relevant external script page, but that isn't upgrade-proof for the external script. It would be great if there was a way to tell file compiler to leave that whole directory alone.
  12. Pete

    I've got my dunce hat on today - how would I put something in a variable before init that I could then access after init? It's been a long time since I did anything like that but it sounds like a good option Maybe if wire() is available before I could to wire()->test = 'something' and access that later? I just can't envision the code in my head to write it.
  13. Hi folks I need to grab some data from a separate script before PW's session kicks in to avoid sessions wiping each other out in the wrong order. I see you can hook before session::init, and in the PW wire/core/Session.php class there's a $data array it looks like you can populate around line 267 @session_start(); if(!empty($this->data)) { foreach($this->data as $key => $value) $this->set($key, $value); } but I can't for the life of me work out how to populate that data array so that something like $data = array('test' => 'this is a test') gets passed to the session as $session->test Anyone got any ideas? I think I'm looking along the right lines on this one - hook before session::init, do the dirty bit of getting data from the other script, store it in the $data array and let PW's session wipe out the other one. Otherwise the other script wipes out PW's session instead and whilst PW can still remember lots of stuff like what page it's on, the loss of PW's session causes problems when dealing with currently-logged-in user etc. Because of these conflicting sessions between two separate scripts that I can't work around any other way, my only other option is to call file_get_contents on a local url which totally works but seems wasteful if I can do something like what I'm trying to above instead. Any help would be greatly appreciated!
  14. Thanks to all who got in touch. I have found a developer to take this one on now.