The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
|||
|
|||
How can I edit two posts at the same time?
I'm building a vB modification that allows moderators to duplicate a post and insert it in another existing thread only once. I added a column to the post sql table that keeps track of the "link" between the two posts.
I can already delete both posts if one of them is deleted, but now I would like to create a specular post editing system so that if one of the two posts is edited, the other reflects the same changes. Let's say I have a post with ID=10. It is duplicated by a mod and inserted into another thread: the duplicated post has ID=11. Now in my database post ID=10 will have LINKID=11 and post ID=11 will have LINKID=10. How can I hook into editpost.php so that if I edit post ID=10, post ID=11 also get edited and vice-versa? Many thanks. |
#2
|
|||
|
|||
What you might want to do is look at includes/class_dm_threadpost.php and find the place where an edited post is actually updated. Then you might be able to find a place to check your link field and modify the other post in the same way.
|
#3
|
|||
|
|||
I found this:
PHP Code:
PHP Code:
|
#4
|
|||
|
|||
Sounds like you've pretty much got it figured out. Why not just make the same datamanager calls that are being made on the other datamanager? If you're only interested in having the text of the linked post update, then you probably only need to set_existing, [S]set('message'...)[/S], then save().
Edit: sorry, that second one would actually be setr('pagetext', $edit['message']). And you wouldn't want to duplicate all the calls made on the other post because you don't want to be changing the threadid or forumid, for instance. |
Thread Tools | |
Display Modes | |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|