Back to Modification Graveyard

vB Drafts
Mod Version: 2.2, by RedTyger

This thread is in the Modification Graveyard.
vB Version: 3.8.x Rating: (2 votes - 5.00 average) Installs: 28
Released: 27 Feb 2009 Last Update: Never Downloads: 63
Not Supported DB Changes Uses Plugins Auto-Template Code Changes Additional Files Translations Is in Beta Stage  

Modification currently on hold for some major bugfixing.

vB Drafts adds a feature to temporarily save posts, threads and private messages that have not been submitted, allowing members to return to their unpublished submissions later on and continue writing where they left off.

Drafts can be periodically saved automatically or saved manually, with either option restricted to certain usergroups. Drafts can also be restricted to just posts, threads quick replies or private messages, or to specified fora and/or usergroups.

The system allows for as many drafts as you could need. Each member gets 1 post draft per thread, 1 thread draft per forum, 1 PM draft per private message and 1 for a new PM.

vB Drafts use AJAX, so saving a draft is as good as invisible. Either one click for manual saving or just a subtle, brief notification when a draft is saved automatically. For automated saving, the admin has full control over how often saves are performed.

Restoring a draft is even more invisible. Simply return to where you were writing and the draft will be there waiting for you.

vB Drafts for 3.8 is a mostly unchanged update of the older version with a few minor bugfixes and improvements, plus new support for private message quick replies.

Installation instructions
1. Extract the contents of the download file to your computer.
2. Upload the file in the product folder via the Product Manager at AdminCP > Plugins & Products > Manage Products > [Add/Import Product].
3. Upload the contents of the uploads folder to the equivalent location in your forum on your server. The directory structure within the download file is the same as your forum. So includes/cron/drafts.php goes in your forum's cron directory, etc.
4. Perform the file edit described below if you want Quick Reply drafts.
5. The options for vB Drafts are in the main vBulletin Options menu.
6. Done!

Upgrade instructions
1. Uninstall the vB Drafts product file ensuring that the option to delete saved drafts is set to Yes in the vB Drafts menu. All saved drafts must be deleted for the upgrade.
2. Follow the instructions for a new installation.

Uninstallation instructions
1. Uninstall the vB Drafts product file ensuring that the option to delete saved drafts is set to Yes in the vB Drafts menu. All saved drafts must be deleted for the upgrade.
2. Delete /clientscript/drafts.js.
3. Delete includes/cron/drafts.php.
4. Done!

File edits
For file edits, you will need to edit the original files that vBulletin was shipped with. Make your changes in an appropriate editor (anything that does not use formatting like MS Word will do) and then upload the files to your server, overwriting the existing files.

The file edit is only necessary if you intend to use autosaving with Quick Reply.

In file clientscript/vbulletin_quick_reply.js:
FIND:
PHP Code:
vB_Editor[QR_EditorID].write_editor_contents(""
REPLACE WITH:
PHP Code:
    // vB Drafts
        // Old
    // vB_Editor[QR_EditorID].write_editor_contents("")
    // vB Drafts 

This file edit is only necessary if Quick Reply requires a click.

FIND:
PHP Code:
vB_Editor[QR_EditorID].enable_editor(""); 
REPLACE WITH:
PHP Code:
    // vB Drafts
    // Old:
    // vB_Editor[QR_EditorID].enable_editor("");

    // New:
       
if (typeof(asId) == 'undefined')
       {
           
vB_Editor[QR_EditorID].enable_editor('');
       }
       else
       {
           
// Agonising, painful, horrific way to replace the QR message + draft with just draft
           
if (vB_Editor[QR_EditorID].wysiwyg_mode)
           {
               
asSplit vbphrase['click_quick_reply_icon'].split('<br /><br />');
           }
           else
           {
               
asSplit vbphrase['click_quick_reply_icon'].split('\n\n');
           }            
           
asSplit[0] = '';
           
vbphrase['click_quick_reply_icon'] = asSplit.join('');
           
vB_Editor[QR_EditorID].enable_editor(vbphrase['click_quick_reply_icon']);
        } 
    
// vB Drafts 


Template edits
You should not have to make any template edits, the modification will do it for you. But if you find that the draft button or other aspects of the modification are not showing up correctly, it means you'll have to perform some or all of the template edits manually. They are described below.

In SHOWTHREAD
FIND:
Code:
id="qr_submit" onclick="clickedelm = this.value" />
REPLACE WITH:
Code:
id="qr_submit" onclick="clickedelm = this.value" /> <input onclick="draftsave();" type="button" class="button" name="draft" value="$vbphrase[draft_save_as_draft]" accesskey="d" tabindex="1" />
FIND:
Code:
id="qr_preview" onclick="clickedelm = this.value" />
REPLACE WITH:
Code:
id="qr_preview" onclick="clickedelm = this.value" /> <div id="draft_saving" style="display:none;margin-top:$stylevar[cellpadding]px;"><img id="draft_saving_img" src="$stylevar[imgdir_misc]/progress.gif" class="inlineimg" border="0" alt="" /> <strong>$vbphrase[draft_saving_draft_please_wait]</strong></div>


In newreply
FIND:
Code:
value="$vbphrase[submit_reply]" accesskey="s" tabindex="1" />
REPLACE WITH:
Code:
value="$vbphrase[submit_reply]" accesskey="s" tabindex="1" /> <input onclick="draftsave();" type="button" class="button" name="draft" value="$vbphrase[draft_save_as_draft]" accesskey="d" tabindex="1" />
FIND:
Code:
value="$vbphrase[preview_post]" accesskey="r" tabindex="1" />
REPLACE WITH:
Code:
value="$vbphrase[preview_post]" accesskey="r" tabindex="1" /> <div id="draft_saving" style="display:none;margin-top:$stylevar[cellpadding]px;"><img id="draft_saving_img" src="$stylevar[imgdir_misc]/progress.gif" class="inlineimg" border="0" alt="" /> <strong>$vbphrase[draft_saving_draft_please_wait]</strong></div>


In newthread
FIND:
Code:
value="$vbphrase[submit_new_thread]" accesskey="s" tabindex="1" />
REPLACE WITH:
Code:
value="$vbphrase[submit_new_thread]" accesskey="s" tabindex="1" /> <input onclick="draftsave();" type="button" class="button" name="draft" value="$vbphrase[draft_save_as_draft]" accesskey="d" tabindex="1" />
FIND:
Code:
value="$vbphrase[preview_post]" accesskey="r" tabindex="1" />
REPLACE WITH:
Code:
value="$vbphrase[preview_post]" accesskey="r" tabindex="1" /> <div id="draft_saving" style="display:none;margin-top:$stylevar[cellpadding]px;"><img id="draft_saving_img" src="$stylevar[imgdir_misc]/progress.gif" class="inlineimg" border="0" alt="" /> <strong>$vbphrase[draft_saving_draft_please_wait]</strong></div>


In pm_newpm
FIND:
Code:
value="$vbphrase[submit_message]" accesskey="s" tabindex="1" />
REPLACE WITH:
Code:
value="$vbphrase[submit_message]" accesskey="s" tabindex="1" /> <input onclick="draftsave();" type="button" class="button" name="draft" value="$vbphrase[draft_save_as_draft]" accesskey="d" tabindex="1" />
FIND:
Code:
value="$vbphrase[preview_message]" accesskey="r" name="preview" tabindex="1" />
REPLACE WITH:
Code:
value="$vbphrase[preview_message]" accesskey="r" name="preview" tabindex="1" /> <div id="draft_saving" style="display:none;margin-top:$stylevar[cellpadding]px;"><img id="draft_saving_img" src="$stylevar[imgdir_misc]/progress.gif" class="inlineimg" border="0" alt="" /> <strong>$vbphrase[draft_saving_draft_please_wait]</strong></div>


In pm_showpm
FIND:
Code:
id="qr_submit" class="button" accesskey="s" tabindex="1" />
REPLACE WITH:
Code:
id="qr_submit" class="button" accesskey="s" tabindex="1" /> <input onclick="draftsave();" type="button" class="button" name="draft" value="$vbphrase[draft_save_as_draft]" accesskey="d" tabindex="1" />
FIND:
Code:
name="preview" class="button" accesskey="x" tabindex="1"  />
REPLACE WITH:
Code:
name="preview" class="button" accesskey="x" tabindex="1"  /> <div id="draft_saving" style="display:none;margin-top:$stylevar[cellpadding]px;"><img id="draft_saving_img" src="$stylevar[imgdir_misc]/progress.gif" class="inlineimg" border="0" alt="" /> <strong>$vbphrase[draft_saving_draft_please_wait]</strong></div>

Download

No files for download.

Screenshots

 

Similar Mods

New Posting Features vB Drafts vBulletin 3.6 Add-ons
Save Drafts (Remember Everything) Updated! vBulletin 3.0 Full Releases
Save Drafts (New Topics, New Reply, PM(s)) Updated March 04, 2005 vBulletin 3.0 Beta Releases

vblts.ru supports vBulletin®, 2022-2024