WordPress.org

Ready to get started?Download WordPress

Forums

How to change post timestamps to match their most recent comments in P2 theme? (11 posts)

  1. yokima
    Member
    Posted 5 years ago #

    You know how on bbPress, a reply will bump the thread back to the top of the forum? How can I implement that in WordPress?

    I'm trying to tweak WordPress to make it function as a Customer Support Ticket Request System. So far I've tied together the P2 theme, integrated with gTalk & SMS over ping.fm, and I'm missing this forum thread-like behavior.

    I've tried a number of OTRS software, and they all assume that each ticket is atomized, that is, one customer should only know about their own ticket. Each ticket is atomized. I work in a small nonprofit and I want all customers to see each others' ticket, in the most open way possible - that way, I avoid repeat Q&A's when a company-wide situation arises, and also want each customer to know how many and what kind of tickets are sitting in the queue before them, so that they may have an idea of what to expect. I also want the tickets to become immediately searchable and build into a KB navigable via a tag cloud.

    One last thing (besides digging into P2 to add author change and tag change fields into the front-end AJAX editing) is the ability to bring posts with comments to the top. I think it could be accomplished by one of two ways:
    1) tweak the loop so that if there is a comment or more in the post, then pick the most recent comment, and assign the comment's timestamp value to the post, and then sort by that variable. (This sounds hard to implement and unnecessarily convoluted)
    2) change the commenting function so that it also modifies the post's timestamp to match the comment's timestamp.

    So I'm trying to implement #2.

    Any thoughts? I'm not even sure which file to start digging in the first place - especially since P2 is so heavily modded. The initial setup is at http://krcla.org/support/ although as you can see there's nothing special on the front end - although posts were made via cell phone.

  2. Nobble
    Member
    Posted 5 years ago #

    Well thanks, now I want to be able to do this as well:)

    Option 1 sounds better to me actually. I'd rather have an extra sortable field that gets automatically updated when ever someone posts a reply/commnent. I might give that a go later this week.

    I was looking at your site yokima, how did you manage having people reply/comment by email?

  3. Nobble
    Member
    Posted 5 years ago #

    If you go the custom field route, the following topic will help figuring out how to sort the fields.
    http://wordpress.org/support/topic/203210?replies=14

  4. Jacob Gillespie
    Member
    Posted 5 years ago #

    I'm looking for this feature as well. Did you have any luck with either method?

  5. yokima
    Member
    Posted 4 years ago #

    @nobble: ah that test was not replying by email - it was testing where the new comment notification email was going to be sent

    @jacobwg: nope, haven't even started

  6. monodistortion
    Member
    Posted 4 years ago #

    That's an interesting idea and #2 sounds more feasible to me. I haven't looked into how you would do it at all yet, but it sounds like you may be able to make an independent plugin to do this. It just depends on if the right functions have actions or filters you can use.

    You probably need to ask a few more questions before starting though. Which comments will update the post date? Are comments moderated for spam? Will they trigger a date change before or after moderation? What happens to a post date if you delete the most recent comment?

  7. erikbeam
    Member
    Posted 4 years ago #

    I found this link: http://stackoverflow.com/questions/698438/ordering-wordpress-posts-by-most-recent-comment

    but it seems a little complicated for me, as well as P2's theme being different enough from the default that I couldn't follow it well, but it looks like it's on the right track.

    Then I searched for a plug-in and found "Sort by Comment," which was designed for the Prologue theme (P2's predecessor I believe).

    I literally just did this 5 minutes ago so I haven't fully tested it, but it appears to do at least most of what you are asking, that is putting the most recently replied to ticket on top. As far as I can tell, though, this feature does require a manual refresh. It won't dynamically reorder the posts on the main page as comments come in.

    You can see what I've got here: http://www.askmeabout.us

    edit: sorry for the links, but when I tagged them they disappeared (???)

  8. yokima
    Member
    Posted 4 years ago #

    erikbeam: that's amazing. would you share the modified plugin? i would so use it right away.

    monodistortion: i think people using it would be satisfied with 1) akismet would be good enough filtering out spam, so apply the hook after any anti-spam plugins have taken action. manual moderation would be irrelevant. 2) the post could just stay with the same timestamp after a comment was deleted, which would be a minor glitch that I wouldn't mind withstanding.

  9. erikbeam
    Member
    Posted 4 years ago #

    @yokima: I didn't modify the plug-in. It just worked for me. I suppose whatever the plug-in relies on wasn't changed between Prologue and P2. Of course, if something ever changes down to road to make it incompatible I'll be in trouble...

  10. yokima
    Member
    Posted 4 years ago #

    @erickbeam: where is the plugin? I can't find anything at http://www.google.com/search?q=%22Sort+by+Comment%22+prologue+plugin

  11. yokima
    Member
    Posted 4 years ago #

Topic Closed

This topic has been closed to new replies.

About this Topic