![]() |
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 one has any ideas on this?
|
I'd like to know the answer to Boofo's question as well :-/
|
Can you have replacement variables in a sig? It sounds like a mod that doesn't completely work right.
|
I was actually wondering why this doesn't work on postbit_display_complete:
Code:
$ok_ids = $vbulletin->options['allowedforum_ids']; |
Quote:
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. |
You're right, but that didn't help either, still after quick saving, the box disappears.
|
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 |
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.
|
Yes it's a bit difficult, there is only one hook for ajax edit, i serached for other mods and i found this: https://vborg.vbsupport.ru/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: https://vborg.vbsupport.ru/showthread.php?t=269667. But the ajax thing is a pro feature so nothing to do with it.
|
Quote:
|
Quote:
|
Quote:
|
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
|
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.
|
Ok i will try to add global $vbulletin and $thread instead of $threadinfo
|
Quote:
|
Well, something's got to be different during the edit. I'll play around and see if I can figure out anything.
|
It somehow must go through inlinemod.php as well I think
|
Oh well, I'm already stumped. I added a variable to the postbit_legacy template and used preRegister to set the value in a plugin on postbit_display_complete using values from $vbulletin and $forum, and it works even if I inline edit.
|
Yes because the problem isn't there (i think) the problem is when you create a new field and then quick editing a post
|
Quote:
|
Quote:
I'll try to check it again, maybe something is interfering, though I don't see what possibly could. |
Quote:
|
The code is the same as ziki is continuing my mod, btw the problem is that when you click quick edit it updates the variables with empty values, so even if you refresh values are gone...
--------------- Added [DATE]1345672192[/DATE] at [TIME]1345672192[/TIME] --------------- As soon as i can i will show you this on my site --------------- Added [DATE]1345675217[/DATE] at [TIME]1345675217[/TIME] --------------- Username: demo Pwd: test Go here, compile all fields then press "Submit New Thread" you will be redirected to the post where you can see two boxes so everything is fine try to edit your post and go advanced you can edit your values and then save, it will works. Now click edit post (whitout going to advanced) and then click save, you will see the problem (even when refreshing) |
Quote:
|
Basically i can solve this probem adding fields to the quick edit but i don't know how :/
|
Quote:
|
It's just this:
Code:
global $vbulletin; and I inserted "Test var: {vb:raw testvar}" in my postbit_legacy. That's the latest code - I was changing it to test different things, so I previously had it displaying some $vbulletin options values just to make sure they were set as expected (I had been thinking maybe if it was an ajax call that not everything was being loaded like on normal request). |
All times are GMT. The time now is 06:51 PM. |
Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
![]() |
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|