![]() |
|
Thread Tools |
#1
|
||||
|
||||
Quick edit ajax question
I'm stuck here, guys. I have a replacement variable in my sig. When I do a quick edit of the post, after I save it, you can see the variable. When I refresh the page, the variable is parsed like it should be. Is there a hook that deals with the ajax portion of that so it can be parsed without having to refresh the page first?
No members have liked this post.
|
#2
|
||||
|
||||
No one has any ideas on this?
No members have liked this post.
|
#3
|
||||
|
||||
I'd like to know the answer to Boofo's question as well :-/
__________________
My free mods~click here No members have liked this post.
|
#4
|
|||
|
|||
Can you have replacement variables in a sig? It sounds like a mod that doesn't completely work right.
No members have liked this post.
|
#5
|
||||
|
||||
I was actually wondering why this doesn't work on postbit_display_complete:
It should display two boxes beneath the post text, which does fine but after using the quick edit it disappears and I have to refresh.
__________________
My free mods~click here No members have liked this post.
|
#6
|
|||
|
|||
Originally Posted by Ziki
![]()
Oh, ok. I think the reason is that $vbulletin and $foruminfo don't seem to be available at that hook. For $vbulletin you can put in a "global $vbulletin" or you can use $this->registry instead. And it looks like you can use $forum instead of $foruminfo. No members have liked this post.
Last edited by kh99; 22 Aug 2012 at 15:23. Reason: typo in 'registry' |
#7
|
||||
|
||||
You're right, but that didn't help either, still after quick saving, the box disappears.
__________________
My free mods~click here No members have liked this post.
|
#8
|
||||
|
||||
Lol guess what i'm asking to myself the same question ahaha
However kevin it seems that the code is working well, the problem is just the when you edit via ajax, i have fields for links and scans just on newthread.php and editpost.php when you click edit post (ajax) as you don't have links fields when you click save it seems to update links with empty values
__________________
http://twitter.com/scanu_account No members have liked this post.
|
#9
|
|||
|
|||
Hmm...well, when I save after doing an inline edit, it seems to make 2 calls - one is to ajax.php with do=editorswitch, which seems to allow it to convert the message text based on the editor mode. Then it calls editpost with do=updatepost, and it looks to me like that ends up calling construct_postbit, which should run the postbit_display_complete hook code. I guess I'll have to experiment more to see if code on that hook can actually change the postbit in that situation.
No members have liked this post.
|
#10
|
||||
|
||||
Yes it's a bit difficult, there is only one hook for ajax edit, i serached for other mods and i found this: http://www.vbulletin.org/forum/showthread.php?t=250948 but if you disable redirecting plugins and try to do a quick edit it deletes the link, so he had the same problem. Another mod was this: http://www.vbulletin.org/forum/showthread.php?t=269667. But the ajax thing is a pro feature so nothing to do with it.
__________________
http://twitter.com/scanu_account No members have liked this post.
|
#11
|
||||
|
||||
Originally Posted by kh99
Yes, that is correct, that's why I was baffled when it didn't work :-/
![]()
__________________
My free mods~click here No members have liked this post.
|
#12
|
|||
|
|||
If you take away your "if" statements and hardcode your $links and $scans, does it work then? (Assuming it's a test forum - you wouldn't want to do that on a live forum of course). I was going to set up that test but it's probably easier for you.
No members have liked this post.
|
#13
|
|||
|
|||
Originally Posted by Scanu
I'm not sure I understand, but if you're working with form fields that exist only when you're creating the post, then yeah, you'd need to save them somewhere so you can have them if the post is being edited (or somehow arrange for them to be submitted when the edited post is submitted, like hidden fields?). Edit: it seems like you'd have the same problem when non-inline editing a post, unless you expect the user to re-enter the info.
![]()
No members have liked this post.
Last edited by kh99; 22 Aug 2012 at 16:08. |
#14
|
||||
|
||||
Well i've added a field to the new thread page then i saved it, after this i can use threadinfo['myfield'] in postbit_display_complete, i added the field to editpost.php too, where you can update this field, until now everything is ok i create a new thread and i put a value to my field and i can see it in the showthread page, if i click edit post and go advanced i can edit this value and it works fine, the problem was adding this field to quickedit so i decided to leave it just on editpost.php but actually if i click edit post and then save it deletes my value, i hope i made myself clear and again, sorry for my english
__________________
http://twitter.com/scanu_account No members have liked this post.
|
#15
|
|||
|
|||
Well, I guess I'd have to study the mod to understand it completely. But at hook postbit_display_complete, you should have the thread info in $thread. The difference of course is that that's called when it's displayed instead of when it's saved in the db.
No members have liked this post.
|
![]() |
«
Previous Thread
|
Next Thread
»
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
Thread Tools | |
|
|
New To Site? | Need Help? |
All times are GMT. The time now is 19:50.