View Full Version : postprocess the HTML output when pressing "preview" in editpost.php
BRotondi
09-15-2009, 09:50 PM
Hello
I want to postprocess the HTML output when pressing "preview" in editpost.php.
Now I'm trying this for about thre hours... and really dont get through...
Can someone please help me? The solution for Replace Word in Post - only HTML! (https://vborg.vbsupport.ru/showthread.php?p=1879157#post1879157) was to change $this->post['message'] in postbit_display_complet.
Thanks!
Bruno
Lynne
09-15-2009, 10:35 PM
First thing to do is to find the hook in the code and see what is going on around it. If you find that one, you'll see the next line is to output the template. It looks like the toolbar for the post, which is fed the message, is done before that hook (line 1071), so I'd guess you are trying to modify it too late.
BRotondi
09-15-2009, 10:41 PM
Hy Lynne
Thanks! I just realized it and changed my first post.
This thing is really getting me crazy: I can see, that editpost.php creates $vbulletin->GPC['message'] on Line 182 ($vbulletin->input->clean_array_gpc('p', array(...). But when I insert $vbulletin->GPC['message'] = 'test'; after this Line, not only the HTML will change, but also the Original (with the BBs) ...
Any Idea?
Bruno
Lynne
09-15-2009, 10:55 PM
Are you not trying to modify the original also? If you modify what goes into the post preview, then it is going to modify the post upon save.
BRotondi
09-16-2009, 07:22 AM
Phu... found it: $previewmessage in newpost_preview.
I only want to change the Preview, not the WYSIWYG (because of what you said) or the original (BB). bbcode_parse_complete is an interesting hook, but called for very different things...
This took some hours of debugging and understanding how vB works, but I hope not to forget what I learned :).
Thanks for your help!
Bruno
vBulletin® v3.8.12 by vBS, Copyright ©2000-2024, vBulletin Solutions Inc.