Register Members List Search Today's Posts Mark Forums Read

View Poll Results: Should the saved message be removed when a thread/post/private message has been sent?
4 4 4%
8 8 8%
6 6 6%
Voters: 53. You may not vote on this poll

Reply
 
Mod Options
vB Drafts Details »»
vB Drafts
Mod Version: 2.11, by RedTyger (Coder) RedTyger is offline
Developer Last Online: Jul 2012 I like it Show Printable Version Email this Page

vB Version: 3.6.7 Rating: (50 votes - 4.66 average) Installs: 163
Released: 15 Mar 2007 Last Update: 17 Jul 2007 Downloads: 824
Not Supported DB Changes Uses Plugins Additional Files  

vB Drafts
Report a bug | Request a feature (Requires super-quick registration)

Description

This modification adds an save draft feature when using Quick Reply, New Reply, New Thread and Private Messaging.
When writing a message you can choose to save it and return to it later without publically publishing it.
There are two saving options, one is where drafts are automatically saved every X minutes where process is mostly
invisible to the user and is a background process and where drafts can be saved at any point by clicking a button. You can assign each
type to individual usergroups separately.

Drafts are saved and restored in the following manner. One new thread per forum, one reply per thread, one PM reply per PM and one new PM. If a saved post/thread/PM is found, the text is automatically restored to the reply field when the user returns to the page. So to restore a thread, they just visit the New Thread page in the forum in which it was being written, it will be there waiting.

To remove old draft data which has not been deleted by its author, a scheduled task runs daily which removes any drafts data which is older than X days.

You are not permitted to redistribute or re-release this modification.


Options: (AdminCP > vBulletin Options > vB Drafts)

Enable drafts for Quick Replies?
Set to Yes to enable drafts for Quick Replies.

Enable drafts for New Replies?
Set to Yes to enable drafts for New Replies.

Enable drafts for New Threads?
Set to Yes to enable drafts for New Threads.

Enable drafts for Private Messages?
Set to Yes to enable drafts for New Private Messages.

Enable manual drafts for UsergroupIDs
Enter the IDs of the usergroups you wish to enable manual drafts for, separated by commas. Example: 1,2,3.

Leave this option blank to enable drafts for everyone.

Enable automatic drafts for UsergroupIDs
Enter the IDs of the usergroups you wish to enable automatic drafts for, separated by commas. Example: 1,2,3.

Leave this option blank to enable drafts for everyone.

Enable drafts for ForumIDs
Enter the IDs of the forums you wish to enable drafts for, separated by commas. Example: 1,2,3

Leave blank to enable drafts in every forum.

Do NOT drafts for ForumIDs
If it is easier for you to specify which forums you do not want drafts in, enter the IDs of the usergroups you wish to disable drafts for, separated by commas. Example: 1,2,3

Leave blank to not disable autosaving in any forums.

Minimum post/thread/PM length
Enter how many characters a post/thread/PM must contain before it will be saved. Example: 500 will disable the saving of drafts shorter than 500 characters.

Set this option to 1 to allow saving for messages of any length.

Wait X minutes before saving
Enter the number of minutes before a post/thread/PM starts to be saved. Example: 10 will begin allowing saved drafts after 10 minutes.

Manual saving will disable this option.

Repeat saving every X minutes
After the wait time has expired, specify how often the post/thread/PM will be saved. Example: 5 will save a draft every 5 minutes.

Manual saving will disable this option.

Store draft data for X days
Specify in days how long draft data will be kept for. Example: 7 will delete a draft after 7 days.

Delete drafts when uninstalling?
Set to No to leave all the drafts in the database when you uninstall this modification, otherwise the drafts database will be cleared at uninstallation.

You must also remove the scheduled task and/or cron file or it will delete saved drafts after X days (set above) anyway!


Upgrade Instructions:

From v1.50:
Uninstall your current version of this modification. You will lose any current saved drafts and your current settings.
Delete vb_autosave.php from your root folder.
Delete vb_autosave_cron.php from your includes/cron folder.
You do not have to remove previous template edits, but if you wish to then there is a list in the zip file which you can work through and undo.

From v2.00:
Delete drafts.php in the root (top level, not cron) folder on your server, this file is no longer needed.

When the above is done, follow the installation instructions below.


Installation Instructions:

Uploads:
1. Go to AdminCP > Plugins & Products > Manage Products > Add/Import Product.
2. Upload the vb_drafts_xxx.xml file.
3. Upload the contents of the upload folder to the equivalent forum folders on your server.


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:

Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

REPLACE WITH:

Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.


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

FIND:

Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

REPLACE WITH:

Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

Done!


Donations

If you have a pressing wish to donate money to me (and of course, you do) to say thank you and to possibly encourage more future work then you can do via the link below. Also, you will go to heaven.

http://redtyger.co.uk/donations.php

Don't panic! The donations link is only hosted on my website so it can be encrypted and not open my email address to spammers.


Changelog
v1.00 Initial release.

v1.01 Removed branding.

