The following modification will change the way post preview works in the "full" editor. Instead of being forced to constantly scroll to look at a previewed post, the previewed post will appear in a window inside the editor itself! It is the same "full" editor post preview which is used on this board.

This modification is only for Prosilver-based themes. If you use a subsilver2-based style, please consider moving into the 21st Century and upgrading to a Prosilver-based style.

This modification makes extensive changes to the posting_editor.html template. If you have installed a style and/or MOD which has altered this template, the manual installation procedure described below may not work. In that case, I would suggest that you contact the author of the style/MOD and ask them what needs to be changed in their style/MOD in order to make the necessary changes to enable inline post previews.

This modification requires jQuery. If you have not installed jQuery, the next post contains instructions for installing it.

OK...now that I have taken care of the fine-print, let's get to the modification!

Do not copy the jQuery files to your own site! Google has generously made the jQuery files available on one of their blazing-fast edge cache servers, and loading jQuery from one of those servers will be an order of magnitude faster than loading it from your site.

If you have not already installed jQuery, here is how to do it. Open the overall_header.html template file and find the following line:

Now save the file and clear the template cache, and jQuery will now be installed. Please note that this is not the most recent version of jQuery -- recent versions have become bloated and can cause your board to slow down.

Thanks for posting this Dion! I just installed it on my forum. I had to make a few small changes to it because of the text editor MOD that I have installed, but now that those changes are made, it works wonderfully, but I do not see the "loading bar" when the post is loading. I am not sure why, but perhaps you do?

Perhaps you removed the progress bar image from the admin folder, or perhaps your installation is slightly different than default. Maybe you made a transcription error when you did the changes. I'm not sure what else to tell you...

When I downloaded the attached .zip file, and extracted it, the extraction came out as corrupt, but the PHP file was there, so maybe there is something that I was supposed to upload that I did not get?

When I downloaded the attached .zip file, and extracted it, the extraction came out as corrupt, but the PHP file was there, so maybe there is something that I was supposed to upload that I did not get?

Thank you for pointing out the problem with the ZIP file. I just tried un-ZIPping it on a desktop system and the posting_editor.html file was corrupted. I have uploaded a new ZIP file.

I am sorry, but when I try to use the newly bundled posting_editor.html file, the progress bar appears, with the editing background in place, but it never completes the loading, and just shows the progress bar. When I manually enter the posting_editor.html code provided in your post above, the Preview button does not work at all.

This modification makes extensive changes to the posting_editor.html template. If you have installed a style and/or MOD which has altered this template, the manual installation procedure described below may not work. In that case, I would suggest that you contact the author of the style/MOD and ask them what needs to be changed in their style/MOD in order to make the necessary changes to enable inline post previews.

Have you made any other changes to the posting_editor.html template?

It would also help if you provided more information than "does not work at all". When you load the posting page, check your error console for javascript errors. Do the same when you click the Preview button. If you're getting errors, please post them here.

For anyone looking to use this on phpBB 3.2, I can confirm that it works as long as you strip out the `onload_functions()` stuff as Dion said. It is not necessary for changes to be made to the template variables, as they seem to be working even though they did not in 3.1.

I am not sure how big of an issue this is, but for some reason, attachments on my forum with the ".7z" extension display the following message when in preview mode: "[The extension 7z has been deactivated and can no longer be displayed.]" I have not disabled 7z extensions on my forum, so I am not sure why this is happening, nor am I sure if this was an issue on phpBB 3.0. I also do not know if this happens with other file extension types as well, but I would imagine that it likely does.

I believe that is an issue with the ddpreview.php file not being compatible with phpBB 3.2. The message parser was completely rewritten in phpBB 3.2 and a number of its options changed.

I suspect that you can ignore the message and the post will be saved correctly. Alternately, you can edit the ddpreview.php file and update it to be compatible with the message parser in phpBB 3.2. It's a small file so it should be pretty easy to do.

Yeah, I will look into doing that later on. The message does not effect the final post, but it would be nice to correct. Another issue that I ran into was that on 3.2, the "Submit" button wasn't working. The solution was to replace this section of the modified code...

I believe that is an issue with the ddpreview.php file not being compatible with phpBB 3.2. The message parser was completely rewritten in phpBB 3.2 and a number of its options changed.

I've started working on trying to fix the problem, and I haven't made any progress so far. I figured a good place to start would be to look at the phpBB message parser file. One of the functions that I found inside was this:

function prepare_bbcodes() { // Ok, seems like users instead want the no-parsing of urls, smilies, etc. after and before and within quote tags being tagged as "not a bug". // Fine by me ;) Will ease our live... but do not come back and cry at us, we won't hear you.

// This Variable is set to false here, because Attachments are entered into the // Database in two modes, one if the id_list is 0 and the second one if post_attach is true // Since post_attach is automatically switched to true if an Attachment got added to the filesystem, // but we are assigning an id of 0 here, we have to reset the post_attach variable to false. // // This is very relevant, because it could happen that the post got not submitted, but we do not // know this circumstance here. We could be at the posting page or we could be redirected to the entered // post. :) $filedata['post_attach'] = false; } } else { $error[] = $user->lang('TOO_MANY_ATTACHMENTS', (int) $cfg['max_attachments']); } }