Topic: Preview button on quick reply

##
##
##        Mod title:  Preview button on quick reply
##
##      Mod version:  1.0.1
##   Works on PunBB:  1.2.10 (should work with all 1.2.*)
##     Release date:  3-1-2006
##           Author:  Artic Chill
##
##      Description:  This mod adds a preview button on the quick
##                   reply in viewtopic.php!
##
##   Affected files: viewtopic.php
##
##
##       Affects DB:  No
##
##            Notes:  This is a new mod I did in my free time it works but newer versions are
##                      on the way so expect some major changes to this mod. There are many
##                      features i am expecteing to add depending on the responce of this mod.
##                      All though this is an easy mod it will turn out great now and on later 
##                      updates. I hope people acctually download and enjoy this mod. Please 
##                      dont ridicule me on this mod.
##
##       DISCLAIMER:  Please note that "mods" are not officially supported by
##                    PunBB. Installation of this modification is done at your
##                    own risk. Backup your forum database and any and all
##                    applicable files before proceeding.
##
##
##

Download Here

My PunRes Wiki Mods:
1.) Remove Post Icon in View Topic And in Index
2.) Bold Links In Header
[img]http://www.the-artbreak.com/forum/img/smilies/socom.png[/img]

Re: Preview button on quick reply

The line of code provided in Preview button on quick reply.txt

<p><input type="submit" name="submit" value="<?php echo $lang_common['Submit'] ?>" tabindex="<?php echo $cur_index++ ?>" accesskey="s" /><input type="submit" name="preview" value="Preview" tabindex="<?php echo $cur_index++ ?>" accesskey="p" /><a href="javascript:history.go(-1)"><?php echo $lang_common['Go back'] ?></a></p>

is working fine, but if I to want my Preview button to be translated, I'd use the line that you'd find in post.php i.e;

<p><input type="submit" name="submit" value="<?php echo $lang_common['Submit'] ?>" tabindex="<?php echo $cur_index++ ?>" accesskey="s" /><input type="submit" name="preview" value="<?php echo $lang_post['Preview'] ?>" tabindex="<?php echo $cur_index++ ?>" accesskey="p" /><a href="javascript:history.go(-1)"><?php echo $lang_common['Go back'] ?></a></p>

and to my surprise it won't work. It will display an empty (but working fine) button. Any assistance would be appreciated.

3

Re: Preview button on quick reply

You need to load the language file in viewtopic.php. smile Near the top of viewtopic.php, copy the line that looks like:

require PUN_ROOT.'lang/[language]/viewtopic.php';

and add another line like that beneath it, changing viewtopic to post.

Re: Preview button on quick reply

Thanks! : )

5 (edited by Vanslyde 2007-11-05 01:10)

Re: Preview button on quick reply

I tried to implement this line in message_send.php which is part of the PMs mod.

It won't work the same way as the Preview button will actually send the message instead of previewing it..

Any way I could modify this line of code in order to implement it with the PMs mod.?

Re: Preview button on quick reply

With this preview feature, doesn't it just take you right back to the post area? It would be better if it was based on ajax and remain on the same page.