PDA

View Full Version : New Posting Features - vB Drafts


RedTyger
02-26-2009, 10:00 PM
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:

vB_Editor[QR_EditorID].write_editor_contents("")


REPLACE WITH:

// 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:

vB_Editor[QR_EditorID].enable_editor("");


REPLACE WITH:

// 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:

id="qr_submit" onclick="clickedelm = this.value" />


REPLACE WITH:

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:

id="qr_preview" onclick="clickedelm = this.value" />


REPLACE WITH:

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:

value="$vbphrase[submit_reply]" accesskey="s" tabindex="1" />


REPLACE WITH:

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:

value="$vbphrase[preview_post]" accesskey="r" tabindex="1" />


REPLACE WITH:

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:

value="$vbphrase[submit_new_thread]" accesskey="s" tabindex="1" />


REPLACE WITH:

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:

value="$vbphrase[preview_post]" accesskey="r" tabindex="1" />


REPLACE WITH:

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:

value="$vbphrase[submit_message]" accesskey="s" tabindex="1" />


REPLACE WITH:

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:

value="$vbphrase[preview_message]" accesskey="r" name="preview" tabindex="1" />


REPLACE WITH:

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:

id="qr_submit" class="button" accesskey="s" tabindex="1" />


REPLACE WITH:

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:

name="preview" class="button" accesskey="x" tabindex="1" />


REPLACE WITH:

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>

RedTyger
02-27-2009, 01:17 PM
Reserved.

akulion
02-27-2009, 01:27 PM
cool - ill be trying this out a lil later - definately something which should come in extremely useful for all users

Capper5016
02-27-2009, 02:16 PM
Still not working in Firefox. Works fine in IE.

Also, when clicking "Go Advanced", the SAVE DRAFT button only appears at the bottom, under additional options, would it be better placed in the "Reply to thread" box toward the top? Its just my thinking, but people may not know its there unless they scroll down.

AlexanderT
02-27-2009, 02:17 PM
Looks extremely useful.

RedTyger
02-27-2009, 02:26 PM
Still not working in Firefox. Works fine in IE.

I forgot to mention, the file edits are different this time around. If you've done the file edit before, both parts will have to be done again.

If it still doesn't work, tell me specifically where and doing what.

Andyrew
02-27-2009, 02:35 PM
When a draft is recalled its got <P></P> all over the place.

RedTyger
02-27-2009, 02:44 PM
When a draft is recalled its got <P></P> all over the place.

I need to know your post editor type and where the draft is being saved/restored, as well as the saved text itself or some that produces the same effect.

Capper5016
02-27-2009, 03:10 PM
I forgot to mention, the file edits are different this time around. If you've done the file edit before, both parts will have to be done again.

If it still doesn't work, tell me specifically where and doing what.

Followed the directions, didnt have to edit any templates.

Everything is as it should be, works perfectly in IE7 & 8, and everything looks fine in FF.....but the text doesnt appear in the editor after saving a draft, but the notice is there that the draft is saved and available til _____.

RedTyger
02-27-2009, 03:17 PM
Could you PM me an admin login to your forum please, it was developed on Firefox so I'm not sure what's going on.

Andyrew
02-27-2009, 03:20 PM
I need to know your post editor type and where the draft is being saved/restored, as well as the saved text itself or some that produces the same effect.

I just tried again and it's working fine now. :confused:

Tested in IE 8 Beta and Chrome. :up:

Switch02
02-27-2009, 03:21 PM
Nice and useful good work ;)

Andyrew
02-27-2009, 03:35 PM
Don't know what's going on but now i'm getting code again back in the recalled messages,
and if i tick the box to delete draft after submit, the post gets submitted but i get this error.

Fatal error: Call to undefined method vB_Database::query_slave() in /xxxx/xxxxxxx/public_html/forums/global.php(400) : eval()'d
code on line 211

Using WYSIWYG editor

RedTyger
02-27-2009, 03:42 PM
Try it again with the product file attached to this post. Just upload and overwrite existing.

Andyrew
02-27-2009, 04:03 PM
Try it again with the product file attached to this post. Just upload and overwrite existing.

That fixed the error, no code been recalled in to posts so far but when a message is recalled all carriage returns are removed.

I used your text from your first post, looked ok to start with but when recalled it looks like this.

Andyrew
02-27-2009, 04:21 PM
Firefox still puts in code when recalled, see before and after pictures.

Capper5016
02-27-2009, 06:30 PM
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
However, in the installation instructions, you say the edit should be made if you want to use drafts with Quick Reply.

The code you say to replace is not in the clientscript/vbulletin_quick_reply.js file.

drsli
02-27-2009, 06:46 PM
I found it there.
Btw.: I can second the Firefox-issues. Anyway: I´m happy, that this great addon is maintained.

Capper5016
02-27-2009, 07:22 PM
Yeah, I found it....using the search feature in notepad doesnt work.


Ok, here are a couple of issues. If you put text in the "QUICK REPLY" and hit "POST QUICK REPLY":

The following errors occurred with your submission:
The message you have entered is too short. Please lengthen your message to at least 10 characters.If you click "GO ADVANCED" the post preview is there, the text is in the box, and the mod works correctly.

If you click "SAVE DRAFT", the text is there and the mod works correctly.


Also, when you click "SAVE DRAFT", you see the "working icon" and SAVING DRAFT....PLEASE WAIT. The "working icon then disappears, but SAVING DRAFT....PLEASE WAIT stays there.

RedTyger
02-27-2009, 07:37 PM
Yes, I'm beginning to remember why I abandoned this one in the first place. I've fixed a couple more bugs and it's stable enough with the ordinary editor but I'm having terrible trouble getting it to work with WYSIWYG.

I'll get back to it after the weekend. Download has been removed and marked as Beta while I try to patch it up.

Capper5016
02-27-2009, 08:12 PM
My forums are completely messed up....I cant post anything unless I click "go advanced". Have tried uninstalling mod, still nothing.....any help would be appreciated

RedTyger
02-27-2009, 08:57 PM
Overwrite the edited javascript file with the original, it sounds like the edit may not have worked correctly.

Capper5016
02-27-2009, 09:02 PM
Tried that. Have also tried reverting templates, flushing the cache, etc.

Submitted a support ticket at VB

RedTyger
02-27-2009, 09:07 PM
Hold up, I'll see if I can help.

Edit: I cleared my browser cache and it appears to work correctly. You probably have the old javascript still cached.

Andyrew
02-27-2009, 09:10 PM
Upload all vb files again and run the upgrade script.

Capper5016
02-27-2009, 10:53 PM
VB guys fixed it. No worries, I'll reinstall it next week when you have all the kinks worked out

MoMan
02-28-2009, 01:25 AM
There's the file at? Says "no files uploaded" under the download area.

TWTCommish
02-28-2009, 01:46 AM
MoMan: might wanna try reading the thread. :) RedTyger just stated that he's removing the files until he can get some of the bugs worked out.

Anyway, I used this for 3.6, and my users have desperately missed it since I upgraded, so I do hope you continue working on it, Red. It's a great idea and I'll be one of the first to install it once everything gets sorted out. :)

drsli
02-28-2009, 08:34 AM
I second! :)

Andyrew
02-28-2009, 08:45 AM
It's working great as long as you don't use the WYSIWYG editor, the only other problems i have noticed is what's been said already about the saving text always saying saving.
Also the text Message (Drafts enabled): appears at the top of the editor even if you have it turned of for certain forums, no button below shows but the text above the editor does.
Other than that it's great. :up::)

psychotica
03-01-2009, 07:38 PM
This is a great plugin, hope to see it fixed.

Thanks RedTyger!

I tagged it.

Arkidas
03-06-2009, 09:41 AM
Does it work with 3.7.2?

Capper5016
03-12-2009, 01:20 AM
RedTyger, any luck fixing the issues?

shofolofo
03-23-2009, 07:14 PM
same question ...


:D

biocyberman
03-24-2009, 10:37 AM
Oh thank gods!
I am waiting to have this on my site :)

crazlunatic
03-29-2009, 05:24 AM
um hey, the attachments seem to have disappeared?

chick
03-30-2009, 01:34 AM
I'd like this too, this should be included with vb to begin with. Anything Ty?

jrap
04-16-2009, 03:13 PM
This looks like a great mod. Do you have plans to add the attachments back?

yotsume
04-17-2009, 04:46 PM
Ok tagging this to watch its much needed development. Hope to see this working very soon!

I agree a draft system should be standard in VB to begin with! BIG TIME!

Chadi
04-21-2009, 04:27 PM
Is anyone getting occasional blank pages on submit or HTTP 500 errors?

biocyberman
05-04-2009, 08:50 AM
Modification currently on hold for some major bugfixing.
Still waiting for have the bug fixed.

djXpire2
05-07-2009, 07:02 PM
Modification currently on hold for some major bugfixing.

waiting too... this is definitely useful for my forum... thanks for the good work. ;)

farhad.khan
06-12-2009, 01:35 PM
Hi,

I am not able to find the product files except the one in a post by RedTyger - https://vborg.vbsupport.ru/showthread.php?t=206802#14

Thanks.

Saviour
06-16-2009, 02:51 PM
Keeping an eye on this, myself...

Definitely needed and should be standard with vb product...once bugs are fixed.

Eq4bits
06-16-2009, 09:47 PM
Tagged and watching! Should def be a vB *standard*!

shofolofo
06-26-2009, 08:23 PM
any updates ?

markblair
07-20-2009, 01:16 PM
I have been looking for something like this for a long time. Patiently awaiting an update as I would love to try this out. :) Thanks!

kacem
07-21-2009, 07:04 PM
great, but it doesn't work with arabic letter

KevinGupta
08-02-2009, 12:54 PM
I am really waiting for this ....
I hope this one comes out with a fix very soon :D

imedic
08-10-2009, 08:19 PM
Tagged and I keep a close eye on it! Should be a vB *standard*!

McMendo
08-14-2009, 02:18 AM
Modification currently on hold for some major bugfixing.
Developer Last Online: Mar 2009

Assume a dead project?

I agree that such functionality should come as a standard on vbulletin.

Hostboard
09-11-2009, 01:16 PM
Maybe someone will pick it up where he left off???

Tanapangarap
11-03-2009, 04:18 AM
Ah, such a shame. 'Tis a great feature.

I should still be able to use the older one, I think.