Jump to content

Grant users ability to edit individual posts indefinitely.


AtariAge

Recommended Posts

I have a forum running IP.Board 3.4.x.  As I've had problems with users abusing the edit feature in the past (rage quitting and editing away thousands of posts, attacking other users in posts then editing the post before mods see it, etc.), so I've had to limit editing to a short period of time after the post has been made.  However, it is useful for people to be able to edit the first post in a thread in many circumstances, and it's useful in some forums to allow editing of all posts, but only in those specific forums.  For instance, in Marketplace-related forums it's very useful for the topic author to be able to edit their initial post as they sell things or add new items to sell.  We also have many programming forums where it's advantageous for the topic start (and others) to edit their posts in the thread. 

What I've done with 3.4.x is added "AllowEditing" fields to the posts and forums tables, and then modified code to expose the Edit button when those fields are non-zero.  I never created an interface for this, so I just update the tables manually when I get a request from someone who needs to edit their post (and when I add new forums I will update the forums table manually).  

I'm running another forum on 4.3.5, and I'd like to make these same modifications.  However, I'd like to do it properly through hooks or other means, and also add support to the front-end and ACP so moderators and myself can grant these permissions.  And I'll want to use these changes on my 3.4.x forum once I get it migrated. 

I have not yet done any development work for 4.3.5, so I'd appreciate any pointers to get me started.  I figured this would be a good way to get my feet wet, and I have other mods I've done to the source that I also want to move over to 4.x, but doing so properly instead of just modifying the code directly. 

Thanks!

 ..Al

Link to comment
Share on other sites

Developer documentation: https://invisioncommunity.com/developers

You will probably want to use a plugin (rather than an application) for this, so start here: 

To do this properly, my general thoughts would be...

  • Don't edit the forums_posts or forums_topics database tables. Instead, add a new database table to track posts that a user can edit indefinitely. It can have a unique ID/primary key, the post ID, and the author ID at a minimum (you could add more columns if you want, such as a "reason" or a date that permission was granted, that's all up to you).
  • Make sure to add a MemberSync extension so that when users are merged or deleted (onMerge and onDelete) you update this new table as appropriate.
  • Add code hooks to override the delete() method in \IPS\Content\Comment to remove rows from this table if a post is deleted.
  • I would probably then add a ModCpMemberManagement extension to give you a new member management area in the ModCP. Use the table helper and form helper classes to let you add/edit/remove user-post mappings.

 

Hopefully this is enough to help point you in the right direction but let us know if you have any specific questions.

 

Link to comment
Share on other sites

Hello! Thanks for the link to the developer documentation on Plugins.  Just read all of that briefly, but will look at it more carefully once I embark on this task.  I also appreciate your additional comments beyond that, all very helpful! 

Thanks again and I plan on sharing this once I complete it.  

Link to comment
Share on other sites

  • 3 months later...

@AtariAge - Did you ever start working on this? We have exactly the same requirement for exactly the same reason. First post-editing enabled in only certain forums is highly desired. Not only in Marketplace-like forums, but also in forums that track the development and evolution of certain projects. In that case, the first post can be used to highlight the current state of the project, while the rest of the thread tracks its history from start to finish.

By the way, in 3.8.x, we modified the code some to provide this capability for certain classes of users. It was implemented by another developer-type and I would re-implement it whenever we did minor upgrades. If you'd like to see that approach, I'd be happy to send it to you if it leads to a possible plug-in.

 

Link to comment
Share on other sites

3 hours ago, WAMAS said:

@AtariAge - Did you ever start working on this? We have exactly the same requirement for exactly the same reason. First post-editing enabled in only certain forums is highly desired. Not only in Marketplace-like forums, but also in forums that track the development and evolution of certain projects. In that case, the first post can be used to highlight the current state of the project, while the rest of the thread tracks its history from start to finish.

By the way, in 3.8.x, we modified the code some to provide this capability for certain classes of users. It was implemented by another developer-type and I would re-implement it whenever we did minor upgrades. If you'd like to see that approach, I'd be happy to send it to you if it leads to a possible plug-in.

I have not yet moved my forum over to 4.x, but I will be working on this in earnest beginning in January.  It's long overdue, but it will be a great deal of work, and I needed to complete some other projects before I embark on this adventure.  I'm greatly looking forward to moving over to 4.x at this point, and as the post editing feature is critical for my board, I'll need to make sure this is implemented before I make the switch.  So, in short, not yet, but soon.  🙂 

We have many development (programming) forums on our site, and we use this editing mod just as you described--the first post is generally used to post updates to the project, along with the latest binaries, for developers that share their games digitally.  

I'd certainly be interested in seeing how this was implemented on your forum, so if you send me the source I'd love to see it.  Do you own the rights to that code?

Thank you!

Link to comment
Share on other sites

3 hours ago, AtariAge said:

I have not yet moved my forum over to 4.x, but I will be working on this in earnest beginning in January.  It's long overdue, but it will be a great deal of work, and I needed to complete some other projects before I embark on this adventure.  I'm greatly looking forward to moving over to 4.x at this point, and as the post editing feature is critical for my board, I'll need to make sure this is implemented before I make the switch.  So, in short, not yet, but soon.  🙂 

We have many development (programming) forums on our site, and we use this editing mod just as you described--the first post is generally used to post updates to the project, along with the latest binaries, for developers that share their games digitally.  

I'd certainly be interested in seeing how this was implemented on your forum, so if you send me the source I'd love to see it.  Do you own the rights to that code?

Thank you!

Yes. The changes were implemented by one of our guys years ago in 3.8.x. 

Here's an update, though: On of our Board found a plugin called "Kitchen Sink" that looks like it'll do the job.

Can you PM me an email so I can send you the source?

Link to comment
Share on other sites

5 minutes ago, WAMAS said:

Here's an update, though: On of our Board found a plugin called "Kitchen Sink" that looks like it'll do the job.

Interesting!  I've heard of this, but haven't looked at it.  Will do so!

6 minutes ago, WAMAS said:

Can you PM me an email so I can send you the source?

Will do!

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...