The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
|||
|
|||
Notify user that their post has been modified
I'm writing a plugin that modifies the user's post in the newpost_process hook. I want to display a notification to the user when they are sent back to their post telling them that it was modified (in the postbit_complete hook).
I got it to work but I'm use the "p" get variable because that's the only way I could detect if the user has just been sent back after submitting the post. I say for each post in the postbit, if its id is equal to $_REQUEST['p'] then display the message at the top of that post. I have a feeling this isn't a good way to do it though. Is there a better way to do this? |
#2
|
||||
|
||||
Can you post your code?
|
#3
|
|||
|
|||
newpost_complete hook
PHP Code:
PHP Code:
|
#4
|
|||
|
|||
Bump.
Also another problem with the technique I am using. The flow is like this: Someone posts a message - > gets taken to the "your message has been sent" screen -> gets sent back to their new post -> a message appears above their new post notifying them that it has been modified It works, however if they post a quick reply their post is modified but they receive no notification. I think this is because the quick reply isn't affected by the postbit hook. |
#5
|
|||
|
|||
You need to repost with your proper hooks. There is no 'postbit_complete' hook in vb4, that I know of. Anyway, tried to help, but could not follow.
|
#6
|
|||
|
|||
I'm pretty sure it's using "postbit_display_complete". But the problem is that when you quick edit, javascript on the page makes a call to editpost.php and gets back just the edited message area. So postbit_display_complete is not called, and also the place where the notice is displayed is not getting updated. I think you'd either need to figure out how you can get some javascript to run when the post is updated, so you can set the message, or else you could disable ajax features so that the page reloads, but then of course you're losing that feature.
|
Благодарность от: | ||
tbworld |
#7
|
|||
|
|||
Thank you so much for your response.
Quick edit is fine, but quick reply is what I'm wondering about. It's probably the same concept though, it doesn't seem to change the url or call the postbit_display_complete hook. Is there a hook in the quick reply code? |
#8
|
|||
|
|||
This is not an area of the code that I am familiar with -- although I am beginning to look at it now. I would start with looking at "vbulletin_quick _reply.js". Sorry, I cannot comment on the hooks, but I am looking. Maybe brighter minds will chime in (@kh99) or the like!
|
#9
|
|||
|
|||
Oh right, quick reply. Sorry. Yeah, it calls newreply instead of editpost, but it is the same idea. Unfortunately it's not really my area either.
Although I did create a "check for new replies" mod that has a similar issue. It displays a message if someone else replied to the thread while you were typing your reply. If I remember correctly, it works because the javascript that makes the "ajax" call gives up if it gets an error, and just goes ahead and reloads the page. So mayb yours could work the same way: use a hook in newreply.php, check for ajax=1 and for the post being modified, and if it is just exit the script (which will cause an error and make the page reload). I hope. |
#10
|
|||
|
|||
Actually I just looked at the code for the mod I mentioned (https://vborg.vbsupport.ru/showthread.php?t=264858) and I see that what I actually did was to disable ajax for quick reply if the mod is enabled, so I suppose I couldn't figure out any other way for it to work. But I also was trying to make a mod without code changes, so if you only want to get it to work on your site you always have the option of modifying the code.
|
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|