Message autosave hack [message #32198] |
Wed, 14 June 2006 09:54 |
|
gladiator
Messages: 61 Registered: June 2002 Location: Beijing
Karma:
|
Member |
|
|
Feature:
Save user's half-written post every 10 seconds automatically on server(like gmail's draft autosaving), so 40 minutes(or even 2 hours) work won't lost because of a browser crash or session timeout.
Tested under firefox1.5/ie6/konqueror3.5/safari1.2. (safari won't show the "last saved at xx:xx:xx" thing, but the draft itself will be saved properly)
Note: Only the lastest draft body will be saved, this hack is for autosave draft only, not to implement a complete draft function.
To install:
1. untar the attachement, mv(or ftp upload) the directory 'draftsave' into your fudforum's web_root directory(i.e. /path/to/your/webroot/forum/).
2. install adodb, edit the file config.php under draftsave, change $charset, $sAdodbPath, $TabUsers, $TabSes to match your situation.
3. Goto admin panel, use Template Editor to edit the template post.tmpl and usercp.tmpl, as in file post.tmpl_POST_PAGE and usercp.tmpl_usercp. You can delete these two file after install.
4. The file cleardrafts.sh can be used as a cron job, to auto remove the outdated drafts.
Draft is saved under fudforum's data dir/tmp/drafts/.
Any suggestion is appreciated. You can contact me through lr2100 <at> gmail <dot> com.
[Updated on: Wed, 14 June 2006 17:34] Report message to a moderator
|
|
|