v1.50 Added message which flashes up when a message is saved.
v1.50 Added status indicator to show when autosave is active on a page. This also replaces the WYSIWYG incompatible message.
v1.50 Added function to optionally delete saved message after posting (see screenshot).
v1.50 Added improved restoration interface and added expiry details for the saved message.
v1.50 Added end-user FAQ items for the modification.
v1.50 Changed rewrite and improvement of product code.

v2.00 Added manual draft saving.
v2.00 Added WYSIWYG compatibility.
v2.00 Added Quick Reply requiring a click compatibility.
v2.00 Added automated template edits.
v2.00 Added extra security checks.
v2.00 Added minor cross-system compatibility improvements.
v2.00 Added optimisations, some major some minor.
v2.00 Added option to keep drafts when uninstalling the modification.
v2.00 Changed FAQ text, draft enabled message now links to an FAQ explanation of what it is.

v2.00 Changed expired draft deletion to run hourly instead of daily.
v2.00 Fixed bug where Quick Reply would delete the title of a post saved in New Reply.
v2.00 Fixed bug where quoting would not work.
v2.00 Fixed bug where previewing would show the draft twice.
v2.00 Fixed phrasing where post was said to be thread.
v2.00 Fixed expiration time, now it is correct to the minute when deletion will occur.
v2.00 Fixed deletion failed message for users in case AJAX delete doesn't work.
v2.00 Fixed other miscellaneous minor bugs.
v2.00 Removed the AJAX delete now link. Now that drafts are deleting after submitting post/thread/PM it felt largely unnecessary.

v2.10 Added true instant one-click AJAX draft saving. It is now also considerably faster.
v2.10 Added cursor change to hourglass when saving.
v2.10 Fixed bug where pruning of old drafts did not occur.
v2.10 Fixed bug where drafts were not deleted after submission.
v2.10 Fixed bug where IE gave irrelevant javascript errors.
v2.10 Fixed bug where Quick Reply drafts were counted as a duplicate post.
v2.10 Fixed bug where Autosave drafts enabled message did not show.
v2.10 Fixed bug where IE did not show delete drafts option as disabled.
v2.10 Removed redundant phrases.

v2.11 Added intial wait time before autosaving draft option. I have never added it before, oops.
v2.11 Fixed bug where QR went back to counting every post as a duplicate.
v2.11 Fixed javascript not enabling the QR delete option properly.
v2.11 Fixed bug with incorrect characters for restored drafts in QR.
v2.11 Fixed FAQ and options minor description errors.
v2.11 Fixed delete draft option appearing where drafts are not enabled.

v2.2 NOW vBulletin 3.8.x ONLY.
v2.2 Added drafts for private message quick reply.
v2.2 Added optimisation to the database structure, is much faster now.
v2.2 Changed some minor code for minor optimisations.
v2.2 Changed the automated saving message to display permanently after the first save so it is clear a draft exists. The saving indicator has also been slowed dramatically so it is more noticable when a save takes place.
v2.2 Changed the saving function to not use vBulletin's minimum length check, which popped up an incredibly irritating message. Now it uses an invisible check.
v2.2 Fixed javascript error when using drafts with post quick reply.
v2.2 Fixed draft not appearing when sending a private message failed with an error.
v2.2 Fixed drafts being disabled when using Go Advanced on threads.
v2.2 Fixed private message title being replaced with nothing when viewing a PM.
v2.2 Fixed drafts being processed when draft content is empty. Usually this amusingly manifested itself as an empty draft restored from 1970.
v2.2 Fixed incorrect application of manual/automatic usergroup settings.

Download Now

Only licensed members can download files, Click Here for more information.

Screenshots

Click image for larger version

Name:	manualsave.jpg
Views:	1612
Size:	28.5 KB
ID:	67009

Show Your Support

  • To receive notifications regarding updates -> Click to Mark as Installed.
  • If you like this modification support the author by donating.
  • This modification may not be copied, reproduced or published elsewhere without author's permission.
Similar Mod
Mod Developer Type Replies Last Post
Save Drafts (Remember Everything) Updated! why-not vBulletin 3.0 Full Releases 91 12 Feb 2009 13:56
Save Drafts (New Topics, New Reply, PM(s)) Updated March 04, 2005 why-not vBulletin 3.0 Beta Releases 23 06 Mar 2005 19:54

  #16  
Old 16 Mar 2007, 11:38
Hornstar's Avatar
Hornstar Hornstar is offline
 
Join Date: Jun 2005
Real name: Matt
How intensive could this be on a large site?
Reply With Quote
  #17  
Old 16 Mar 2007, 11:49
RedTyger's Avatar
RedTyger RedTyger is offline
 
Join Date: Nov 2006
Originally Posted by hornstar1337 View Post
How intensive could this be on a large site?
I don't know, but it was specifically written to be easier on larger sites. So the end-user has no control, they can't keep writing their post to the db via manual save. It's strictly timed autosaves only and the admin controls the timing as well as specifying how long a post must be before it's saved. So you can set it to start saving after 10 minutes and only save once every 10 minutes afterwards if you like, obviously better for the server than if you start saves after 1 minutes and autosave every minute after that. Additionally, if the post is too shortor if they have not entered anything into the reply box yet the auotsave is not performed.

But assuming the post is OK to be saved, it's one single query write to the db for each timed save and it adds 1 query per page load to each reply type on which autosave/autorestore applies. You can turn autosaving for each reply type off (i.e. quick reply) to save a query on that page if necessary. Quick Reply in particular, since it adds a query to showthread which is used considerably more than the rest.

Obviously if you're very stuck for resources it's not a good idea, but short of one small idea which I haven't implemented yet I'm not really sure what else I could do to be easier on large sites. I'm not saying it's perfect but it's pretty efficient for what it is.
Reply With Quote
  #18  
Old 16 Mar 2007, 18:40
joeboo's Avatar
joeboo joeboo is offline
 
Join Date: Jun 2002
Will install when WYSIWYG editor support is complete
Reply With Quote
  #19  
Old 17 Mar 2007, 14:04
RedTyger's Avatar
RedTyger RedTyger is offline
 
Join Date: Nov 2006
If anyone knows javascript (and possible vBulletin too), there's an explanation of the WYSIWYG problem here, a solution to which still eludes me.
Reply With Quote
  #20  
Old 20 Mar 2007, 14:43
romanticyao's Avatar
romanticyao romanticyao is offline
 
Join Date: Oct 2002
Great mod, WYSIWYG editor plz!
Reply With Quote
  #21  
Old 20 Mar 2007, 15:39
RedTyger's Avatar
RedTyger RedTyger is offline
 
Join Date: Nov 2006
I'd love to unfortunately the WYSIWYG code interferes and I haven't yet been able to work out how to get around it.
Reply With Quote
  #22  
Old 20 Mar 2007, 21:27
TWTCommish's Avatar
TWTCommish TWTCommish is offline
 
Join Date: Oct 2001
Real name: Chris
I'll probably give this a shot, but about half my members (and most of those still actively posting) use the WYSIWYG editor, I believe, so yeah, that's a huge hurdle for what is otherwise a truly brilliant idea.
__________________
Ask me about how to purchase vB Quiz for vBulletin 3.7 (works with 3.8, too)!

Websites: Movie Forums | Go Quiz
Reply With Quote
  #23  
Old 21 Mar 2007, 18:11
MARKETPROFITS's Avatar
MARKETPROFITS MARKETPROFITS is offline
 
Join Date: Nov 2006
Real name: Koach
Will install this later. This is handy!
Reply With Quote
  #24  
Old 25 Mar 2007, 04:09
TWTCommish's Avatar
TWTCommish TWTCommish is offline
 
Join Date: Oct 2001
Real name: Chris
Red, did Wayne Luke's suggestion help with the WYSIWYG issue?
__________________
Ask me about how to purchase vB Quiz for vBulletin 3.7 (works with 3.8, too)!

Websites: Movie Forums | Go Quiz
Reply With Quote
  #25  
Old 25 Mar 2007, 11:57
RedTyger's Avatar
RedTyger RedTyger is offline
 
Join Date: Nov 2006
I don't know, I haven't had time to try it yet.
Reply With Quote
  #26  
Old 30 Mar 2007, 15:26
TWTCommish's Avatar
TWTCommish TWTCommish is offline
 
Join Date: Oct 2001
Real name: Chris
Just wanted to see if you've had a chance to give it a try. If not, would you have any objection to me fiddling around with it? A long shot, perhaps, but you never know.
__________________
Ask me about how to purchase vB Quiz for vBulletin 3.7 (works with 3.8, too)!

Websites: Movie Forums | Go Quiz
Reply With Quote
  #27  
Old 31 Mar 2007, 10:28
RedTyger's Avatar
RedTyger RedTyger is offline
 
Join Date: Nov 2006
You are most welcome to, I'll be sure to give you a mention if you get there. I just don't have the time at the moment.
Reply With Quote
  #28  
Old 31 Mar 2007, 23:52
testebr testebr is offline
 
Join Date: Jan 2004
Originally Posted by MaestroX View Post
A great mod. If it worked with WYSIWYG editor it would be the best mod so far this year!
I agree, but whats the big problem with WYSIWYG?
Reply With Quote
  #29  
Old 31 Mar 2007, 23:54
RedTyger's Avatar
RedTyger RedTyger is offline
 
Join Date: Nov 2006
It will only autorestore if you're using WYSIWYG, not autosave. There's some conflicting javascript in the vBulletin WYSIWYG editor script.
Reply With Quote
  #30  
Old 01 Apr 2007, 00:32
Tralala's Avatar
Tralala Tralala is offline
 
Join Date: Jan 2006
How can it autorestore, though, if it's not able to autosave in the first place? Most users don't change their editor style, they choose one and leave it at that one from the beginning. (And most choose WYSIWYG.)

Fingers crossed for TWTCommish to make some headway. I'd love to use this on my site. I know it would come in handy for me personally, as I accidentally lose my posts from time to time.
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
Mod Options

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
Forum Jump


New To Site? Need Help?

All times are GMT. The time now is 02:45.

Layout Options | Width: Wide Color: