Simple Machines Community Forum

Customizing SMF => Modifications and Packages => Topic started by: live627 on June 24, 2008, 01:11:04 PM

Title: Drafts
Post by: live627 on June 24, 2008, 01:11:04 PM
Link to Mod (http://custom.simplemachines.org/mods/index.php?mod=1264)

Drafts 2.2 by Charles Hill and maintained by live627



Allow member groups to save new topics, replies, and polls as drafts by giving them the "Can save topics and replies as drafts" permission.  Users with this permission can also view a list of their drafts in their Profile as well as on the Post page.  As an administrator, you can view any user's drafts via their Profile.

CHANGELOG
2.2
================================================================================
+ Added "Save as Draft" button to Quick Reply
+ Added pl_PL (thanks Nolt)
+ Added ru_RU (thanks Bugo)
+ Added uk_UA (thanks Crazy_Nick)

View full changelog (https://github.com/live627/smf-drafts/blob/master/changelog.txt)

License: ISC (http://opensource.org/licenses/ISC)

GitHub (https://github.com/live627/smf-drafts)
Title: Re: Drafts
Post by: karlbenson on June 24, 2008, 01:11:30 PM
very cool mod!
Title: Re: Drafts
Post by: Yağız... on June 24, 2008, 01:25:20 PM
Nice mod Charles. Turkish translation:
// Drafts txt variables
$txt['permissionname_save_drafts'] = 'Konuları taslak olarak kaydedebilir';
$txt['only_new_topics'] = 'Sadece yeni konuları taslak olarak kaydedebilsin.';
$txt['error_draft_not_saved'] = 'Bir hata oluştu ve taslak kaydedile<b>me</b>di.';
$txt['draft_saved'] = 'Taslak başarıyla kaydedildi.';
$txt['draft'] = 'Taslak';
$txt['showDrafts'] = 'Taslakları göster';
$txt['no_drafts'] = 'Gösterilecek taslak yok.';
$txt['last_saved'] = 'Son kaydedilen';
$txt['lastSaved'] = 'Son kaydedilen';
$txt['delete_draft_confirm'] = 'Bu taslağı silmek istediğinizden emin misiniz?';
$txt['save_as_draft'] = 'Taslak olarak kaydet';
$txt['draft_saved_short'] = 'Taslak kaydedildi';
$txt['loadDrafts'] = 'Taslakları Yükle';
$txt['hideDrafts'] = 'Gizle';
Title: Re: Drafts
Post by: Charles Hill on June 24, 2008, 02:47:53 PM
Thanks for the kind words :)

I'll add that translation to a future version.
Title: Re: Drafts
Post by: ilikeitalot on June 24, 2008, 03:52:17 PM
Great mod!  Makes it way easier to work on a long post over time.  This is also a great complement to your blog mod (http://custom.simplemachines.org/mods/index.php?mod=1209).  Thx!
Title: Re: Drafts
Post by: ilikeitalot on June 24, 2008, 03:56:08 PM
Quote1.02-
Fixed problem with replies.  Only allowed to save drafts of new topics (not replies).

Does this mean you *removed* the ability to save drafts with replies?  Actually, I'd prefer it to work with replies also.  Can you tell me how to manually add that back?  I haven't looked, but I assume it would just be a small change to Post.template.php?
Title: Re: Drafts
Post by: Charles Hill on June 24, 2008, 04:13:45 PM
I will add that functionality eventually... but at this time it would require a bit of work... most likely have to add columns to the drafts table.  Topic ID/ Message ID is not saved with the draft.  So if you loaded a draft that u saved originally as a reply, it would load up again as a new topic not a reply.

Don't worry I'll add it eventually.  :)
Title: Re: Drafts
Post by: jossanaijr on June 24, 2008, 04:17:53 PM
WOW.  Fantastic.
BTW as I understood to post I need to choose Modify and then post.  Right?  What about a Post button inside the draft?
Title: Re: Drafts
Post by: Charles Hill on June 24, 2008, 04:25:50 PM
Quote from: jossanaijr on June 24, 2008, 04:17:53 PM
WOW.  Fantastic.
BTW as I understood to post I need to choose Modify and then post.  Right?  What about a Post button inside the draft?

That is a good idea :)
I'll add that to the next version
Title: Re: Drafts
Post by: jossanaijr on June 24, 2008, 04:30:29 PM
To install the "Next Version" when available will user's drafts be saved?  I mean they will be not deleted when updating version?
Title: Re: Drafts
Post by: Charles Hill on June 24, 2008, 04:56:15 PM
Existing drafts in your drafts table will not be altered when installing a new version of this mod.
Title: Re: Drafts
Post by: fords8 on June 24, 2008, 07:02:26 PM
This is a cool mod Charles! I installed it by the package manager with the DS-Natural designed by DzinerStudio theme and it works great. No edits at all!

I will try it on the DarkBreak designed by DzinerStudio theme next and see what happens. EDIT: It worked with this theme also!
Title: Re: Drafts
Post by: Lady Night Owl on June 25, 2008, 12:57:15 AM
Great mod! I'm looking forward to your update also as I'd like to see this work with replies. But I know you just released this one, so for now - Kudos! :)
Title: Re: Drafts
Post by: Cal O'Shaw on June 25, 2008, 01:08:47 AM
Hello,

Looks super!  This is just what I need when writing up outage notices and procs.

A draft management question:

If a member is deleted, what happens to his drafts?  Do they get purged?  How do I clear them out if the member is already deleted?

Grazie,

Cal
Title: Re: Drafts
Post by: Charles Hill on June 25, 2008, 01:22:50 AM
Ahh I hadn't thought about when users are deleted.  I will likely modify some additional sources files to handle this.  You should note that when you load a draft and then post it, it is deleted from the drafts table.  So you won't be able to load a draft and post it multiple times, if that is what you intended to do with outage notices.
Title: Re: Drafts
Post by: Cal O'Shaw on June 25, 2008, 01:27:01 AM
Hello,

No, I'd continue to cut and paste.  What I like is that I can prepare all the text in advance, what steps will be performed, but hold it until I'm ready to announce.  And if I have to change dates I don't get that "last edit" line.

When I tried creating notices in an Admin Only area and moving them to Public I had to add a second post to bump it up, or do cut and paste.  You offer a much cleaner option.

Grazie!
Title: Re: Drafts
Post by: erlend_sh on June 25, 2008, 07:29:16 AM
A mod like this has been long awaited :) I hope you finish the new feature for the replies soon. Also see my 2.0 whine in your Blogmod thread ;D
Title: Re: Drafts
Post by: Charles Hill on June 25, 2008, 07:31:11 AM
Quote from: Sadr on June 25, 2008, 07:29:16 AM
A mod like this has been long awaited :) I hope you finish the new feature for the replies soon. Also see my 2.0 whine in your Blogmod thread ;D

1.03 supports replies and I added a couple other things too.  As I said in the blog mod thread, I won't be making mods for 2.0 until it is released as a final version.
Title: Re: Drafts
Post by: Sweetwater on June 25, 2008, 07:59:03 AM
Hi Charles,

Mode installed & works fine.

Many thanks.

Sweetwater 
Title: Re: Drafts
Post by: Soms on June 25, 2008, 05:41:15 PM
Cool mod  :D Here is the Dutch translation;

Quote// Drafts txt variables
$txt['permissionname_save_drafts'] = 'Kan topics als concept opslaan';
$txt['only_new_topics'] = 'Kan alleen nieuwe topics als concept opslaan.';
$txt['error_draft_not_saved'] = 'Er is iets fout gegaan. Het concept bericht is <b>niet</b> opgeslagen.';
$txt['draft_saved'] = 'Concept opgeslagen.';
$txt['draft'] = 'Concept';
$txt['showDrafts'] = 'Toon concept berichten';
$txt['no_drafts'] = 'Er zijn geen concept berichten te tonen.';
$txt['last_saved'] = 'Laatst opgeslagen';
$txt['lastSaved'] = 'Laatst opgeslagen';
$txt['delete_draft_confirm'] = 'Weet je zeker dat je dit concept wilt verwijderen?';
$txt['save_as_draft'] = 'Opslaan als concept';
$txt['draft_saved_short'] = 'Concept opgeslagen';
$txt['loadDrafts'] = 'Laad concept berichten';
$txt['hideDrafts'] = 'Verbergen';
$txt['post_draft_confirm'] = 'Weet je zeker dat je dit concept bericht wilt verzenden?';
$txt['drafts_postIt'] = 'Verzenden!';
Title: Re: Drafts
Post by: jossanaijr on June 25, 2008, 08:47:06 PM
Hi Charles,
just changed to the last version and there is one problem.  Images attached.

If I post using the "old" method (modify and post) it is ok.
But if I post using the new option "Post it" smiles are not shown.
Title: Re: Drafts
Post by: Charles Hill on June 25, 2008, 11:13:05 PM
Thank you all for the kind words.  Also, thank you for the dutch translation.

About the smilies issue... When you post things using the Post it! link from your profile, the post is created in default topic and message options (and smileys disabled).  I could add additional columns to the drafts table further detailing information about the draft (various settings you have selected when saving the draft), and then use those when you use the Post it! link.  I will do this eventually, as it would make for a more complete experience when using the drafts feature.
Title: Re: Drafts
Post by: jossanaijr on June 26, 2008, 12:00:29 AM
OK, thanks.
Title: Re: Drafts
Post by: Cal O'Shaw on June 26, 2008, 12:04:12 AM
Hello,

When the MOD is installed, what is the setting?  Is it off for everyone, on for everyone, on for Admin only?

I'd rather start with just Admins and another group being able to use it, and maybe later roll it out to everyone.  If it starts as "on" to everyone, I'll need to go to Maintenance Mode, install it, restrict it, and then leave Maintenance Mode.  And that involves giving notice, scheduling an outage, etc...

Grazie,

Cal
Title: Re: Drafts
Post by: Cal O'Shaw on June 26, 2008, 12:06:05 AM
And many thanks for addressing deleted members!  You're fast!
Title: Re: Drafts
Post by: Charles Hill on June 26, 2008, 12:10:42 AM
There are no settings with this mod.  There is just a permission (save_drafts).  When you give users this permission, they can use the drafts feature.
Title: Re: Drafts
Post by: Cal O'Shaw on June 26, 2008, 12:18:50 AM
Okay, but how do I give it, or withhold it?  Or does installing the MOD give it to everyone?  I'm sorry if I seem thick here, but that isn't clear.
Title: Re: Drafts
Post by: Charles Hill on June 26, 2008, 12:20:27 AM
When a permission is added, no membergroups have it (except the admin, because admins can do everything by default).  You have to enable the permission for a membergroup for members in that membergroup to use whatever that permission allows.
Title: Re: Drafts
Post by: Cal O'Shaw on June 26, 2008, 12:27:01 AM
Ah, so I go to Admin > Membergroups > Modify and click on a checkbox in that Membergroup's panel, yes?

If it's not a bother, maybe add a screenshot of that panel or a line in the MOD description saying how to enable for specific membergroups?

Grazie mille!
Title: Re: Drafts
Post by: ilikeitalot on June 26, 2008, 12:28:22 AM
Thx for adding the reply capability.  This mod is amazing.  Lots of fun even just playing around with it lol.  Such a great yet basic feature should be built-in to SMF imo.

The smileysEnabled defaulting to 0 with the Post It! is um... annoying.  Is there an easy way to hardcode that to be 1?  If not, that's OK, I'll just disable the Post It! link.
Title: Re: Drafts
Post by: Charles Hill on June 26, 2008, 12:34:45 AM
I will be adding lots columns to the drafts table that store all possible post settings that you had when you saved the draft.

@Cal O'Shaw

I'll make the save_drafts permission be in its own permission group called Drafts (so that it's easier to distinguish from other permissions).  I guess I could make a screen shot of where to enable it also.
Title: Re: Drafts
Post by: Sudhakar Arjunan on June 26, 2008, 02:14:23 AM
Hey Charles,

This mod is so useful for us.
Great Mod. you have upgraded version to 1.04 , did we have to reinstall and install .  :-\

And if you have a automatic Timer which stores the composed message as draft for every 30 sec.

So in case of network problem or some power supply problem , our message will be saved as draft.

Hope this could be very useful.

May be once the post is done, let the draft be deleted.

And even need the stats on Profile page says how many draft they made totally so far and limitations for each draft.

If possible seperate link in stats page for admin to see all the drafts page and no of drafts used and pending so far for guest users.  ;)

Thanks & Regards,
Sudhakar, IT Acumens
Title: Re: Drafts
Post by: jossanaijr on June 26, 2008, 07:09:39 AM
WOW. 1.04.  Working perfectly!  Thanks.!
Title: Re: Drafts
Post by: ilikeitalot on June 26, 2008, 11:48:04 AM
Quote1.04-
Added Dutch translation
Various post settings now saved with draft: smileysEnabled, locked, isSticky, and icon

Wow Charles, you are a machine!  Thanks for getting this stuff added.
Title: Re: Drafts
Post by: erlend_sh on June 26, 2008, 03:56:27 PM
Quote from: asudhakar on June 26, 2008, 02:14:23 AM(...)
And if you have a automatic Timer which stores the composed message as draft for every 30 sec.

So in case of network problem or some power supply problem , our message will be saved as draft.(...)
This would be an amazing feature, but I imagine it would be hard to do... If it works out then the Drafts mod will greatly broaden usefulness.
Title: Re: Drafts
Post by: Cal O'Shaw on June 26, 2008, 04:10:08 PM
Besides a lot of work on Mr. Hill's part, I would think you'd start chewing up bandwidth as every person composing a post or pm is sending sending and receiving every 30 seconds.  You may have ISP capacity issues.
Title: Re: Drafts
Post by: Charles Hill on June 26, 2008, 07:48:39 PM
Glad you all like the mod :)

QuoteMay be once the post is done, let the draft be deleted.
Drafts are deleted when you post them.

QuoteAnd if you have a automatic Timer which stores the composed message as draft for every 30 sec.

So in case of network problem or some power supply problem , our message will be saved as draft.
This might be possible.  I will look into it.  I am currently in the process of moving, so I won't get much done for a couple days.

QuoteAnd even need the stats on Profile page says how many draft they made totally so far and limitations for each draft.
I could add a settings page for this mod (in the admin area) where you can set the maximum number of drafts any one user can have.  I doubt having stats on how many drafts users have in their profile would be useful.  Seems like that would just be useless bloat.

QuoteIf possible seperate link in stats page for admin to see all the drafts page and no of drafts used and pending so far for guest users.
Guests can't use the drafts feature btw.
Title: Re: Drafts
Post by: Sakae on June 26, 2008, 11:37:07 PM
Great mod, thank you!

brazilian-utf8:

$txt['permissionname_save_drafts'] = 'Pode salvar rascunhos';
$txt['only_new_topics'] = 'Pode salvar apenas novos t&oacute;picos como rascunhos.';
$txt['error_draft_not_saved'] = 'Houve um erro e seu rascunho <b>n&atilde;o foi salvo</b>.';
$txt['draft_saved'] = 'Seu rascunho foi salvo com sucesso.</a>.';
$txt['draft'] = 'Rascunho';
$txt['showDrafts'] = 'Ver rascunho(s)';
$txt['no_drafts'] = 'Sem rascunhos salvos.';
$txt['last_saved'] = '&Uacute;ltima altera&ccedil;&atilde;o';
$txt['lastSaved'] = '&Uacute;ltima Altera&ccedil;&atilde;o';
$txt['delete_draft_confirm'] = 'Tem certeza que deseja apagar?';
$txt['save_as_draft'] = 'Salvar como rascunho';
$txt['draft_saved_short'] = 'Rascunhos salvos';
$txt['loadDrafts'] = 'Carregar rascunhos';
$txt['hideDrafts'] = 'Esconder';
$txt['post_draft_confirm'] = 'Confirme a publica&ccedil;&atilde;o da mensagem?';
$txt['drafts_postIt'] = 'Publicar';
Title: Re: Drafts
Post by: Cal O'Shaw on June 27, 2008, 11:24:00 PM
I noticed with 1.04 that everyone who is authorised to save drafts now has the "Show Drafts" link in their profile.  But unless one clicks on the link, one doesn't know if one has any drafts pending.  So it would really be helpful if there was some indicator to remind the member they have drafts (a count might be nice, but any sort of an indicator would be nice).

For Admins, it might be nice to know how many drafts are pending, maybe even counts of who has them, but to be honest, since the smf_drafts table gets compacted along with the other tables, and you purge drafts when a member is deleted, well, we don't get such stats on PMs either and seem to do just fine...

I'm getting good feedback from my test group, so at the risk of sounding like a broken record... Grazie mille!

Cal
Title: Re: Drafts
Post by: chrisb on June 28, 2008, 06:51:42 PM
Hi

We have installed this on version 1.1.5 and then applied this to the packages and when we goto find the link for the blog, we are unable to find it at all showing up, is there are reason why this might not work on a fresh install, also we are using the default template as well. what could be causing these issues.


Title: Re: Drafts
Post by: jossanaijr on June 28, 2008, 06:55:22 PM
Did not understand: link for the blog?  This is draft mod and after installation you need to give permission to members to use it.
Title: Re: Drafts
Post by: Charles Hill on June 29, 2008, 11:20:11 PM
Quote from: chrisb on June 28, 2008, 06:51:42 PM
Hi

We have installed this on version 1.1.5 and then applied this to the packages and when we goto find the link for the blog, we are unable to find it at all showing up, is there are reason why this might not work on a fresh install, also we are using the default template as well. what could be causing these issues.



This mod is separate from my blog mod.
Title: Re: Drafts
Post by: weightman on June 29, 2008, 11:24:41 PM
Although I don't feel up to trying to install this right now due to the number of mods installed I have, the likelihood of many manual edits being have to made, and the coming upgrades to 2.0 and 2.0 mod updates, I think this or some variation of user/moderator/admin rough drafts should be a base feature of 2.0 at all costs.

Cheers
Title: Re: Drafts
Post by: Cal O'Shaw on June 30, 2008, 12:43:45 AM
Hi,

My test users really like the drafts feature (judging by the size of the file savings when I optimise the tables :) ).

Any chance the next release will include an indicator in member profiles when they have one or more drafts pending?  Whether the link is in bold, or a number (3), or number and max (3 of 10), or in the page header (You have 3 of a maximum 10 drafts pending), any are fine, just something to remind people they have drafts pending.

Admin info such as "xx drafts pending for yy members" is a "nice to have" but not really needed.  As long as members know they have drafts pending.

Grazie!

Cal
Title: Re: Drafts
Post by: ilikeitalot on June 30, 2008, 12:18:26 PM
I've got a problem.  Whenever I click Save as Draft, it creates a NEW draft, even if one already exists for that post.  Then when I finally submit the post, the drafts are not deleted.  I installed this mod manually, so maybe I messed up somewhere.  Just wanted to make sure this isn't happening to everyone else.
Title: Re: Drafts
Post by: weightman on June 30, 2008, 12:47:56 PM
I changed my mind and installed this mod since it looked just so totally cool, and it is totally cool! Everything seems to be working great but I got this error in my log when I ran it through its paces. I think it happened when I posted the draft from my profile. I have many other mods installed including the topic description mod which it looks is causing this conflict and being bridged with Mambo through Orstio's bridge. Thank you very much for this great mod and any info on this would be great.

http://weightliftingexchange.com/smf/index.php?option=com_smf&amp;Itemid=39&amp;action=profile;sa=showDrafts;u=9;sesc;postDraft=1

8: Undefined index: description
File: /home/notrealname/public_html/smf/Sources/Subs-Post.php
Line: 1537

Lines 1532-1539
// Insert the post. -Topic description MOD- query modified
db_query("
INSERT INTO {$db_prefix}messages
(ID_BOARD, ID_TOPIC, ID_MEMBER, subject, description, body, posterName, posterEmail, posterTime,
posterIP, smileysEnabled, modifiedName, icon)
VALUES ($topicOptions[board], $topicOptions[id], $posterOptions[id], SUBSTRING('$msgOptions[subject]', 1, 255), SUBSTRING('$msgOptions[description]', 1, 255), SUBSTRING('$msgOptions[body]', 1, 65534), SUBSTRING('$posterOptions[name]', 1, 255), SUBSTRING('$posterOptions[email]', 1, 255), " . time() . ",
SUBSTRING('$posterOptions[ip]', 1, 255), " . ($msgOptions['smileys_enabled'] ? '1' : '0') . ", '', SUBSTRING('$msgOptions[icon]', 1, 16))", __FILE__, __LINE__);
$msgOptions['id'] = db_insert_id();
Title: Re: Drafts
Post by: Charles Hill on June 30, 2008, 06:31:15 PM
Quote from: ilikeitalot on June 30, 2008, 12:18:26 PM
I've got a problem.  Whenever I click Save as Draft, it creates a NEW draft, even if one already exists for that post.  Then when I finally submit the post, the drafts are not deleted.  I installed this mod manually, so maybe I messed up somewhere.  Just wanted to make sure this isn't happening to everyone else.
Ya you must have missed something in Post.php.  Check the install.xml file for the edits made to Post.php and make sure you have them all and in the right places.

@weightman...

It sounds like the topic description mod is causing a problem here.  If you could also post for me the part of your Post.template.php (default theme) that shows the input field for the topic description, I think I can add the necessary code to the drafts mod to make it work for those who are using the topic description mod.
Title: Re: Drafts
Post by: Nibogo on June 30, 2008, 06:48:18 PM
Really nice , great mod!!
Title: Re: Drafts
Post by: weightman on June 30, 2008, 06:55:05 PM
Charles, this what you need? Thanks very much!

Lines 447-457 of Post.template.php:

<!-- //-Topic description MOD- Start -->
', (!empty($context['is_first_post']) ?
'<tr>
<td align="right" style="font-weight: bold;" id="caption_description">
'. $txt['topic_description']. ':
</td>
<td>
<input type="text" name="description" value="'. $context['description'] .'" tabindex="'. $context['tabindex']++. '" size="80" maxlength="80" />
</td>
</tr>':'<input type="hidden" name="description" value="" readonly />') ,'
<!-- //-Topic description MOD- End -->
Title: Re: Drafts
Post by: Charles Hill on June 30, 2008, 06:55:56 PM
Yes that works thanks :)

I'll tack that onto v1.05.
Title: Re: Drafts
Post by: ilikeitalot on June 30, 2008, 09:34:12 PM
Quote from: Charles Hill on June 30, 2008, 06:31:15 PM
Quote from: ilikeitalot on June 30, 2008, 12:18:26 PM
I've got a problem.  Whenever I click Save as Draft, it creates a NEW draft, even if one already exists for that post.  Then when I finally submit the post, the drafts are not deleted.  I installed this mod manually, so maybe I messed up somewhere.  Just wanted to make sure this isn't happening to everyone else.
Ya you must have missed something in Post.php.  Check the install.xml file for the edits made to Post.php and make sure you have them all and in the right places.

Yep, you were correct.  I redid the changes to Post.php and all is well.  Thank you!
Title: Re: Drafts
Post by: Afro on July 02, 2008, 08:40:06 AM
Great mod, works straight on my dilber theme.
Good job
Title: Re: Drafts
Post by: Charles Hill on July 04, 2008, 06:49:15 PM
Just updated to v1.05.  Here are the changes/additions:

Added Brazilian translation
Additional post data now saved with drafts: blog categories, topic description.
Added counter to Show Drafts link in profile side window (only shows when count is greater than 0)
Title: Re: Drafts
Post by: weightman on July 04, 2008, 08:17:10 PM
Thanks for the update to work with the topic description mod...works great! And the draft counter is a great addition as well!
Title: Re: Drafts
Post by: Sudhakar Arjunan on July 05, 2008, 03:10:27 AM
Quote from: Charles Hill on July 04, 2008, 06:49:15 PM
Just updated to v1.05.  Here are the changes/additions:

Added Brazilian translation
Additional post data now saved with drafts: blog categories, topic description.
Added counter to Show Drafts link in profile side window (only shows when count is greater than 0)

hey Charles, nice updates.
i have already installed v1.03, and all users were already using Draft.
did i have to uninstall and reinstall to get this latest version work.

Help me Charles.
Title: Re: Drafts
Post by: Charles Hill on July 05, 2008, 03:25:08 AM
Yes you will have to uninstall and then reinstall.  Don't worry, all the stuff in your database will be unchanged by the uninstall and reinstall.
Title: Re: Drafts
Post by: Sudhakar Arjunan on July 05, 2008, 03:30:14 AM
Quote from: Charles Hill on July 05, 2008, 03:25:08 AM
Yes you will have to uninstall and then reinstall.  Don't worry, all the stuff in your database will be unchanged by the uninstall and reinstall.

Ok Charles, will do it right now.
Thanks and will report incase of any issue? Hope Strongly, it will not.
Title: Re: Drafts
Post by: Charles Hill on July 05, 2008, 03:41:36 AM
You should probably download it again.  I left one bit out related to topic description mod compatibility and I think I forgot to update the zip archive to 1.05 anyways.  1.06 is correct.  Sorry about that.
Title: Re: Drafts
Post by: Sudhakar Arjunan on July 05, 2008, 03:45:34 AM
Quote from: Charles Hill on July 05, 2008, 03:25:08 AM
Yes you will have to uninstall and then reinstall.  Don't worry, all the stuff in your database will be unchanged by the uninstall and reinstall.

Hey Charles,
You made this update so cool.

I have uninstalled and installed and now its working perfectly.

But i have two suggestions for you,

One - drafts_smf11x.zip - old & new file name or same. So i have to delete that package and reupload.
If i have some bugs in this update, then for time being i have to reupload the file and have to install it again , instead you could change the name of update.

Second - Updates : Additional post data now saved with drafts: blog categories, topic description.
Kindly Add Tags field also if possible.

And i have already asked to make the post saved every 2 minutes, and hope you have added it to your todo list.

Thanks for this Excellent Mod.
Title: Re: Drafts
Post by: Sudhakar Arjunan on July 05, 2008, 03:46:43 AM
Quote from: Charles Hill on July 05, 2008, 03:41:36 AM
You should probably download it again.  I left one bit out related to topic description mod compatibility and I think I forgot to update the zip archive to 1.05 anyways.  1.06 is correct.  Sorry about that.

Just now done.
Anyhow, thank you for it Charles.
Will Delete and Reupload once.
Title: Re: Drafts
Post by: Sudhakar Arjunan on July 05, 2008, 03:58:28 AM
Hey Charles,

Installed 1.06 - Went to profile and click on Post it button.

And it showed me this error.

Unknown column 'topicDescription' in 'field list'
File: /home/itacumen/public_html/forum/Sources/Profile.php
Line: 3712

Note: It appears that your database may require an upgrade. Your forum's files are currently at version SMF 1.1.5, while your database is at version 1.1.1. The above error might possibly go away if you execute the latest version of upgrade.php.


Any suggestion.
Title: Re: Drafts
Post by: Charles Hill on July 05, 2008, 04:03:10 AM
Yea I see what the problem is.... I forgot to add something to the add_settings.php file.  Sigh.... this is what happens when I try to do stuff when I'm really tired :(

I'll update it to v1.07 with the corrections to add_settings.php.  One minute.
Title: Re: Drafts
Post by: Soms on July 05, 2008, 04:45:44 AM
I have just installed 1.07.  I clicked on profle and got this error;

QuoteFatal error: Cannot redeclare showdrafts() (previously declared in /mnt/web4/21/50/51458650/htdocs/Sources/Profile.php:3171) in /mnt/web4/21/50/51458650/htdocs/Sources/Profile.php on line 3219

Will you please check it out?
Title: Re: Drafts
Post by: Charles Hill on July 05, 2008, 04:50:41 AM
That means there are two instances of the showdrafts() function.  You'll have to open up your Sources/Profile.php file and remove the old instance.
Title: Re: Drafts
Post by: Soms on July 05, 2008, 04:51:59 AM
Btw this is the updated Dutch translation for 1.07

Quote// Drafts txt variables
$txt['permissiongroup_drafts'] = 'Conceptberichten';
$txt['permissionname_save_drafts'] = 'Kan topics als concept opslaan';
$txt['only_new_topics'] = 'Kan alleen nieuwe topics als concept opslaan.';
$txt['error_draft_not_saved'] = 'Er is iets fout gegaan. Het concept bericht is <b>niet</b> opgeslagen.';
$txt['draft_saved'] = 'Concept opgeslagen.';
$txt['draft'] = 'Concept';
$txt['showDrafts'] = 'Toon concept berichten';
$txt['no_drafts'] = 'Er zijn geen concept berichten te tonen.';
$txt['last_saved'] = 'Laatst opgeslagen';
$txt['lastSaved'] = 'Laatst opgeslagen';
$txt['delete_draft_confirm'] = 'Weet je zeker dat je dit concept wilt verwijderen?';
$txt['save_as_draft'] = 'Opslaan als concept';
$txt['draft_saved_short'] = 'Concept opgeslagen';
$txt['loadDrafts'] = 'Laad concept berichten';
$txt['hideDrafts'] = 'Verbergen';
$txt['post_draft_confirm'] = 'Weet je zeker dat je dit concept bericht wilt verzenden?';
$txt['drafts_postIt'] = 'Verzenden!';

PM me for future language modifications  ;D
Title: Re: Drafts
Post by: Soms on July 05, 2008, 04:53:22 AM
Quote from: Charles Hill on July 05, 2008, 04:50:41 AM
That means there are two instances of the showdrafts() function.  You'll have to open up your Sources/Profile.php file and remove the old instance.

Ok I'll go check.
Title: Re: Drafts
Post by: Soms on July 05, 2008, 05:51:26 AM
Quote from: Soms on July 05, 2008, 04:53:22 AM
Quote from: Charles Hill on July 05, 2008, 04:50:41 AM
That means there are two instances of the showdrafts() function.  You'll have to open up your Sources/Profile.php file and remove the old instance.

Ok I'll go check.

No luck. The profile.php file is messed up now. I'll try and work it out later. I have to go get some stuff in the city now.
Title: Re: Drafts
Post by: erlend_sh on July 05, 2008, 07:17:05 AM
I searched "poll" but no hits, so I'll just ask:
Does this mod work with polls? Could I make a poll, then save the whole thing in drafts (including poll question and options of course), just to post it on a later date?
Title: Re: Drafts
Post by: Lady Night Owl on July 05, 2008, 11:14:36 AM
Quote from: Sadr on July 05, 2008, 07:17:05 AM
I searched "poll" but no hits, so I'll just ask:
Does this mod work with polls? Could I make a poll, then save the whole thing in drafts (including poll question and options of course), just to post it on a later date?

I've tried to make a poll and save it, but it only saved the post - that would be a nice addition to a future version of this mod.

Also, if you can (this might be a little too much, I don't know) but it would be neat to be able to save private messages as drafts as well. If you could work that into a future release that would be great, but if not, no biggie. :)
Title: Re: Drafts
Post by: Charles Hill on July 05, 2008, 03:06:51 PM
Ya I'll work on polls and private messages.  Right now I'm working on v1.08 of my blog mod though.
Title: Re: Drafts
Post by: Lady Night Owl on July 05, 2008, 03:07:55 PM
Thanks! No rush. :)
Title: Re: Drafts
Post by: Charles Hill on July 05, 2008, 03:25:09 PM
@Soms...
Are you sure you uninstalled the previous version properly?
Title: Re: Drafts
Post by: Soms on July 06, 2008, 11:36:22 AM
Now I get this!

QuoteFatal error: Cannot redeclare template_showdrafts() (previously declared in /mnt/web4/21/50/51458650/htdocs/Sources/Load.php(1781) : eval()'d code:2566) in /mnt/web4/21/50/51458650/htdocs/Sources/Load.php(1781) : eval()'d code on line 2622
Title: Re: Drafts
Post by: Sudhakar Arjunan on July 06, 2008, 12:21:11 PM
Hey Charles, Thanks for it. Now V1.07 is working perfectly.

When i went through profile page, it showed one draft and when i clicked post it .

That as posted in the category perfectly.

Thanks charles for this Great Mod.
Title: Re: Drafts
Post by: Charles Hill on July 06, 2008, 03:25:10 PM
Quote from: Soms on July 06, 2008, 11:36:22 AM
Now I get this!

QuoteFatal error: Cannot redeclare template_showdrafts() (previously declared in /mnt/web4/21/50/51458650/htdocs/Sources/Load.php(1781) : eval()'d code:2566) in /mnt/web4/21/50/51458650/htdocs/Sources/Load.php(1781) : eval()'d code on line 2622

It's sounding like you didn't uninstall the previous version of the drafts mod when you installed v1.07.  Delete the older instance of template_showDrafts() in your Profile.template.php file.
Title: Re: Drafts
Post by: Soms on July 06, 2008, 03:46:33 PM
Quote from: Charles Hill on July 06, 2008, 03:25:10 PM

It's sounding like you didn't uninstall the previous version of the drafts mod when you installed v1.07.  Delete the older instance of template_showDrafts() in your Profile.template.php file.

The problem is resolved now. I did actually uninstall the previous version. At least I did automatically. But some stuff in the files you mentioned were somehow not automatically removed. I've done that manually now and installed the latest version. It is working ok.
Title: Re: Drafts
Post by: Matthew Schenker on July 16, 2008, 08:58:31 AM
Good Morning,
This is a great idea!  I've been wanting to add something like this to my forum for a while, so thanks for developing it.

Quick question: is there a way to only give "draft" rights to certain members?

Thanks,
Matthew
Title: Re: Drafts
Post by: Sakae on July 16, 2008, 10:06:10 AM
Use the permission system. I only give this feature for certain groups.

I'm using SMF 1.1.5
Title: Re: Drafts
Post by: Matthew Schenker on July 16, 2008, 10:17:10 AM
Quote from: softcore on July 16, 2008, 10:06:10 AM
Use the permission system. I only give this feature for certain groups.

I'm using SMF 1.1.5

OK, thanks.  Yes, I see that now!  I've never quite gotten used to the permissions system.
Thanks again for the help!
This is a great modification.
Matthew
Title: Re: Drafts
Post by: kizley on July 28, 2008, 03:29:20 PM
hi,


İam using default version SMF 1.5
i am Admin of my site,this feature is working very well for me but my other members cant view this.How do i set this now?
they can only see------------post  preview  spellcheck
Title: Re: Drafts
Post by: kizley on July 28, 2008, 03:37:15 PM
Ohhh i get the answer,pls ignore my above post.
Title: Re: Drafts
Post by: Kimmie on July 31, 2008, 02:43:21 AM
when I post drafts from my profile - all my posts are getting a bunch of garbled code added to them that shouldnt be there. Code like <br /><br /> and a bunch of &'s.


When you click on Additional options and post it that way, all that garbled code doesnt show up.

Any ideas how to fix this?
Title: Re: Drafts
Post by: SunilDVR on August 12, 2008, 07:05:38 PM
This is an excellent mod - thank you for taking the time to create it.

Once SMF 2 is released properly, will you be updating the mod to make it compatible?
Title: Re: Drafts
Post by: Charles Hill on August 12, 2008, 07:40:49 PM
Yes, when I have time.
Title: Re: Drafts
Post by: Kimmie on August 13, 2008, 07:09:38 PM
Quote from: Kimmie on July 31, 2008, 02:43:21 AM
when I post drafts from my profile - all my posts are getting a bunch of garbled code added to them that shouldnt be there. Code like <br /><br /> and a bunch of &'s.


When you click on Additional options and post it that way, all that garbled code doesnt show up.

Any ideas how to fix this?

bumping this up. Any resolutions on this yet?
Title: Re: Drafts
Post by: Charles Hill on August 13, 2008, 07:47:57 PM
Unsure as to what might be causing that problem.  I don't have any time to look at that right now, either.  Sorry :(
Title: Re: Drafts
Post by: Kimmie on August 14, 2008, 04:02:55 PM
Quote from: Charles Hill on August 13, 2008, 07:47:57 PM
Unsure as to what might be causing that problem.  I don't have any time to look at that right now, either.  Sorry :(

Its mostly adding <br /> and its doing it when there are multiple things put in the post such as images and text. Its putting the code after each place there is a line break (or each place it "thinks" there should be one). It appears that part of the draft mod code may not be handling line breaks correctly so its trying to add the break in html format and the tags are showing up because html tags are not accepted in posts.

Also, when you use the character "&", it is adding this instead "&amp;"

I dont know that much about coding but it appears it thinks that whatever is being posted is in html format and it should treat it as such.
Title: Re: Drafts
Post by: Charles Hill on August 14, 2008, 04:52:55 PM
Ok I just looked at the code around where the posting of drafts as new topics/replies from the Show Drafts page and seem to have come up with a solution for you.

Find in Sources/Post.php:
// sanitize and prepare for entry into the database
$msgOptions['body'] = addslashes($func['htmlspecialchars']($msgOptions['body'], ENT_QUOTES));
$msgOptions['subject'] = addslashes($func['htmlspecialchars']($msgOptions['subject'], ENT_QUOTES));

Note: the comment may be different

Replace with the following:
// sanitize and prepare for entry into the database
$bodyText = addslashes($func['htmlspecialchars']($msgOptions['body'], ENT_QUOTES));
$subject = addslashes($func['htmlspecialchars']($msgOptions['subject'], ENT_QUOTES));

And in the INSERT INTO database query AND the UPDATE database query after that... Replace $msgOptions['body'] with $bodyText... and... Replace $msgOptions['subject'] with $subject


Now in Sources/Profile.php....
Find:
// let's set some variables before we create the post
$posterOptions['id'] = $memID;

$msgOptions['body'] = $row['body'];
$msgOptions['subject'] = $row['subject'];

Replace with the following:
// let's set some variables before we create the post
$posterOptions['id'] = $memID;

$msgOptions['body'] = un_htmlspecialchars($row['body']);
$msgOptions['subject'] = un_htmlspecialchars($row['subject']);

That should do it.
Title: Re: Drafts
Post by: Kimmie on August 14, 2008, 05:19:16 PM
I'm running a back up at the moment so as soon as it finishes I will do the above and let you know how it goes :)
Title: Re: Drafts
Post by: Cal O'Shaw on August 14, 2008, 05:56:24 PM
Charles,

Will you be updating the MOD with this fix?

And I really hate to ask, as I really appreciate that you've shared this MOD with us, but have you had a chance to look at when the MOD will support PMs?

Grazie mille,

Cal
Title: Re: Drafts
Post by: Charles Hill on August 14, 2008, 06:10:56 PM
Presently all my free time is going towards finishing v1.12 of Blog: Community.  About a month ago I did look at the code of SMF to get a rough estimate of how much of a pain supporting PMs would be..... It didn't look good...  I doubt I'll ever support PMs with drafts.  The only way I'd ever add PM support would be if someone paid me to do so.  Sorry :(
Title: Re: Drafts
Post by: Cal O'Shaw on August 14, 2008, 06:22:21 PM
No need to apologise, truly.  This MOD is great for posts.  I've held off rolling it out to my general membership only because I was waiting to see what you decided about PMs and polls.  If you have the time to put the fix into the MOD I'm going to wait to uninstall the 1.07 version, install 1.08(?), and then announce it.

Thanks for all your hard work on this :).

Cal
Title: Re: Drafts
Post by: Kimmie on August 14, 2008, 06:58:48 PM
can you be a bit more specific on this part"

And in the INSERT INTO database query AND the UPDATE database query after that... Replace $msgOptions['body'] with $bodyText... and... Replace $msgOptions['subject'] with $subject


sorry.. im not totally sure what to do here :)


nm I figured it out :). I will be testing it in a little bit to make sure it corrected the problem.
Title: Re: Drafts
Post by: Kimmie on August 14, 2008, 11:42:03 PM
Unfortunately, that  didnt fix it :(
Title: Re: Drafts
Post by: Charles Hill on August 15, 2008, 01:14:01 AM
Really...... I tested the & and the line breaks and managed to replicate the problem you were having.  I then fixed it with the fixes I gave you above.  Perhaps I did other things when I was working on v1.08 a month or so ago...... When I get some time I'll look into it.
Title: Re: Drafts
Post by: Kimmie on August 15, 2008, 08:16:02 AM
Quote from: Charles Hill on August 15, 2008, 01:14:01 AM
Really...... I tested the & and the line breaks and managed to replicate the problem you were having.  I then fixed it with the fixes I gave you above.  Perhaps I did other things when I was working on v1.08 a month or so ago...... When I get some time I'll look into it.

no problem. I will just make sure and remind staff they need to keep a close eye on posts for a bit longer. I have attached both those files so you can look at the edits I made. I am always careful whenever I make edits however, that doesnt mean mistakes cant be made lol
Title: Re: Drafts
Post by: Ncen on August 23, 2008, 01:15:47 PM
Is it possible to make the ;sa=showDrafts -page viewable to everyone? For my site, that would be really useful. :D What changes do i have to make to the code for this to be possible?
Title: Re: Drafts
Post by: Charles Hill on August 23, 2008, 04:10:17 PM
Do you mean make a member's show drafts page viewable to other users?   Hmmm, because of how the profile page is structured in SMF, you would have to modify several parts of the Sources/Profile.php to affect the overall permission of a profile page.  Then there are a few things you'd have to edit in the show drafts page itself to make sure only the profile owner can see certain links.

I suggest you open up Sources/Profile.php and do searches for the word "draft".  This should show you all the bits of code in the file that have to do with drafts.  There are lots of comments.  Just remember that in the showDrafts function you HAVE TO prevent users who are guests, are not the profile owner, or are not allowed to save drafts from using the delete, modify, post drafts bit of that function.  Also you will want to make only the edit, delete, post links visible to the profile owner.
Title: Re: Drafts
Post by: Ncen on August 23, 2008, 10:26:16 PM
Quote from: Charles Hill on August 23, 2008, 04:10:17 PM
Do you mean make a member's show drafts page viewable to other users?
Yes! ^^ That's it. :) I'll take a look at the Sources/Profile.php then, ^^' The links and that, do i edit that too in Sources or is that in themes? :)

Also, if possible, could you tell how you made sa=showdrafts? I've been trying to create a new sa=x page in the profile viewable for other users for showing information from customfields without success. I of course do understand if you prefer not to explain since it's of topic but I've been trying to solve this for months so it would be greatly appreciated. A PM would be fine if you would like the topic free from of topic-talk. ^^

Thanks in advance.
Inno.
Title: Re: Drafts
Post by: Charles Hill on August 24, 2008, 12:02:26 AM
The edit, post, modify links for the show drafts page you will have to put flags on.  A flag is a condition that determines whether or not to display something (if then statement).

It took me a while to figure out how the profile pages worked too.  It's very different from the rest of SMF.  If you want to add a new page of your own... just find the place where the draft code is, and you should be able to figure out how it works.  It's all in the Profile sources folder.  The template function is just what you want to be displayed by the function you make in the Profile page.  HINT: whatever your new sub-action (sa) is... your template function and your new function in the source folder should use that subaction name.... template_subAction() and subAction($memID)

Hope that helps :)
Title: Re: Drafts
Post by: Marcus Forsberg on September 01, 2008, 01:34:59 PM
Swedish translation:

$txt['permissiongroup_drafts'] = 'Utkast';
$txt['permissionname_save_drafts'] = 'Kan spara meddelanden i utkast';
$txt['only_new_topics'] = 'Kan endast spara nya ämnen i utkast.';
$txt['error_draft_not_saved'] = 'Ett fel inträffade och utkastet sparades <b>inte</b>.';
$txt['draft_saved'] = 'Utkastet sparades utan problem.';
$txt['draft'] = 'Utkast';
$txt['showDrafts'] = 'Visa utkast';
$txt['no_drafts'] = 'Du har inga utkast att visa.';
$txt['last_saved'] = 'Senaste sparade';
$txt['lastSaved'] = 'Senast sparade';
$txt['delete_draft_confirm'] = 'Vill du verkligen radera utkastet?';
$txt['save_as_draft'] = 'Spara i utkast';
$txt['draft_saved_short'] = 'Utkast sparat';
$txt['loadDrafts'] = 'Ladda utkast';
$txt['hideDrafts'] = 'Dölj';
$txt['post_draft_confirm'] = 'Är du säker på att du vill posta detta utkast?';
$txt['drafts_postIt'] = 'Posta!';
Title: Re: Drafts
Post by: Cal O'Shaw on September 02, 2008, 01:28:47 AM
Hello,

I've just had two of our moderators report that when they are working on a sticky topic and create a draft, when they post it the sticky attribute is lost.

Have you encountered this, or is this mayhap an attribute not currently captured?

Grazie,

Cal
Title: Re: Drafts
Post by: Charles Hill on September 02, 2008, 01:32:41 AM
I'm pretty sure that all those basic topic attributes were saved with drafts in v1.07.... I am unsure, though.  I'm going to revise this mod after I release Blog Community 2.0.1 Beta.
Title: Re: Drafts
Post by: Cal O'Shaw on September 02, 2008, 01:38:21 AM
Grazie mille!

Both for the rapid reply as well as planning to look into this.  We're running on 1.07, btw.

Not to press in the slightest, but to give our moderators feedback, do you have any sort of time frame in mind (weeks or months works quite well)?  It's appreciated that you volunteer to do this sort of thing.

Title: Re: Drafts
Post by: Charles Hill on September 02, 2008, 02:10:05 AM
Let's go with 2-3 weeks :)
Title: Re: Drafts
Post by: Sudhakar Arjunan on September 02, 2008, 02:46:21 AM
I have one request. Once you go for the updated version , kindly help us providing the auto update function from earlier version to current version which will be highly useful. Instead of uninstalling and installing the drafts mod.
Title: Re: Drafts
Post by: Charles Hill on September 12, 2008, 10:06:33 PM
Just updated to 1.08!

*fixed* issue with posting a draft from the drafts page in your profile (it would not undo htmlspecialcharacters)
*fixed* now compatible with Blog Community 2.0.2 Beta
Title: Re: Drafts
Post by: Kimmie on September 12, 2008, 11:37:08 PM
Can the new version be installed as an upgrade or do we need to unistall the older version first?
Title: Re: Drafts
Post by: Charles Hill on September 12, 2008, 11:50:41 PM
Sorry.  Have to uninstall the previous version.  But it's only like 8 edits :)
Title: Re: Drafts
Post by: Cal O'Shaw on September 13, 2008, 12:16:02 AM
Hello,

Did you find anything about sticky topics becoming unsticky that you were able to address in 1.08?

Grazie
Title: Re: Drafts
Post by: Charles Hill on September 13, 2008, 12:24:47 AM
I just did a test save of a topic with the sticky this topic checkbox checked... then went to the show drafts page... went to modify and it was still checked.  Then I went back to the drafts page and posted the draft as a topic from there.  It was stickied.  So I guess it didn't need addressing :)
Title: Re: Drafts
Post by: Cal O'Shaw on September 13, 2008, 12:28:56 AM
Unfortunately, I just finished my test and it didn't work.

Went into a sticky topic and did the following (text of the post, used as a test progress):

test of 1.08.  Using REPLY to create a post. (done)  Then using save as draft. (done)  Then checking to see if topic is still sticky. (done)  Then going into draft and posting draft. (done)  Then checking if still sticky. (fail)
Title: Re: Drafts
Post by: Cal O'Shaw on September 13, 2008, 12:35:25 AM
Clarification:  I did not use the POST IT! link.  I edited the post, then clicked Post.

Sorry for lack of clarity.
Title: Re: Drafts
Post by: Charles Hill on September 13, 2008, 12:38:29 AM
You can't use drafts when editing something you've already posted.  You can use drafts when modifying a draft though :)
Title: Re: Drafts
Post by: Cal O'Shaw on September 13, 2008, 12:47:20 AM
I understand that.  I did not do that.

-went to a sticky topic
-went to last post
-clicked "reply" button
-typed the test message as above, without the () results.
-clicked "save as draft"
-went to board index
-checked topic was still marked as sticky (yes)
-went to my profile
-clicked on "Show Drafts (1)"
-clicked on "Modify"
-edited the draft, adding in () result data.
-clicked on "post"
-went to board index
-checked topic was still marked as sticky (NO)

Do you get the same results with these steps?


Title: Re: Drafts
Post by: Charles Hill on September 13, 2008, 01:00:33 AM
Replies can't be sticky?
Title: Re: Drafts
Post by: Cal O'Shaw on September 13, 2008, 01:04:15 AM
Well, if I reply in a sticky topic and just hit post, the topic stays sticky.  If I save the reply as a draft, then finish it and post it, it makes the topic unsticky, requiring manual "make sticky".

I don't think that should happen.
Title: Re: Drafts
Post by: Charles Hill on September 13, 2008, 01:05:01 AM
Ooooooh.... I did not understand what you were saying.  ya you're right.  That shouldn't happen.  I'll fix it :)
Title: Re: Drafts
Post by: Cal O'Shaw on September 13, 2008, 01:06:46 AM
Grazie mille!
Title: Re: Drafts
Post by: Sudhakar Arjunan on September 13, 2008, 02:26:39 AM
Hi you have came with 1.0.8 Draft Version. Could  i know the 8 edits you have did so that i could manually upgrade the package with mod parser.

Because when i try to uninstall 1.0.7 Draft, it show two error.

1.   Execute Modification   ./Sources/ManagePermissions.php   Test failed
5.   Execute Modification   ./Themes/default/Post.template.php   Test failed

So i would like to manually update the mod.
Title: Re: Drafts
Post by: Sudhakar Arjunan on September 13, 2008, 03:00:10 AM
Hi Charles, I have tried to install 2.0.2 beta in my smf 1.1.6

Noted two error test failed fails.

11.   Execute Modification   ./Sources/Recent.php   Test failed
22.   Execute Modification   ./Themes/default/index.template.php   Test failed

Used the parser to manually check the files and found these simple errors,

In Default/Index.template.php file,

Find : <meta name="description" content="', $context['page_title'], '"

Present in my file as :    <meta name="description" content="', $context['page_title'], (!empty($context['description']) ? ' - '. $context['description'] : '') , '" />', empty($context['robot_no_index']) ? '' : '

So that gives me a issue.

In Source/Recent.php file,

Find : WHERE ml.ID_MSG = b.ID_LAST_MSG" .

Present in my file as : WHERE ml.ID_MSG = b.ID_LAST_MSG" . (!empty($modSettings['recycle_enable']) && $modSettings['recycle_board'] > 0 ? "

Find : WHERE b.ID_CAT IN (" . implode(', ', $_REQUEST['c']) . ")

Present in two lines : Line 237 & Line 1375 So conflict occurs

Give me a solution for the above errors.

I have attached the index.template file and recent file.

Kindly help me to modify it, i will install with errors and then replace the edited file charles.

Help me with the felblog conversion tool also.  :)


I have mistakenly posted in drafts mod instead of Charles Blog Mod.

http://www.simplemachines.org/community/index.php?topic=244848.msg1708368#msg1708368
Title: Re: Drafts
Post by: Charles Hill on September 13, 2008, 12:58:37 PM
This is the drafts mod thread.... You are asking about the Blog Community mod.
Title: Re: Drafts
Post by: jkrlvgn on September 13, 2008, 02:38:11 PM
First off, Mr. Asudhakar, let me say that you've missed the topic (as pointed out by Mr. Hill).  This isn't the support thread for Blog Community.  The Blog Community support threads are:

http://www.simplemachines.org/community/index.php?topic=244848.new#new (http://www.simplemachines.org/community/index.php?topic=244848.new#new)
and
http://degreesofzero.com/index.php/board,6.0.html (http://degreesofzero.com/index.php/board,6.0.html)

so please, in the future, refer to the correct support thread to allow the correct answers to your questions.

Granted, I'm not the developer for this Simple Machines modification, but I have to say that I do use it, and had no trouble installing it.  I might add that I've got a fairly heavily modified forum, most of which were manual edits for things other than Blog Community, because they didn't seem to fit in well with eachother.  Most often, if you're looking for support, you want to go ahead and list what you've got, such as a COMPLETE list of installed modifications so that it can be determined where the problem lies.



As for your particular issue, it's actually not that hard of a problem to fix.  If you take a moment and open your eyes to what you're looking at, you'd see that you've already answered part of your first question.

Find : <meta name="description" content="', $context['page_title'], '"

Your file has:

<meta name="description" content="', $context['page_title'], (!empty($context['description']) ? ' - '. $context['description'] : '') , '" />', empty($context['robot_no_index']) ? '' : '

Well...all you're looking for is:

<meta name="description" content="', $context['page_title'],

That is what you want to change.  Right there.  The other stuff, obviously, stays where it is.  I know that it's not the easiest thing to do...you know, reading and comprehending, but that was one that was staring you in the face.  Try to take a few steps before you decide that you need someone to hold your hand for you.


The second error...well...it's obviously going to be the same as the first.

You found the string that needed to be found:

WHERE ml.ID_MSG = b.ID_LAST_MSG" . (!empty($modSettings['recycle_enable']) && $modSettings['recycle_board'] > 0 ? "

And you're changing the part that says:

WHERE ml.ID_MSG = b.ID_LAST_MSG" .

OMFG!  HOW DID THAT GET IN THERE?  It must have been hiding, you know, between the lines of text that you were looking at, but didn't recognize.

As for the last, if you pull up a copy of recent.php on my system, there's only one instance of that string.

Look for the rest of this:

$request = db_query("
SELECT b.ID_BOARD, b.numPosts
FROM {$db_prefix}boards AS b
WHERE b.ID_CAT IN (" . implode(', ', $_REQUEST['c']) . ")" . (!empty($modSettings['blogMode']) && !empty($modSettings['hideBlogPostsFromForumRecentPosts']) ? "
AND b.blog_board != 1" : '') . "
AND $user_info[query_see_board]", __FILE__, __LINE__);
$total_cat_posts = 0;
$boards = array();
while ($row = mysql_fetch_assoc($request))


In your file, you've got the same thing twice.  Change the first one, and see why you have a second one in there as well.  I doubt that it's there on purpose, as I don't have it on mine.

There you go.  Easy problems, easy fixes.  Requires a little thing called thought.
Title: Re: Drafts
Post by: Kimmie on September 13, 2008, 04:58:55 PM
Just started seeing this error:

8: Undefined index: description
File: /home//public_html/Sources/Post.php
Line: 1743

Line 1743 is part of the draft mod:

Quote// are we modifying a draft? weird huh?
      if (isset($_POST['draftID'])) {
         
         if ($context['is_draft_author']) {
            db_query("
               UPDATE {$db_prefix}drafts
               SET boardID = $topicOptions[board],
                  topicID = '$topicID',
                  isSticky = '$topicOptions[sticky_mode]',
                  locked = '$topicOptions[lock_mode]',
                  smileysEnabled = '$smileysEnabled',
                  categoryID = '$categoryID',
                  icon = '$msgOptions[icon]',
                  body = '$msgOptions[body]',
                  subject = '$msgOptions[subject]',
                  topicDescription = '$msgOptions[description]',  
                  timestamp = '". time() ."'
               WHERE draftID = $draftID
                  AND memberID = $ID_MEMBER
               LIMIT 1", __FILE__, __LINE__);
               
            $context['draft_saved'] = true;

Not even sure why that is even in there because Topic Descriptions is not a default feature of 1.1.5 and I do not have the Topic Description mod installed either. Do I need to remove that line?
Title: Re: Drafts
Post by: Charles Hill on September 13, 2008, 07:33:35 PM
Ya you can remove that line... I kinda hastily made changes to this mod :(   I'll add flags to make sure variables are set before it tries to use them.  Also I'll figure out how to fix the issue of posting reply drafts to stickied topics (makes them unstickied apparently).
Title: Re: Drafts
Post by: Sudhakar Arjunan on September 14, 2008, 10:59:34 PM
Hi jkrlvgn,

Thanks for taking your time to explain my fault.

Thanks a lot.
Title: Re: Drafts
Post by: Sudhakar Arjunan on September 14, 2008, 11:00:45 PM
Hi you have came with 1.0.8 Draft Version. Could  i know the 8 edits you have did so that i could manually upgrade the package with mod parser.

Because when i try to uninstall 1.0.7 Draft, it show two error.

1.   Execute Modification   ./Sources/ManagePermissions.php   Test failed
5.   Execute Modification   ./Themes/default/Post.template.php   Test failed

So i would like to manually update the mod.
Title: Re: Drafts
Post by: Kimmie on September 14, 2008, 11:17:12 PM
Quote from: asudhakar on September 14, 2008, 11:00:45 PM
Hi you have came with 1.0.8 Draft Version. Could  i know the 8 edits you have did so that i could manually upgrade the package with mod parser.

Because when i try to uninstall 1.0.7 Draft, it show two error.

1.   Execute Modification   ./Sources/ManagePermissions.php   Test failed
5.   Execute Modification   ./Themes/default/Post.template.php   Test failed

So i would like to manually update the mod.

That just means that you have other mods that have affected those files. Uninstall it using the package manager and then manually remove the code from those 2 files and the mod will be entirely uninstalled



Charles
If I uninstall the older version and then reinstall the newer version will it retain the data or will any drafts saved up to that point be deleted during the uninstall?
Title: Re: Drafts
Post by: Charles Hill on September 14, 2008, 11:21:42 PM
The install/uninstall only affects the files not any of the rows in your database tables.
Title: Re: Drafts
Post by: ddarrell on September 15, 2008, 08:32:41 PM
this is truly a nice, and needed Mod.

I installed with no problems and left it up a couple of days.
Yet I discovered one worisome aspect, and that is that the
only way to delete a draft is to post it, then delete the post.

I thought that some users might not figure this out, so
I un-installed it.

It would really be nice if you could alter it so that a user could
bring up his/her saved drafts, and have a way of deleting the
ones that are no longer relevant, without having to post-then-delete same.

Thank you for your excellent work!

ddarrell
Title: Re: Drafts
Post by: Charles Hill on September 15, 2008, 09:05:05 PM
You can delete them.  From your Profile > Show Drafts page.  I think you're referring to the table that shows a brief summary of your drafts below the post box on the post page?
Title: Re: Drafts
Post by: ddarrell on September 16, 2008, 11:34:24 AM
Quote from: Charles Hill on September 15, 2008, 09:05:05 PM
You can delete them.  From your Profile > Show Drafts page.  I think you're referring to the table that shows a brief summary of your drafts below the post box on the post page?

My apologies!!  :-[

I reinstalled it, and it is exactly like you say.  Plus: a nice user interface in the profile section for managing the drafts. 

Great Mod, thanks!

:) :) :) :) :)
Title: Re: Drafts
Post by: Rafferty on September 25, 2008, 10:34:00 PM
The mod installed without errors and works fine for me as admin. My members are reporting that when trying to save a draft they are getting the error 500. I understand this is a permission function.

I Checked all file and folders on my server and they are set to 755, no reason my members should be getting error 500.

Any thoughts?
Title: Re: Drafts
Post by: Charles Hill on September 25, 2008, 10:36:26 PM
Are you getting any errors in your forum error log?
Title: Re: Drafts
Post by: Rafferty on September 25, 2008, 11:09:03 PM
no errors but ive reinstalled and tested it on 3 members, it worked. thanks
Title: Re: Drafts
Post by: Charles Hill on September 25, 2008, 11:16:08 PM
I don't think the 500 error is being caused by the drafts mod...
Title: Re: Drafts
Post by: Ravac on September 26, 2008, 02:42:06 AM
Serbian translate

index.serbian-utf8.php
// Drafts txt variables
$txt['permissiongroup_drafts'] = 'Skice';
$txt['permissionname_save_drafts'] = 'Možete sačuvati teme kao skice';
$txt['only_new_topics'] = 'Možete sačuvati samo nove teme kao skice.';
$txt['error_draft_not_saved'] = 'Došlo je do nepoznatih grešaka pa s tim
skica<b>nije</b> sačuvana.';
$txt['draft_saved'] = 'Skica je uspešno sačuvana.';
$txt['draft'] = 'Skica';
$txt['showDrafts'] = 'Prikaži skice';
$txt['no_drafts'] = 'Nemate ni jednu skicu sačuvanu.';
$txt['last_saved'] = 'Poslednja sačuvana';
$txt['lastSaved'] = 'Poslednja sačuvana';
$txt['delete_draft_confirm'] = 'Da li ste sigurni da želite da izbrišete izabranu skicu?';
$txt['save_as_draft'] = 'Sačuvaj kao skicu';
$txt['draft_saved_short'] = 'Skica sačuvana';
$txt['loadDrafts'] = 'Učitaj skice';
$txt['hideDrafts'] = 'Sakrij';
$txt['post_draft_confirm'] = 'Da li ste sigurni da želite da postavite ovu skicu kao
temu?';
$txt['drafts_postIt'] = 'Postavi skicu!';
Title: Re: Drafts
Post by: Cal O'Shaw on September 27, 2008, 12:41:35 AM
Mr. Hill,

Have you had the chance to look at solving the "unstickied topic" problem we talked about here (http://www.simplemachines.org/community/index.php?topic=246151.msg1705016#msg1705016)?

Grazie,

Cal
Title: Re: Drafts
Post by: Charles Hill on September 27, 2008, 12:50:47 AM
No not yet.
Title: Re: Drafts
Post by: Sabre™ on October 08, 2008, 05:21:48 AM
Hi Mate :)
Excellent job with this mod!!

How or would it be possible, to have your draft be able to post in any topic?
Say I made the draft in the SMF 1.x.x support thread, then went over to the SMF 2.x.x thread and wanted to use it there. If I click on "Load Drafts" it would post it in the SMF 1.x.x thread instead of the SMF 2.x.x thread.

Anyway to change this?

Or to have some drafts stay to be repeatedly used over n over again.
Like here when you explain how to use the "Package Parser".
Instead of retyping it over n over again, you could have the "repeat draft/template" to continuosly use when you click "Load Drafts".
Just an idea ;)

Thank You in advance mate :)
Title: Re: Drafts
Post by: Charles Hill on October 08, 2008, 06:30:14 PM
Those are some good ideas.  I am swamped as it is with my Blog Community mod and setting up a store.  Once I get all that rolling I'll revise the drafts mod completely.
Title: Re: Drafts
Post by: Sabre™ on October 09, 2008, 04:01:33 PM
Awesome! :)

Your blog mod looks pretty cool too.
Keep up the great work champ :)
Title: Re: Drafts
Post by: Lady Night Owl on October 12, 2008, 08:58:18 PM
After an attempt at installing a different mod, my Profile.php code became royally fouled up.

Now, I've got the profiles back, but I'm getting this error:

8: Undefined variable: drafts_counter
File: /forums/Sources/Profile.php
Line: 211


Line 211

$context['profile_areas']['info']['areas']['showDrafts'] = '<a style="white-space:nowrap;" href="' . $scripturl . '?action=profile;u=' . $memID . ';sa=showDrafts">' . $txt['showDrafts'] . ' ' . $drafts_counter . '</a>';

And of course, the counter isn't there anymore - and I do have some drafts saved.

I manually reentered this mod's code in the Profile.php and have combed through this code until my eyes just about crossed. I don't even know exactly what I'm supposed to be looking for anyway. I'm thinking that the Profile.php file might be fine - maybe there is something in another file that controls this?

If you have time, would you mind looking at the attached and let me know what's wrong? I'm not in a huge rush since the mod does work everywhere else.

Thanks in advance!
Title: Re: Drafts
Post by: DocPixel on October 22, 2008, 11:19:53 AM
I installed this mod and my members just love it. I do too.

Thanks, Charles!
Title: Re: Drafts
Post by: Lady Night Owl on November 07, 2008, 01:45:04 AM
Quote from: Lady Night Owl on October 12, 2008, 08:58:18 PM
After an attempt at installing a different mod, my Profile.php code became royally fouled up.

Now, I've got the profiles back, but I'm getting this error:

8: Undefined variable: drafts_counter
File: /forums/Sources/Profile.php
Line: 211


Line 211

$context['profile_areas']['info']['areas']['showDrafts'] = '<a style="white-space:nowrap;" href="' . $scripturl . '?action=profile;u=' . $memID . ';sa=showDrafts">' . $txt['showDrafts'] . ' ' . $drafts_counter . '</a>';

And of course, the counter isn't there anymore - and I do have some drafts saved.

I manually reentered this mod's code in the Profile.php and have combed through this code until my eyes just about crossed. I don't even know exactly what I'm supposed to be looking for anyway. I'm thinking that the Profile.php file might be fine - maybe there is something in another file that controls this?

If you have time, would you mind looking at the attached and let me know what's wrong? I'm not in a huge rush since the mod does work everywhere else.

Thanks in advance!

Any ideas about this?
Title: Re: Drafts
Post by: Lady Night Owl on November 19, 2008, 03:54:06 PM
Quote from: Lady Night Owl on November 07, 2008, 01:45:04 AM
Quote from: Lady Night Owl on October 12, 2008, 08:58:18 PM
After an attempt at installing a different mod, my Profile.php code became royally fouled up.

Now, I've got the profiles back, but I'm getting this error:

8: Undefined variable: drafts_counter
File: /forums/Sources/Profile.php
Line: 211


Line 211

$context['profile_areas']['info']['areas']['showDrafts'] = '<a style="white-space:nowrap;" href="' . $scripturl . '?action=profile;u=' . $memID . ';sa=showDrafts">' . $txt['showDrafts'] . ' ' . $drafts_counter . '</a>';

And of course, the counter isn't there anymore - and I do have some drafts saved.

I manually reentered this mod's code in the Profile.php and have combed through this code until my eyes just about crossed. I don't even know exactly what I'm supposed to be looking for anyway. I'm thinking that the Profile.php file might be fine - maybe there is something in another file that controls this?

If you have time, would you mind looking at the attached and let me know what's wrong? I'm not in a huge rush since the mod does work everywhere else.

Thanks in advance!

Any ideas about this?

Ah, nevermind. I switched over to SMF 2 Beta 4 and can't use this mod at all.

I am hoping when a stable version of 2 is released, the mod will be upgraded and can be installed there.

Charles, do you have any plans to make this available to SMF 2 users? Out of all the mods I had installed, this is one of the few that I've missed since the move.
Title: Re: Drafts
Post by: Charles Hill on November 19, 2008, 04:08:18 PM
Ya I do plan to make this for SMF 2.0+.... But like i've said for Blog Community, I am still weary of them making drastic changes.
Title: Re: Drafts
Post by: Sabre™ on November 19, 2008, 05:12:11 PM
Hi Charles :)

Just checking up on the progress of this/these ideas.
I know you're a busy man, so I thought I'd remind you incase you'd forgotten.

Quote from: Sabre™ on October 08, 2008, 05:21:48 AM
Hi Mate :)
Excellent job with this mod!!

How or would it be possible, to have your draft be able to post in any topic?
Say I made the draft in the SMF 1.x.x support thread, then went over to the SMF 2.x.x thread and wanted to use it there. If I click on "Load Drafts" it would post it in the SMF 1.x.x thread instead of the SMF 2.x.x thread.

Anyway to change this?

Or to have some drafts stay to be repeatedly used over n over again.
Like here when you explain how to use the "Package Parser".
Instead of retyping it over n over again, you could have the "repeat draft/template" to continuosly use when you click "Load Drafts".
Just an idea ;)

Thank You in advance mate :)
Quote from: Charles Hill on October 08, 2008, 06:30:14 PM
Those are some good ideas.  I am swamped as it is with my Blog Community mod and setting up a store.  Once I get all that rolling I'll revise the drafts mod completely.

Thanks Champ :)
Title: Re: Drafts
Post by: Cal O'Shaw on November 19, 2008, 05:40:41 PM
Charles,

Will that be when you address the sticky topic problem?  No pressure, just looking for something to tell my folk who've asked me.

Grazie,

Cal
Title: Re: Drafts
Post by: Sabre™ on November 19, 2008, 05:45:49 PM
Does that have to do with this mod?
Whats the issue you're having?
Title: Re: Drafts
Post by: Charles Hill on November 19, 2008, 06:25:17 PM
When I redo the mod I'll address those issues, yes.
Title: Re: Drafts
Post by: Sabre™ on November 19, 2008, 06:29:46 PM
Cool..
No rush mate, you do what you need to do first.

Thanks for the reply :)
Title: Re: Drafts
Post by: Lady Night Owl on November 19, 2008, 08:06:26 PM
Quote from: Charles Hill on November 19, 2008, 04:08:18 PM
Ya I do plan to make this for SMF 2.0+.... But like i've said for Blog Community, I am still weary of them making drastic changes.

I completely understand, that's a lot of work that might turn out to be for nothing; I was just curious :)

Sorry, haven't paid much attention to the blog thread so I didn't see your comments about the SMF 2.0+ :\
Title: Re: Drafts
Post by: redline7366 on November 19, 2008, 11:29:12 PM
Has anyone had any issues with using attachments in the post draft. 

I receive the following error when trying to add an attachment:

Your attachment couldn't be saved. This might happen because it took too long to upload or the file is bigger than the server will allow.

Please consult your server administrator for more information.


Neither is the case.  No issues using attachments in the normal posting environment.
Title: Re: Drafts
Post by: Kimmie on December 01, 2008, 11:20:16 PM
I'm seeing this error in my log:

Database Error: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ')' at line 3
File: /home/patriotg/public_html/Sources/Post.php
Line: 1081


Any ideas?
Title: Re: Drafts
Post by: Charles Hill on December 01, 2008, 11:56:51 PM
If you post the query I can help you diagnose the problem.
Title: Re: Drafts
Post by: Kimmie on December 02, 2008, 07:50:00 PM
Quote from: Charles Hill on December 01, 2008, 11:56:51 PM
If you post the query I can help you diagnose the problem.

Not sure what you mean by query. Are you wanting me to post the actual Post.php file?
Title: Re: Drafts
Post by: Charles Hill on December 02, 2008, 08:05:47 PM
The error you posted has to do with a mysql query.  It tells you the file name, the line # of the query, and the line # within the query where the error is.  You can post the whole Post.php if u want.
Title: Re: Drafts
Post by: Kimmie on December 03, 2008, 05:19:11 AM
ak ok well I have never done that before so I will just post the actual file. The error is happening when saved drafts are posted.

Title: Re: Drafts
Post by: Charles Hill on December 03, 2008, 09:04:50 AM
In that file... find:
$board = !empty($draft_info['boardID']) ? $draft_info['boardID'] : '';

replace with:
$board = !empty($draft_info['boardID']) ? $draft_info['boardID'] : 0;
Title: Re: Drafts
Post by: Kimmie on December 04, 2008, 07:56:21 PM
Quote from: Charles Hill on December 03, 2008, 09:04:50 AM
In that file... find:
$board = !empty($draft_info['boardID']) ? $draft_info['boardID'] : '';

replace with:
$board = !empty($draft_info['boardID']) ? $draft_info['boardID'] : 0;

ok I will try that and see if it fixes the issue and let you know. thanks.
Title: Re: Drafts
Post by: Kimmie on December 05, 2008, 09:09:55 PM
ok well now nobody can reply to any posts on the site now. This error keeps coming up for members and I get a hacking attempt in my error log:

Errors members see:

(http://i36.tinypic.com/24wc60k.png)

Error "I" get when making replies:

You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 's', 1, 255), SUBSTRING('Sigs are Lookin Good :)', 1, 65534), SUBSTRING('kjb0007'' at line 4
File: /home//public_html/Sources/Subs-Post.php
Line: 1542

And eror in my log:

Hacking attempt...

INSERT INTO smf_messages
(ID_BOARD, ID_TOPIC, ID_MEMBER, subject, body, posterName, posterEmail, posterTime,
posterIP, smileysEnabled, modifiedName, icon)
VALUES (9, 18987, 6, SUBSTRING('Re: I'm without internet.... AHHHHH', 1, 255), SUBSTRING('Must feel good to be back online.....  a-14

Glad to have you back.  a-40', 1, 65534), SUBSTRING('PieceMaker', 1, 255), SUBSTRING('piecemaker@gmail.com', 1, 255), 1228525292,
SUBSTRING('69.230.220.143', 1, 255), 1, '', SUBSTRING('wink', 1, 16))
File: /home//public_html/Sources/Subs-Post.php
Line: 1542

ANd

Database Error: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 's', 1, 255), SUBSTRING('Sigs are Lookin Good :)', 1, 65534), SUBSTRING('kjb0007'' at line 4
File: /home//public_html/Sources/Subs-Post.php
Line: 1542
Title: Re: Drafts
Post by: Propaganistas on December 18, 2008, 02:18:11 PM
Hiya,

could anyone please add a cycle topic creation to this mod? More info in this topic: http://www.simplemachines.org/community/index.php?topic=280845.0

It would be great if this is possible :)

Thanks in advance
~Propa
Title: Re: Drafts
Post by: Cal O'Shaw on January 13, 2009, 06:50:14 PM
Mr. Hill,

Hate to be a bother, but any word on progress on fixing the "unstickied topic" bug.  It's the only thing keeping me from releasing this to my membership.

Grazie,

Cal
Title: Re: Drafts
Post by: JoeB on January 15, 2009, 01:56:28 PM
Translation in Arabic
[// Drafts txt variables
$txt['permissionname_save_drafts'] = 'اسم الخاصية_تخزين مســـودة';
$txt['only_new_topics'] = 'المواضيع الجديدة فقط.';
$txt['error_draft_not_saved'] = 'حدث خطا المســـودة لم تخزن<b>me</b>di.';
$txt['draft_saved'] = ' تم خزن المســـودة .';
$txt['draft'] = 'مســـودة';
$txt['showDrafts'] = 'اضهر المســـودة';
$txt['no_drafts'] = 'لاتوجد مســـودة.';
$txt['last_saved'] = 'تاريخ اخر خزن';
$txt['lastSaved'] = 'تاريخ اخر خـزن';
$txt['delete_draft_confirm'] = 'الغي المسود_ثبت?';
$txt['save_as_draft'] = 'اخزن كمسودة';
$txt['draft_saved_short'] = 'المسودة المخزونة قصيرة';
$txt['loadDrafts'] = 'حمل مسودة';
$txt['hideDrafts'] = 'اخفي المسودة';
Title: Re: Drafts
Post by: Sudhakar Arjunan on January 24, 2009, 04:06:03 PM
Hi Charles, i found the Zcommunity blog mod is been upgraded to 2.0.4.

Is there any chance for us to have an Update of Drafts mod with 2.0.4 Compatibility.
Title: Re: Drafts
Post by: Charles Hill on January 24, 2009, 04:09:07 PM
I'm going to revise this mod to work with both SMF 1.1.x and SMF 2.0.  I don't know how long it will take, though.
Title: Re: Drafts
Post by: Cal O'Shaw on March 06, 2009, 03:06:40 AM
Hello,

It's been awhile so I thought I'd ask if you've had the opportunity to look at fixing the "unsticky topic" problem and would be releasing a fix under 1.1.8.

Grazie,

Cal
Title: Re: Drafts
Post by: Özgür on March 13, 2009, 08:37:48 PM
Any updates for smf 2.0 ?
Title: Re: Drafts
Post by: Yağız... on March 13, 2009, 09:54:46 PM
Quote from: Özgür´ on March 13, 2009, 08:37:48 PM
Any updates for smf 2.0 ?
I updated for my friend(Alpay) but it was when 2.0 Beta 4 wasn't released yet. So it shouldn't be compatible with RC1... And it wasn't totally compatible with 2.0, I didn't know anything about 2.0's coding.
Title: Re: Drafts
Post by: saosangmo on March 24, 2009, 01:13:28 PM
It's very useful mod. Hope it'll be released for SMF 2.0 soon!
Title: Re: Drafts
Post by: stefann on April 20, 2009, 01:24:50 AM
If anyone does look at updating this for SMF 2.0 this would be great.

There's a little feature I'd like to see implemented to automatically save a draft of a post if you submit it and then it fails, perhaps because somebody else posted first, or you forgot to enter a title. Either way, it does give you a chance to resubmit but I've found some people close the window too quickly to realise, and thus lose their post. If the re-posting is successful the draft could be deleted, it just avoids the possibility of the post being lost if they don't re-post it.

I'd love to do this myself, but unfortunately I don't have the time to look after mods right now
Title: Re: Drafts
Post by: Cal O'Shaw on May 31, 2009, 01:28:09 AM
Quote from: Cal O'Shaw on March 06, 2009, 03:06:40 AM
Hello,

It's been awhile so I thought I'd ask if you've had the opportunity to look at fixing the "unsticky topic" problem and would be releasing a fix under 1.1.8.

Grazie,

Cal

Mr. Hill,

Do you think you might be looking into the 'unsticky topic' bug any time soon, or will it be after 2.0.0 goes Gold?  I know we plan on staying on 1.1.x for a few months after the 2.0.0 release, waiting for all the MODs to migrate (and those last shy bugs to be squashed with 2.0.1...)

Grazie,

Cal
Title: Re: Drafts
Post by: CarpeDiem on June 12, 2009, 10:27:00 PM
Charles,

In another thread (http://www.simplemachines.org/community/index.php?topic=316788.0), you said:  "The Drafts Mod does most of what you want.  Though there were a couple minor issues... and it doesn't have the full organizational abilities you describe."

Your comment above about minor issues and organizational abilities that your Drafts Mod might lack is what I'd like you to clarify if you will.
Title: Re: Drafts
Post by: CarpeDiem on June 13, 2009, 11:30:29 PM
I'm suggesting that SMF make drafts a normal part of the next release of SMF 2.1.

I've started a thread in the Feature Requests section at this link (http://www.simplemachines.org/community/index.php?topic=317405.new#new) and if you want to see it as a regular part of SMF and not a Mod, please feel free to add your support!

REMEMBER:  If it's not a Mod, then there will no longer be a need to manually install and fiddle with inserting code hither and tither.  If it makes it into the next release, it should always be there for us and our website forums for the future forward (and it's our users about whom we should be concerned).

Please support!  Charles has done a great job, but he no longer has time and energy for this it seems (he's got other irons in the fire!).  He hasn't responded to anyone here since January (and it's now June).  I'll bet people are not even checking back in this thread since they're discouraged.  Have courage!

SUPPORT DRAFTS AS A REGULAR FEATURE OF SMF HERE (http://www.simplemachines.org/community/index.php?topic=317405.new#new)!
Title: Re: Drafts
Post by: Cal O'Shaw on July 22, 2009, 02:15:39 AM
Mr. Hill,

Will you be revisiting this MOD?

Also, it won't install in 1.1.10 because of a bug when using "1.1.99" in the INSTALL or UNINSTALL verbs.  Bug has been reported here (http://www.simplemachines.org/community/index.php?topic=325849.0).

Cal
Title: Re: Drafts
Post by: Remixed on July 22, 2009, 03:18:49 AM
Have you tryed a Manual Install (http://docs.simplemachines.org/index.php?topic=402) of this mod?
Title: Re: Drafts
Post by: Cal O'Shaw on July 22, 2009, 03:22:21 AM
I have had it installed for some time (see my posts earlier in this topic about a bug regarding sticky posts).

I was reporting that there is a problem if someone is installing it on 1.1.10 for the first time as well as hoping Mr. Hill would perhaps address the bug in this MOD.

Cal
Title: Re: Drafts
Post by: gbsothere on August 01, 2009, 01:45:54 AM
I know that Charles is tied up and that his site is down, as well.  But if some "code-savvy" person could help me weed through this forum error, I'll be eternally grateful. 
:)

Error (pages and pages of it): 

8: Undefined variable: drafts_counter
File: /var/www/vhosts/mywebsite.com/httpdocs/smf/Sources/Profile.php
Line: 215


Line 215 of Sources/Profile.php

$context['profile_areas']['info']['areas']['showDrafts'] = '<a style="white-space:nowrap;" href="' . $scripturl . '?action=profile;u=' . $memID . ';sa=showDrafts">' . $txt['showDrafts'] . ' ' . $drafts_counter . '</a>';



Suggestions?   



SMF 1.1.10/Default
Title: Re: Drafts
Post by: Sabre™ on August 05, 2009, 07:06:57 AM
May be of no help, but could you attach your Profile.php
Title: Re: Drafts
Post by: gbsothere on August 05, 2009, 07:49:43 AM
Quote from: Sabre™ on August 05, 2009, 07:06:57 AM
May be of no help, but could you attach your Profile.php




Sabre™, I can't tell you how relieved I was to see that this thread had been bumped.   :)   Thanks, so much.


Title: Re: Drafts
Post by: Ben K on August 05, 2009, 07:58:30 AM
I'll make Russian translation if you update if for SMF 2.0 RC1-2 :P
Title: Re: Drafts
Post by: Sabre™ on August 05, 2009, 08:14:25 AM
@ gbsothere
Is your drafts table in your db?

Im just reaching mate, I saw you needed assistance, so wanted to help, but as my previous post states
Quote from: Sabre™ on August 05, 2009, 07:06:57 AM
May be of no help.....
Title: Re: Drafts
Post by: gbsothere on August 05, 2009, 08:17:51 AM
I'm so completely stumped that I appreciate just the fact that you're looking at this.   :D

The only table I see in the DB is smf_drafts.  Should there really only be one table for the Drafts mod?


Title: Re: Drafts
Post by: Sabre™ on August 05, 2009, 08:44:17 AM
Yes.
Might have to wait for the op to reply mate, I couldnt replicate your problem.
Sorry buddy :)
Title: Re: Drafts
Post by: gbsothere on August 05, 2009, 08:45:46 AM
Thanks for looking though, Sabre™.   I'm not sure when we'll see Charles again, but maybe he'll miss us and come looking for us.   :D


Thanks!
Title: Re: Drafts
Post by: gbsothere on August 05, 2009, 09:10:15 AM
Just wanted to add, Sabre™, that I browsed the smf_drafts table and found two drafts that looked very familiar and, sure enough, I looked on my forum and there were two threads matching the titles of these drafts that a poster still was showing as "Saved".  I don't know how the drafts counter functions but it seems to me that, at least in this case, drafts that were posted weren't released from the "saved" category.  I would guess that this could mess up the counter?   I deleted them from the DB to see if we're still getting errors, so I'm in the "wait and see" mode.   

:)
Title: Re: Drafts
Post by: Sabre™ on August 07, 2009, 05:18:32 PM
gbsothere, hows it looking mate?


Very nice Arantor
Thanks in advance :)
Title: Re: Drafts
Post by: gbsothere on August 08, 2009, 06:43:07 AM
Quote from: Sabre™ on August 07, 2009, 05:18:32 PM
gbsothere, hows it looking mate?


Very nice Arantor
Thanks in advance :)


Well, I'm afraid I'm still riddled with "draft_counter" errors, Sabre™, and I'm stuck on a road trip and can't really tinker with it until I return home, but I choose to believe that one day, when we least expect it, Charles will return with much fanfare and a bag of tricks and the world will be good, again.   :D

(I also choose to believe I can fly just by aiming at the ground and missing.)    ;D
Title: Re: Drafts
Post by: gbsothere on August 11, 2009, 05:40:00 PM
*bumping this today, in case Charles sees it*   :)




Quote from: gbsothere on August 01, 2009, 01:45:54 AM
I know that Charles is tied up and that his site is down, as well.  But if some "code-savvy" person could help me weed through this forum error, I'll be eternally grateful. 
:)

Error (pages and pages of it): 

8: Undefined variable: drafts_counter
File: /var/www/vhosts/mywebsite.com/httpdocs/smf/Sources/Profile.php
Line: 215


Line 215 of Sources/Profile.php

$context['profile_areas']['info']['areas']['showDrafts'] = '<a style="white-space:nowrap;" href="' . $scripturl . '?action=profile;u=' . $memID . ';sa=showDrafts">' . $txt['showDrafts'] . ' ' . $drafts_counter . '</a>';



Suggestions?   



SMF 1.1.10/Default
Title: Re: Drafts
Post by: Kimmie on October 15, 2009, 04:41:26 PM
Quote from: Arantor on August 05, 2009, 09:14:14 AM
I doubt this mod itself will be updated to 2.0 because the author doesn't appear to be particularly interested; I even asked if he would like help in making it 2.0 compatible (in 2 separate PMs) but this went unanswered.

I will be developing a mod for this once RC2 is available, not before. As you're all aware there are huge changes afoot in RC2 and I will not be developing and maintaining two separate versions of code.

THANK YOU in advance!! This mod was used alot on my site when I was using the 1.X version of SMF and is missed BADLY..lol. Cant wait for your release!
Title: Re: Drafts
Post by: Sabre™ on October 15, 2009, 06:12:37 PM
You sir are truly a gentleman.
Good stuff mate, and thanks in advance :)
Title: Re: Drafts
Post by: KensonPlays on November 02, 2009, 10:02:33 PM
Can't wait! My friend keeps trying to post, and keeps getting 500 Server Errors!

Hurry up 2.0RC2 Public!!!!!!!!!!!!!!!
Title: Re: Drafts
Post by: saosangmo on November 03, 2009, 02:44:41 AM
Hope the author release version for SMF 2.0 soon.
thanks
-saosangmo
Title: Re: Drafts
Post by: Sakae on February 09, 2010, 05:47:36 PM
So... No update for SMF 2.0 RC2?

Arantor once said he has some pieces of code ready... Have you finished, dude?

This mod is so useful that it should come from default SMF.
Title: Re: Drafts
Post by: Sakae on February 10, 2010, 11:20:59 AM
Quote from: Sakae on February 09, 2010, 05:47:36 PM
QuoteThis mod is so useful that it should come from default SMF.

I was trying to argue this for SMF 2.1 but no-one seemed to listen at the time.

I guess we won't see this MOD updated soon, right?

Developers should care for this plugin much more than fix the WYSIWYG editor.

This is, like, way way way way more useful (and cool).
Title: Re: Drafts
Post by: TheListener on February 10, 2010, 11:29:05 AM
This would be a handy feature especially when making a long post.

Support on smf seems rather lower than it used to be.
Title: Re: Drafts
Post by: KensonPlays on February 10, 2010, 11:50:44 AM
Will it EVER be release for 2.0RC2??????
Title: Re: Drafts
Post by: Sakae on February 10, 2010, 08:00:39 PM
Meanwhile, is it possible to create some kind of notepad on each member's profile configuration screen to use as draft? :P
Title: Re: Drafts
Post by: Nibogo on February 10, 2010, 09:40:41 PM
There is already a Drafts Mod for SMF 2.0 RC2:

http://custom.simplemachines.org/mods/index.php?mod=2390

But it hasn't been approved, I submitted in January 18 and since that day I never receive anything about the approval of this mod
Title: Re: Drafts
Post by: Sakae on February 11, 2010, 08:31:11 AM
Quote from: NIBOGO on February 10, 2010, 09:40:41 PM
There is already a Drafts Mod for SMF 2.0 RC2:

http://custom.simplemachines.org/mods/index.php?mod=2390

But it hasn't been approved, I submitted in January 18 and since that day I never receive anything about the approval of this mod

Is it based on this MOD?

I mean, I have some old drafts on my database since I upgraded from SMF 1.x (a long time ago). Sure I could access my DB and get it from there, but it would be nice to see my old drafts appearing :)
Title: Re: Drafts
Post by: Nibogo on February 11, 2010, 08:51:26 AM
Quote from: Arantor on February 11, 2010, 02:33:39 AM
Quote from: NIBOGO on February 10, 2010, 09:40:41 PM
But it hasn't been approved, I submitted in January 18 and since that day I never receive anything about the approval of this mod

The Cust. team is pretty busy, given that Nas is on hiatus and in recent times, Fustrate, JBlaze and myself all stepped down.

I know it, Nas and DIN1031 are both On Hiatus and there are only 5 more customizers and I'm not sure but I think of Antechinus is dedicated on Themes so there are too much mods for only 4 people. I was not saying that they should approved soon just let it know the people that a 2.0 RC2 version exists but they need patient if they want to use it.

Quote from: Sakae on February 11, 2010, 08:31:11 AM
Quote from: NIBOGO on February 10, 2010, 09:40:41 PM
There is already a Drafts Mod for SMF 2.0 RC2:

http://custom.simplemachines.org/mods/index.php?mod=2390

But it hasn't been approved, I submitted in January 18 and since that day I never receive anything about the approval of this mod

Is it based on this MOD?

I mean, I have some old drafts on my database since I upgraded from SMF 1.x (a long time ago). Sure I could access my DB and get it from there, but it would be nice to see my old drafts appearing :)

No, I writted from the scratch and no there is no converter from this mod to my mod. Maybe I can add it for a future release
Title: Re: Drafts
Post by: Sabre™ on February 16, 2010, 05:25:58 AM
Quote from: Arantor on February 10, 2010, 01:34:50 PM
... I deleted the code I had, not having any use for it any more..

Sorry to read that, it is a useful addition and I was also looking forward to your version.
Will be looking to see when your version is released nibogo
Title: Re: Drafts
Post by: KensonPlays on February 21, 2010, 02:25:13 AM
aw man! I really need this!!!!
Title: Re: Drafts
Post by: TurtleKicker on March 04, 2010, 10:25:24 AM
Just confirming some things:

1) Does this mod in its current form work ok on SMF 1.1.11?

2) There's a chance that NIBOGO's mod will be available for SMF2 once the SMF team gets through the mod approval backlog?
Title: Re: Drafts
Post by: Nibogo on March 04, 2010, 02:38:54 PM
Quote from: sremick on March 04, 2010, 10:25:24 AM
Just confirming some things:

1) Does this mod in its current form work ok on SMF 1.1.11?

2) There's a chance that NIBOGO's mod will be available for SMF2 once the SMF team gets through the mod approval backlog?

1. It should

2. I receive a PM telling me some issues with this mod and I forget about it, I'm going to fix this error today
Title: Re: Drafts
Post by: Sakae on March 06, 2010, 10:30:47 AM
Quote from: NIBOGO on March 04, 2010, 02:38:54 PM
2. I receive a PM telling me some issues with this mod and I forget about it, I'm going to fix this error today

YAY!!! Have you fixed?? I can give you moral support!! GO NIBOGO! lol
Title: Re: Drafts
Post by: TurtleKicker on April 05, 2010, 11:02:56 AM
Quote from: NIBOGO on March 04, 2010, 02:38:54 PM
2. I receive a PM telling me some issues with this mod and I forget about it, I'm going to fix this error today

Hey there, NIBOGO: any update on SMF2 support? :)

I've got this working great on 1.1.11 and would hate to have to give it up once I migrate to SMF2. Thanks! :)
Title: Re: Drafts
Post by: Nibogo on April 05, 2010, 11:42:12 AM
Yep, I fixed all the errors the mod was working like a charm but the customization team send me a PM like a week ago (I re-submit the mod various weeks ago) telling that it has 1 additional issue I don't know idf I should fix it and wait another month to receive another PM about another stupid bug or just release it as a Paid Mod
Title: Re: Drafts
Post by: Cal O'Shaw on April 05, 2010, 11:55:37 AM
They may be referring to the problem where a draft causes a topic to become "unsticky".  I've mentioned it a few times in this topic.  A cookbook for reproducing the problem is listed in this post:

http://www.simplemachines.org/community/index.php?topic=246151.msg1705016#msg1705016

Grazie,

Cal
Title: Re: Drafts
Post by: Nibogo on April 05, 2010, 05:38:45 PM
Quote from: Cal O'Shaw on April 05, 2010, 11:55:37 AM
They may be referring to the problem where a draft causes a topic to become "unsticky".  I've mentioned it a few times in this topic.  A cookbook for reproducing the problem is listed in this post:

http://www.simplemachines.org/community/index.php?topic=246151.msg1705016#msg1705016

Grazie,

Cal

No, I create my own mod so the issues related with this mod aren't related with my mod
Title: Re: Drafts
Post by: Nibogo on April 05, 2010, 05:42:33 PM
Quote from: Arantor on April 05, 2010, 05:40:12 PM
I look forward to seeing it NIBOGO, one less I'll have to write for myself ;)

If you want it just PM me I'll be more than happy to send it, no matter if it's released as a paid or free mod ;)
Title: Re: Drafts
Post by: Cal O'Shaw on April 06, 2010, 01:54:13 AM
Quote from: NIBOGO on April 05, 2010, 05:38:45 PM
Quote from: Cal O'Shaw on April 05, 2010, 11:55:37 AM
They may be referring to the problem where a draft causes a topic to become "unsticky".  I've mentioned it a few times in this topic.  A cookbook for reproducing the problem is listed in this post:

http://www.simplemachines.org/community/index.php?topic=246151.msg1705016#msg1705016

Grazie,

Cal

No, I create my own mod so the issues related with this mod aren't related with my mod

Hoping I understand...

1) Your Drafts MOD is not yet available on the MOD Site?

2) Your Drafts MOD will not work with SMF 1.1.x?
Title: Re: Drafts
Post by: Nibogo on April 06, 2010, 11:06:16 AM
1. Isn't available yet

2. Works only for 2.0 as this mods works on 1.1 but if I make it a paid mod I'm going to add SMF 1.1.x support
Title: Re: Drafts
Post by: roomeat on May 02, 2010, 07:05:04 PM
Hi Nibogo. Any chance I could grab a copy of your Drafts mod??
Can't believe no one has got this mod available in the mods section.
Title: Re: Drafts
Post by: roomeat on May 07, 2010, 03:24:02 PM
Quote from: roomeat on May 02, 2010, 07:05:04 PM
Hi Nibogo. Any chance I could grab a copy of your Drafts mod??
Can't believe no one has got this mod available in the mods section.
bump.
Title: Re: Drafts
Post by: KensonPlays on May 08, 2010, 01:00:27 AM
I used to use it. but now it isn't supported on my version :( Sometimes I am making a post and have to save it because class is just ending. Saved, finish at home!
Title: Re: Drafts
Post by: Sakae on May 08, 2010, 01:07:17 PM
Quote from: roomeat on May 07, 2010, 03:24:02 PM
Quote from: roomeat on May 02, 2010, 07:05:04 PM
Hi Nibogo. Any chance I could grab a copy of your Drafts mod??
Can't believe no one has got this mod available in the mods section.
bump.

I've asked for this mod too, but he said the offer was only to Arantor.
Title: Re: Drafts
Post by: Sakae on May 15, 2010, 10:41:48 PM
Up :(
Title: Re: Drafts
Post by: Sakae on June 30, 2010, 12:18:01 PM
Oh, nice Spuds!!!

Downloaded, but I'm not sure if I should try on my production webforum, but if none criticals bugs were found, I believe I could use it!!

Thank you man
Title: Re: Drafts
Post by: danielseeksGod on July 03, 2010, 04:35:30 AM
@spuds,

thanks for the mod!

some bugs tho lol.  it doesn't save formatting, like

this kind of

formatting.


ended up like this:

this kind offormatting.


where the linebreaks weren't saved.

also when installing, there was an error on post.template

also in the user profile, its supposed to have the "show drafts" link around show posts and show topics and trace user etc, but it has it on its own menu section, below Actions where you can delete account.
Title: Re: Drafts
Post by: cosoa on July 13, 2010, 02:59:35 AM
Thank you for working on updating this mod, Spuds! I could really use it for my RP site.
Title: Re: Drafts
Post by: TheListener on July 17, 2010, 04:54:04 PM
Hey Spuds ( er are you a potato?  ;D )

Have tried the install on my test forum and had a clean install.

Found the button on the posting page.

However folks whether this would need a manual edit on a theme other than the default is unknown.


EDIT:

I had this error in the error log.


Apply Filter: Only show the error messages of this URL
http://xxxxxxxxxxxxxxx/index.php?action=profile;area=theme;updated
Apply Filter: Only show the errors with the same message
8: Undefined index: showDrafts
Apply Filter: Only show the errors from this file
File: xxxxxxxxxxx/Sources/Profile.php
Line: 153


152:
'function' => 'showDrafts',
==>153:    
'label' =>  $txt['showDrafts'] . ' ' . $drafts_counter,
154:    
'file' => 'Profile-View.php',
155:    
'permission' => array(
156:    
'own' => array('profile_view_own', 'save_drafts'),
157:    
'any' => array(),
158:    
),
Title: Re: Drafts
Post by: Spuds on July 17, 2010, 05:39:23 PM
QuoteHey Spuds ( er are you a potato?  ;D )
Nah, but I play one while on the couch :)

Quote8: Undefined index: showDrafts
Thanks for the error report, I was messing around with changing the variable names and then changed my mind but forgot to back a couple out (of course on my test system I still had them both doh!)

I've attached a new version which will fix the error or you can just go into your /themes/default/language/index.english.php (or whatever you base language is) and find the $txt[show_drafts] and change it to $txt['showDrafts']
Title: Re: Drafts
Post by: TheListener on July 17, 2010, 05:51:48 PM
Sorted.

Spuds ya on a winner.

Btw I did it the lazy way.


EDIT:

Next up is seeing if it will work with the Ultimate Profile mod.
Title: Re: Drafts
Post by: Sabre™ on July 22, 2010, 06:07:01 PM
Quote from: Spuds on July 17, 2010, 05:39:23 PM
QuoteHey Spuds ( er are you a potato?  ;D )
Nah, but I play one while on the couch :)

lol
Good work Spuds :)
Title: Re: Drafts
Post by: Sakae on July 23, 2010, 11:03:15 AM
Hey Spuds! :D

I did gave a shot on this MOD, but my reply didn't worked anymore.

Unknown column 'board_id' in 'field list'
File: /***/Sources/Post.php
Line: 1143


Is it a bug with other MOD?
Title: Re: Drafts
Post by: TheListener on July 23, 2010, 11:28:55 AM
What does the line say?

Can ya post the line involved plus the lines above and below please.
Title: Re: Drafts
Post by: Sakae on July 23, 2010, 12:43:10 PM
Sure. Sorry haven't made it yet, I did uninstalled it on the fly, but now I have the time.

Line 1143 it's the end of this code:

if (allowedTo('save_drafts') && !isset($_REQUEST['msg'])) {

// now load the list of drafts this user has
$request = $smcFunc['db_query']('', '
SELECT board_id, topic_id, subject, draft_id, timestamp
FROM {db_prefix}drafts
WHERE member_id = {int:member_id}
ORDER BY timestamp DESC',
array(
'member_id' => $user_info['id']
)
);


Line 1143 it's the sad face );

LOL
Title: Re: Drafts
Post by: TheListener on July 23, 2010, 01:01:04 PM
The lines you posted are the exact same as mine.

How many errors are in your log at the mo?

What mods are installed?
Title: Re: Drafts
Post by: Sakae on July 23, 2010, 02:04:46 PM
Well, the answer for your both questions are: TONS of it.

Perhaps I should try investigating about this error... How can it be Unknown column 'board_id'? Shouldn't this be a default column on SMF RC3 (my version)?

Unknown column 'board_id' in 'field list'
File: /***/Sources/Post.php
Line: 1143


I had this MOD installed on my forum years ago, when we used SMF 1.1.9.

I upgrade the forum to SMF 2, perhaps this should be some old column of Drafts mod?...
Title: Re: Drafts
Post by: Spuds on July 24, 2010, 11:44:09 AM
QuoteI had this MOD installed on my forum years ago, when we used SMF 1.1.9.

I upgrade the forum to SMF 2, perhaps this should be some old column of Drafts mod?...

Bingo! ... If you had the old version of the mod on 1.1x and upgraded to 2.0 you would have an old copy of the database table drafts.  Normally this would not be bad but 2.0 uses a different naming syntax for column names, so while on 2.0 its board_id on 1.1 it would have been boardID.

So what to do ... well guess I need to write an update script as part of the install so if it finds the old table it updates it to be compatible  :P

You can do one of two things in the meantime
1) drop the old drafts table from your database, could be some old drafts in there but who cares at this point really. Then do a fresh install of the mod.
2) Or you can modify the old table by opening the table and changing the column names as follows.
draftID => draft_id
memberID -> member_id
boardID -> board_id
topicID -> topic_id
categoryID -> category_id
isSticky -> is_sticky
smileysEnabled -> smileys_enabled
topicDescription -> topic_description




Title: Re: Drafts
Post by: Sakae on July 26, 2010, 09:09:17 PM
Awesome!! It worked like a charm :)
Title: Re: Drafts
Post by: KensonPlays on July 26, 2010, 11:35:25 PM
Thanks spud! (I have a couple of friends who like writing but don't want to lose stuff if they have to stop for something, save it for later!)
Title: Re: Drafts
Post by: Sabre™ on July 27, 2010, 05:05:48 AM
There's an official smf2 Drafts (http://custom.simplemachines.org/mods/index.php?mod=2621) mod aswell.
Title: Re: Drafts
Post by: ~DS~ on July 27, 2010, 04:23:26 PM
Quote from: Spuds on July 27, 2010, 11:27:40 AM
Funny how it appeared after I made this one compatible with 2.0rc3 .... I had sent a note to Charles to see if he would let me take over this mod so it to could be official as well but have not heard back ...
Actually SD's draft mod is compatible with 2.0 RC3 before you ever did not to mention the fact it took 3 1/2 to get it approved.
Title: Re: Drafts
Post by: ~DS~ on July 27, 2010, 04:46:14 PM
Quote from: Spuds on July 27, 2010, 04:38:18 PM
No need to get all hostile, just thought it was funny.  There had been promises to make a drafts mod for 2.0 in this thread going back a year ...  finally I could not wait any longer and did the update and then an official one shows up, just funny, nothing more

I've removed my package from this thread so you won't feel the need to get all snarky towards me for trying to help the community.  ::)
No, no no. I was not trying to be hostile, but I am glad you actually did get it to work for the community. It certainly shows that you contributes when the author had not update in a while. :)
I am sorry if I am being snarky.

Cheers.
Title: Re: Drafts
Post by: gbsothere on July 27, 2010, 04:51:06 PM
Quote from: Spuds on July 27, 2010, 04:38:18 PM

I've removed my package from this thread






I'm glad I had the foresight to snag the zip a few days ago, then.   :)
Title: Re: Drafts
Post by: Soms on July 27, 2010, 05:33:17 PM
Quote from: Spuds on July 27, 2010, 04:38:18 PM
No need to get all hostile, just thought it was funny.  There had been promises to make a drafts mod for 2.0 in this thread going back a year ...  finally I could not wait any longer and did the update and then an official one shows up, just funny, nothing more

I've removed my package from this thread so you won't feel the need to get all snarky towards me for trying to help the community.  ::)

That's a pity having read the whole caveats accompanying the official release like it will not be supported or no new features will be added and stuff. I will suggest you keep working on your version and maybe you can keep helping others that way. You have my support whatever you do.
Title: Re: Drafts
Post by: Sabre™ on July 27, 2010, 06:52:13 PM
Spuds, there's no need to remove your version mate, you put alot of work into it, and assisted those when nobody else was.
A very good job mate, and the pages back show how many have appreciated it :)
Title: Re: Drafts
Post by: gbsothere on July 27, 2010, 06:57:54 PM
Quote from: Sabre™ on July 27, 2010, 06:52:13 PM
Spuds, there's no need to remove your version mate, you put alot of work into it, and assisted those when nobody else was.
A very good job mate, and the pages back show how many have appreciated it :)


+1!!    ;)
Title: Re: Drafts
Post by: ~DS~ on July 27, 2010, 06:58:42 PM
That's what I said, since I think I make him upset. :(
Title: Re: Drafts
Post by: TheListener on July 27, 2010, 07:01:53 PM
There's too many people think with their mouth.

:)

How long has DP been at 94% now?
Title: Re: Drafts
Post by: gbsothere on July 27, 2010, 07:09:35 PM
Quote from: Dismal Shadow on July 27, 2010, 06:58:42 PM
That's what I said, since I think I make him upset. :(



Maybe he'll come back and read this and realize you didn't mean it that way.   ;)


Quote from: Dismal Shadow on July 27, 2010, 04:46:14 PMNo, no no. I was not trying to be hostile, but I am glad you actually did get it to work for the community. It certainly shows that you contributes when the author had not update in a while. :)
I am sorry if I am being snarky.

Cheers.
Title: Re: Drafts
Post by: Sabre™ on July 27, 2010, 07:15:09 PM
Quote from: Dismal Shadow on July 27, 2010, 06:58:42 PM
That's what I said, since I think I make him upset. :(

Yeah, intentionally or not, your post did seem to hold a bit of attitude, but to be fair, Spuds comment you replied to did hold a little 'tone' in itself.
Just a little emotional content on both parties, stemmed from my mentioning of the update.
So be angry at me peeps, not at each other :)
Now that's sorted, may we carry on? :)
Title: Re: Drafts
Post by: Sabre™ on July 27, 2010, 10:14:37 PM
Quote from: Spuds on July 27, 2010, 10:04:54 PM
...I will re-post the package after I make a change to convert over the 1.1 drafts table (if it finds it), so its 2.0 naming compliant.  That will help with folks who want to upgrade.

Good idea mate :)
Title: Re: Drafts
Post by: Sakae on July 27, 2010, 11:28:43 PM
Quote from: Spuds on July 27, 2010, 10:04:54 PM
...I will re-post the package after I make a change to convert over the 1.1 drafts table (if it finds it), so its 2.0 naming compliant.  That will help with folks who want to upgrade.

Awesome, Spuds.

You have all my support, since the official release of Drafts mod has no plans on upgrading.

I'm probably your biggest supporter to keep updating YOUR drafts mod.
Title: Re: Drafts
Post by: Cal O'Shaw on July 30, 2010, 11:31:34 PM
Hello,

Just want to understand, there is no enhancements for SMF 1.1.x users?

I think it's super Spuds has provided a path to 2.0.0 for 1.1.x users of this MOD (fantastic work there!).

Since I've heard comments about work on RC4, I'm presuming a final release late this year, early nest year.  And running Production sites is not recommended by SMF, a lot of people will still be on 1.1.x next year.

Any chance that at least the "sticky" problem I've been asking about for well over a year might be fixed for 1.1.x users?

Grazie

Cal
Title: Re: Drafts
Post by: gbsothere on July 31, 2010, 08:52:55 AM
Quote from: Cal O'Shaw on July 30, 2010, 11:31:34 PM
Hello,

Just want to understand, there is no enhancements for SMF 1.1.x users?

I think it's super Spuds has provided a path to 2.0.0 for 1.1.x users of this MOD (fantastic work there!).

Since I've heard comments about work on RC4, I'm presuming a final release late this year, early nest year.  And running Production sites is not recommended by SMF, a lot of people will still be on 1.1.x next year.

Any chance that at least the "sticky" problem I've been asking about for well over a year might be fixed for 1.1.x users?

Grazie

Cal



Just wanted to add a comment here:  I have my (1.1.11/default) users copy and paste the contents of the drafts they've been saving, rather than click "Post".  Clicking "Post it" or even clicking "modify" and then posting causes sticky threads to become "un-sticky".  I hate asking my users to do this, but not more than I hate running around re-stickying topics.   :)

Title: Re: Drafts
Post by: gbsothere on August 01, 2010, 09:04:59 AM
Spuds, thanks for that!   :)

I'll give it a go, today, on my test site and let you know.  I appreciate your efforts.



Edit:   Sadly, there's no change but I'll tell you something interesting (and this happened yesterday, before applying your edits, but I guess I thought it was a fluke and didn't pursue it):  When I click "Post It" (from within my profile/saved drafts) it's not returning me to the sticky I created a draft on.  It's returning me to the "Welcome To SMF!" thread (which is the original "first" thread on my test board).  It is "unstickying" the Sticky thread I post to, and it is posting there; it's just not returning me to that thread, but to the board's original thread (actually within that thread).  I don't know if Cal O'Shaw is experiencing this as well, but I do find it odd.  I'm always returned to the thread I post on (having set that option in Profile) unless I'm posting a draft, in which case, I'm returned to that old thread I mentioned.  Odd behavior, and I don't know if it's a contributing factor to Sticky threads losing their sticky?  (Testing on a plain unstickied thread doesn't affect the Sticky threads but it still returns me to that original thread, instead of the one I'm posting on and, again, only when posting a draft, not when posting outright.)

All this jabberwocky in the hopes that it might shed some light on why this is happening.  I know you don't want to get bogged down in troubleshooting the 1.1.x version and I quite understand and respect that, Spuds.
Title: Re: Drafts
Post by: Charles Hill on August 04, 2010, 03:48:30 PM
Hello All,

Sorry I've been gone for so long.  The past couple months I've finally had a bunch of time to get things done that I've been too busy to do for a while.  As I told Spuds, I now had time to revisit the drafts mod.  I've been working the past few days on it.  Here are the changes as of now:

! Fixed Sticky problem
! Fixed breaking-spaces and general html entities problems
! Log actions, notifications, member post count updates, and mark read now done properly after posting a draft using "Post it!"
! Improved redirects (after deleting / posting drafts)
! Minimized edits to SMF Source files by separating Drafts source code into its own source file
! Eliminated edits to SMF Language files by separating Drafts txt strings into its own language files
! Minimized edits to SMF Template files by separating Drafts templates into its own template file
! Eliminated inline css
- Dropped support for other modifications
+ Polls now supported
+ Added board select on post form for new topics
+ Support for SMF 2.0 added

Additionally, the install package will allow those of you already using version 1.08 of the drafts mod to upgrade to the latest version.  Obviously, if you are using SMF 2.0 you will have to install (as drafts 1.08 did not support SMF 2.0).

You should expect to see version 2.0.1 of the drafts mod within a couple days at the most.
Title: Re: Drafts
Post by: Sakae on August 05, 2010, 05:02:18 PM
Thank you Charles! I'm uninstalling Spuds version and installing you now...
Title: Re: Drafts
Post by: Charles Hill on August 05, 2010, 05:31:24 PM
Quote from: Sakae on August 05, 2010, 05:02:18 PM
Thank you Charles! I'm uninstalling Spuds version and installing you now...

My version is not available yet.  Also,  I couldn't get the upgrade script to behave properly.  So if you have an  old version of drafts installed, you'll have to uninstall first before installing 2.0.1.  Your current drafts will be retained.
Title: Re: Drafts
Post by: Sakae on August 05, 2010, 05:32:50 PM
I kindly noted something was wrong... LOL

Waiting for the release :)
Title: Re: Drafts
Post by: Charles Hill on August 05, 2010, 07:36:51 PM
Got it working well on both SMF 1.1.11 and SMF 2.0 RC3.  Additionally I tested an installation of drafts 2.0.1 on a SMF 1.1.11 forum that had previously had drafts 1.08 installed and then uninstalled.  Worked great.  Going to run a few more tests and I just sent an email to Spuds requesting a detailed description of the database table(s) he used for his version of the drafts mod so that I can write in the necessary code to upgrade the db properly (and successfully transfer over existing drafts).
Title: Re: Drafts
Post by: Hj Ahmad Rasyid Hj Ismail on August 05, 2010, 07:57:12 PM
Hi Charles. This is off topic. I was wanting to ask you this since I see your post lately. Actually I am wondering whether you have any intention to continue with your zCommunity Mod anymore. I can't see any other mod similar to it until now. It is a very good mod and I really hope you can continue completing it.
Title: Re: Drafts
Post by: Charles Hill on August 05, 2010, 08:02:24 PM
Quote from: ahrasis on August 05, 2010, 07:57:12 PM
Hi Charles. This is off topic. I was wanting to ask you this since I see your post lately. Actually I am wondering whether you have any intention to continue with your zCommunity Mod anymore. I can't see any other mod similar to it until now. It is a very good mod and I really hope you can continue completing it.

It was a very big project.  I seriously doubt I'll have the time to do something like that right now or anytime soon.  What about it did you like the most?  Your input could help me come up with a mod that is smaller in scope/scale, but just as useful.  But again, no promises.
Title: Re: Drafts
Post by: Hj Ahmad Rasyid Hj Ismail on August 05, 2010, 08:08:22 PM
Well, I am still using it despite no support. It is working fine with SMF 2.0 RC3. I have worked some of the templates myself but is still nice. You can see it here: http://ahrasis.com/?blog=2.0
Title: Re: Drafts
Post by: Cal O'Shaw on August 06, 2010, 02:48:08 AM
Mr. Hill,

Welcome back!

Testing out your MOD on our 1.1.11 site right now.

Just wondering if at some point it might be possible for Admins to know how many drafts are in use.  Not who has how many (although that could help), and certainly not be able to look at them, but just to get an idea of how much the feature is used.  I would think the call for a count of how many drafts are in the drafts table would not require a lot of resource, but then I'm not writing the call :).

If not, no worries, but it would be helpful if possible.

Again, welcome back, and grazie mille!

Cal
Title: Re: Drafts
Post by: RAULVK on August 06, 2010, 05:37:38 AM
I can not erase the drafts save of my profile, help please.
Title: Re: Drafts
Post by: Bugo on August 06, 2010, 08:19:47 AM
This mod is far-out.
Please add russian translation (see attachments).
Title: Re: Drafts
Post by: gbsothere on August 06, 2010, 09:45:04 AM
Quote from: Charles Hill on August 04, 2010, 03:48:30 PM
Hello All,

Sorry I've been gone for so long.  The past couple months I've finally had a bunch of time to get things done that I've been too busy to do for a while.  As I told Spuds, I now had time to revisit the drafts mod.  I've been working the past few days on it.  Here are the changes as of now:

! Fixed Sticky problem




This is a good way to start my day.   ;)


Welcome back!
Title: Re: Drafts
Post by: Charles Hill on August 06, 2010, 03:01:56 PM
Quote from: Cal O'Shaw on August 06, 2010, 02:48:08 AM
Mr. Hill,

Welcome back!

Testing out your MOD on our 1.1.11 site right now.

Just wondering if at some point it might be possible for Admins to know how many drafts are in use.  Not who has how many (although that could help), and certainly not be able to look at them, but just to get an idea of how much the feature is used.  I would think the call for a count of how many drafts are in the drafts table would not require a lot of resource, but then I'm not writing the call :).

If not, no worries, but it would be helpful if possible.

Again, welcome back, and grazie mille!

Cal

I re-read this topic front to back when redoing this mod... I did notice your request for some kind of admin area.  It'll take some time to develop it, and I wanted to get what I had already done out to you guys as soon as possible.  I'll be out of town for 3 weeks starting next week, but I will try to get this done.  If you can think of specifics for what you'd like to be able to do with the admin area, that would helpful.  Thanks!  :)

I do very much appreciate any and all feedback that you guys have to share with me.  I do read it, and I will do my best to provide you with a solid modification for your forums.



Quote from: RAULVK on August 06, 2010, 05:37:38 AM
I can not erase the drafts save of my profile, help please.

You can delete drafts via the list of drafts that is displayed in your profile and on the post page.  If you are an administrator, you can view the drafts of your users in their profile page as well.  You should also be able to delete, edit, and post any of your users' drafts.

If you experiencing what you think is a bug with the mod, please post any errors from your logs that you think are related and a detailed description of what you are doing when you experience the would-be bug.



Quote from: gbsothere on August 06, 2010, 09:45:04 AM
This is a good way to start my day.   ;)


Welcome back!

Interested to hear how you like the new version :)



Quote from: Bugo on August 06, 2010, 08:19:47 AM
This mod is far-out.
Please add russian translation (see attachments).

Thank you for the compliment and the translation.  I'll be adding additional languages as individual installation packs on the drafts mod page.
Title: Re: Drafts
Post by: Cal O'Shaw on August 07, 2010, 02:45:13 AM
Mr. Hill,

Again, thank you for updating this MOD.  Looks really good.  An unintended side-effect has been when members have clicked REPLY and see all their pending drafts, they noticed that some have been waiting since 2008 and they go and delete them.  That is really helpful! :)  Grazie!

As to administrative features, as I noted earlier it would be helpful to know about how many drafts are in the database.  If you were to go further, being able to have a list of members and how many drafts (or just that they have drafts) would be helpful.  Each member name would be a link to the Show Drafts sub-function that displays the list of drafts for that member.

It might also be nice to set a post minimum before members can access the Drafts feature.  Just to preclude people coming in, creating a bunch of drafts because they don't know what they're doing, and then wandering on, never coming back and leaving drafts to age and fill the table.  (We would probably set it to something like 5, as we do want members to take advantage of this great MOD and if they post 5 messages, they are likely to stay around).

And, based on the above, if you're feeling really adventurous, in the AdminCP be able to set an age, in days, where drafts older than that age raise a flag on the AdminCP.  It might only list members who have one or more Drafts, or it might be a warning on the Post Reply page or Profile of the member to let them know they have some really old drafts that they probably will never send and could perhaps delete.


Hope this list isn't a bother, and that others will chime in, both in their view whether such things are useful or not, as well as their own suggestions.

Hope your three weeks away is for something enjoyable (holiday or such).

Grazie mille,

Cal
Title: Re: Drafts
Post by: Cal O'Shaw on August 07, 2010, 01:13:20 PM
I would agree with Spuds on adding a Save as Draft on the Quick Reply option.

I disagree with Spuds about collapsing the Drafts List by default.  Out of sight, out of mind.  So, might I suggest the following two checkboxes on the AdminCP:

- "By default, collapse the Drafts List"
- "Allow users to collapse Drafts List"

Hope these are useful.

Cal
Title: Re: Drafts
Post by: danielseeksGod on August 08, 2010, 02:17:10 PM
to fix the delete issue, just find and change "area=showdrafts" to "area=show_drafts" in the drafts.template file
Title: Re: Drafts
Post by: Charles Hill on August 09, 2010, 01:27:16 AM
Quote from: danielseeksGod on August 08, 2010, 02:17:10 PM
to fix the delete issue, just find and change "area=showdrafts" to "area=show_drafts" in the drafts.template file

Yup that's the fix to the bug Spuds was talking about (the problem deleting drafts).   Easy fix.  :)  Should be noted that bug is only for SMF 2.0.  Drafts for SMF 1.1 doesn't have that bug.  The fix will be included in the next release of the mod.  I'm leaving for my trip tomorrow, but I should be able to get started on incorporating some / possibly all of the suggestions put forth by Spuds and Cal O'Shaw.
Title: Re: Drafts
Post by: Cal O'Shaw on August 09, 2010, 02:01:46 AM
Grazie mille.  Safe travels.
Title: Re: Drafts
Post by: sonicfetish on September 01, 2010, 11:15:20 AM
Where do I enable this mod. I've installed it. It installed fine but I can't find how to use it or where to enable it. I know this seems like a dumb question but I really could use suck a cool mod.
Title: Re: Drafts
Post by: sonicfetish on September 01, 2010, 03:09:53 PM
Nevermind I found it... one problem though. When I choose to "Post it!" I get the following:

"An error has occured"
Hacker?


I've been called a lot of things but never a hacker.. lol
Title: Re: Drafts
Post by: Charles Hill on September 01, 2010, 04:58:58 PM
Quote from: sonicfetish on September 01, 2010, 03:09:53 PM
Nevermind I found it... one problem though. When I choose to "Post it!" I get the following:

"An error has occured"
Hacker?


I've been called a lot of things but never a hacker.. lol

Do you have any other mods installed?
Title: Re: Drafts
Post by: sonicfetish on September 01, 2010, 05:19:02 PM
Go Up & Go Down
Custom Greeting Mod
Avatar on Member List
Share This Topic
Drafts (for SMF 2.0 / SMF 1.1)
Aeva Media
Ad Seller Pro
Custom Field On Posting     
Display Name On Registration    1.9    
Enhanced Profile    1.1.5    
PaypalDonations    2.0    
Custom Tab    1.2    
EzPortal    0.4.0    
SMF File Manager    2.1.3    
Own Logo Links To Domain
Group on Registration      1.1.1      
Twitter and Facebook Publisher mod
Downloads Pro
Anti-Spam Verification Questions
Profile Comments
New Profile Layout | S-Ac
Title: Re: Drafts
Post by: Charles Hill on September 01, 2010, 06:22:42 PM
Anti-Spam Verification Questions is probably the problem.  I don't have time to look into it right now... but maybe in the next couple days.
Title: Re: Drafts
Post by: sonicfetish on September 02, 2010, 07:32:02 AM
that would be great... thanks
Title: Re: Drafts
Post by: Charles Hill on September 10, 2010, 12:14:41 PM
@ sonicfetish

After looking at the description for Anti-Spam Verification Questions, it seems as though that mod only messes with registrations (not posting).  Could you post a copy of your site's current Post.php so that I can figure out what is possibly the problem with your site in particular?  Could help find a conflict with another mod.  Could also just be your site.



@ Everybody

I've been super busy since I got back into town, so I haven't had much time to make a second release.  This is what I've got so far for 2.0.2:

! Fixed problem with deleting drafts (SMF 2.0)
! When posting a new topic with a poll via "Post it!" and loading a draft that has stored poll information... now verifies poll related permissions and forum settings
! Added checks for things like trying to post a draft of a reply to a locked topic (using "Post it!")
! Approval attributes for topics and replies now done properly when using "Post it!" (SMF 2.0)
+ Added "Save as Draft" button to Quick Reply
+ Added keyboard shortcut (alt+d / shift+alt+d) to "Save as Draft" button (all instances)

Haven't added an admin area or any draft related settings (yet).  And I still have to look into making the draft page of the user profile area consistent with the rest of the user profile pages (for SMF 2.0).
Title: Re: Drafts
Post by: qubbah on October 28, 2010, 01:26:34 PM
Having this problem

You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '`locked` tinyint(4) unsigned NOT NULL default 0,
ADD `isSticky` tinyint(4)' at line 2
File: /var/www/html/forum/Packages/temp/install2.php
Line: 67
Title: Re: Drafts
Post by: saks on November 11, 2010, 10:29:19 PM
Grate mod and easy to install!
How to insert the button "Save In draft" on quick reply page?
Title: Re: Drafts
Post by: dmacleo on November 13, 2010, 12:47:58 PM
fwiw tested on rc4, seems to work well.
Title: Re: Drafts
Post by: Teerapat on April 05, 2011, 01:20:14 PM
Excellent Mod!!!
I love this Mod very much.
It works well on SMF 2.0 RC5.
Thank you
Title: Re: Drafts
Post by: KensonPlays on April 11, 2011, 10:47:56 AM
When I emulated RC3 on RC5 it installed successfully but messes up the Stop Spammer mod and I cannot "Reject" or "approve" a user a DB thing in Sources/Subs-Members.php
Title: Re: Drafts
Post by: trex_ln on July 08, 2011, 11:14:40 AM
i have 2 error in error log please help.

Database error: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ')
WHERE b.ID_BOARD IN (8)
AND bp.ID_BOARD = IF(b.permission_mode = 1, b.ID_' at line 3
File: /home/smf/Sources/Security.php
Line: 787


and

8: Undefined variable: ID_MEMBER
File: /home/smf/Sources/Security.php
Line: 781


Can't save drafts but if i post by admin is not have error and can save.

Ps. i use SMF Version 1.1.10


Title: Re: Drafts
Post by: Phoenix1127 on July 10, 2011, 11:46:31 AM
Not sure if this mod is still being supported but I am trying to install it for a friend of mine on his SMF 2.0RC3 forum with the revontulet theme and am having some issues.

Install seems to go fine, but the Save as Draft buttons never show under a new topic or reply.  Additionally, when trying to make a normal new post, all users get a session timed out error.  So I had to uninstall the mod and users can now make new posts again without any problem.

My error log shows

http://www.identitycrisistg.com/index.php?action=post2;start=0;board=70
8: Undefined variable: drafts_template_loaded
File: /home/ident8/public_html/Themes/default/Post.template.php
Line: 571


and line 571 is as follows

==>571: if (!$context['make_event'] && $drafts_template_loaded !== false)
572: template_drafts_post_save_as_draft_button();


If anyone has any insight into what the issue is I would be very appreciative.  Thanks in advance for any help you can provide.
Title: Re: Drafts
Post by: Green™ on September 24, 2011, 08:12:23 AM
i installed this mod for SMF 2.0.1 .

installation was smooth.

sorry, if this version is not compatible .

but, i have some problem, if i save a post as a draft,  any user who visits my profile can see it and he can post it without my approval.

after other user posts my draft, the following error is getting logged in the errorLog -

"The database value you're trying to insert does not exist: id_topic
Function: notifymembersboard"

is there any other modification should i do inorder to avoid other users to post other users drafts..

edit is working fine - other users are not able to edit the draft(But,  if other user clicks on the edit button of the other members draft,  an empty editor is getting displayed. if i click on my draft edit button, editor is getting loaded wit the desired content).

Title: Re: Drafts
Post by: Iomega0318 on October 03, 2011, 01:58:59 AM
Quote from: Charles Hill on September 10, 2010, 12:14:41 PM
@ sonicfetish

After looking at the description for Anti-Spam Verification Questions, it seems as though that mod only messes with registrations (not posting).  Could you post a copy of your site's current Post.php so that I can figure out what is possibly the problem with your site in particular?  Could help find a conflict with another mod.  Could also just be your site.



@ Everybody

I've been super busy since I got back into town, so I haven't had much time to make a second release.  This is what I've got so far for 2.0.2:

! Fixed problem with deleting drafts (SMF 2.0)
! When posting a new topic with a poll via "Post it!" and loading a draft that has stored poll information... now verifies poll related permissions and forum settings
! Added checks for things like trying to post a draft of a reply to a locked topic (using "Post it!")
! Approval attributes for topics and replies now done properly when using "Post it!" (SMF 2.0)
+ Added "Save as Draft" button to Quick Reply
+ Added keyboard shortcut (alt+d / shift+alt+d) to "Save as Draft" button (all instances)

Haven't added an admin area or any draft related settings (yet).  And I still have to look into making the draft page of the user profile area consistent with the rest of the user profile pages (for SMF 2.0).

When do you plan to release this version? I need to delete some drafts lol..
Title: Re: Drafts
Post by: kasparh on January 17, 2012, 05:46:47 AM
Quote from: Iomega0318 on October 03, 2011, 01:58:59 AM
Quote from: Charles Hill on September 10, 2010, 12:14:41 PM
@ sonicfetish

After looking at the description for Anti-Spam Verification Questions, it seems as though that mod only messes with registrations (not posting).  Could you post a copy of your site's current Post.php so that I can figure out what is possibly the problem with your site in particular?  Could help find a conflict with another mod.  Could also just be your site.



@ Everybody

I've been super busy since I got back into town, so I haven't had much time to make a second release.  This is what I've got so far for 2.0.2:

! Fixed problem with deleting drafts (SMF 2.0)
! When posting a new topic with a poll via "Post it!" and loading a draft that has stored poll information... now verifies poll related permissions and forum settings
! Added checks for things like trying to post a draft of a reply to a locked topic (using "Post it!")
! Approval attributes for topics and replies now done properly when using "Post it!" (SMF 2.0)
+ Added "Save as Draft" button to Quick Reply
+ Added keyboard shortcut (alt+d / shift+alt+d) to "Save as Draft" button (all instances)

Haven't added an admin area or any draft related settings (yet).  And I still have to look into making the draft page of the user profile area consistent with the rest of the user profile pages (for SMF 2.0).

When do you plan to release this version? I need to delete some drafts lol..
this should be useful also to me. I tried to install drafts on smf 2.0.2, some minor problem (like when you use "post it!" you have an error message about "id_topic" on db, but the topic is posted), but the real big problem is the delete function not working.
The only way is to post the topic and remove it manually after.
In this way the mod is unusable.
any help very much appreciated
Title: Re: Drafts
Post by: Biology Forums on January 18, 2012, 09:14:13 PM
Interesting mod, any images?
Title: Re: Drafts
Post by: kasparh on January 19, 2012, 05:35:18 AM
this is the one i'm using:

http://custom.simplemachines.org/mods/index.php?mod=1264
Title: Re: Drafts
Post by: Iomega0318 on April 18, 2012, 09:17:19 AM
Ok two things,

When I delete a member from my forum I am getting the following message:

Unknown column 'id_member' in 'where clause'
File: /***/Sources/Subs-Members.php
Line: 373


after looking at the line of code it refers to it's complaining about my drafts not the actual members, which is why I am assuming I get an error but it will still delete the member from the database.. SMF is working fine and deletes the member then the drafts mod is called and wigs out..

    if (file_exists($sourcedir . '/Drafts.php'))
    {
        $smcFunc['db_query']('', '
            DELETE FROM {db_prefix}drafts
            WHERE id_member IN ({array_int:users})',
            array(
                'users' => $users
            )
        );
    }


**EDIT**
Think I figured this one out, nm :)
For more information on the error look here:
http://www.simplemachines.org/community/index.php?topic=474416

Also any news on the release of 2.0.2?
Title: Re: Drafts
Post by: TheListener on April 28, 2012, 12:22:56 AM

QuoteAlso any news on the release of 2.0.2?

This is highly unlikely as the mods author was last online on 30 October 2011,
Title: Re: Drafts
Post by: Biology Forums on April 28, 2012, 01:13:55 PM
BUG Report:

Deleting a draft from profile doesn't work.

How do i fix this? Using 1.x
Title: Re: Drafts
Post by: Iomega0318 on April 29, 2012, 03:00:22 AM
Quote from: Liam_michael on April 28, 2012, 01:13:55 PM
BUG Report:

Deleting a draft from profile doesn't work.

How do i fix this? Using 1.x

This was supposed to be fixed in 2.0.2 as well as a few things, so unfortunately either waiting on that or for someone else to fix it..
Title: Re: Drafts
Post by: FrizzleFried on April 29, 2012, 03:55:32 AM
Color me bummed.  2.0.2 here and I am having the same issues.  Can't delete and people can see drafts in other peoples profiles.

This was such a promising upgrade... I have people who tend to write A LOT of long posts... I am sure this would have been used.

Title: Re: Drafts
Post by: Iomega0318 on April 29, 2012, 04:18:12 AM
Quote from: FrizzleFried on April 29, 2012, 03:55:32 AM
Color me bummed.  2.0.2 here and I am having the same issues.  Can't delete and people can see drafts in other peoples profiles.

This was such a promising upgrade... I have people who tend to write A LOT of long posts... I am sure this would have been used.


I meant the draft mod upgrade, not SMF lol.. if you want there is another draft mod but it does not have any of the extra features this one does..
Title: Re: Drafts
Post by: Iomega0318 on May 10, 2012, 01:11:08 PM
I was wondering if anyone can help me with an error:
I am using this mod:
http://custom.simplemachines.org/mods/index.php?mod=3094

Undefined index: private
File: /***/Themes/default/Drafts.template.php (main sub template - eval?)
Line: 250


When looking into the file line 250 doesn't even exist, I believe the drafts file is attempting to "save" the private topic information but can't.. Is there any way to exclude it from checking?
Title: Re: Drafts
Post by: msauser2 on July 18, 2012, 05:11:46 PM
I also had the problem where the "Delete Drafts" button did not work.  (I'm using Drafts 2.0.1 with SMF 2.0.2.)  I fixed the problem by editing Themes/default/Drafts.template.php as follows:
Now it works!
Title: Re: Drafts
Post by: Wilcop™ on February 13, 2013, 12:03:17 PM
When i press "Post it" i get this error:
The database value you're trying to insert does not exist: id_topic

Thx

SMF v2.0.4
Title: Re: Drafts
Post by: snadge on March 15, 2013, 04:49:40 PM
cant delete saved drafts in SMF 2.0.4..?
Title: Re: Drafts
Post by: Arvacon on April 21, 2013, 04:55:33 PM
Hi.
A member wanted to delete his account, so his delete was pending at my "awaiting approval" list.
After I accepted his request and deleted the account, I received the bellow error:

Unknown column 'id_member' in 'where clause'
Αρχείο: /home/www/******/*******/www/Sources/Subs-Members.php
Line: 373

(The note of this error is at Greek language, so I will try to translate it as best I can)
Note: Your data base probably needs update. The forum's files are in version SMF 2.0.4, while the database is in version 2.0.2. The above error probably it will be fixed if you run the last version of the upgrade.php.

The member's account seems to deleted, but this error needs a solution as I see from the log file.

The line 373 at "Subs-Member.php" file is the " ); " text.


if (file_exists($sourcedir . '/Drafts.php'))
{
$smcFunc['db_query']('', '
DELETE FROM {db_prefix}drafts
WHERE id_member IN ({array_int:users})',
array(
'users' => $users
)
);
}




As it seems, this must be affected from this "Drafts" mod.

I use this mod for long time and I have accustom the way that it shows the saved topics, every time you open the reply editor, so I would like to continue using it.

So is there any way to fix this problem?



Ps: I know this problem have been posted 2 times before at other topics, but it seems it was not the right topics, so I hope to not created any confusion to the members.
Title: Re: Drafts
Post by: emanuele on November 28, 2013, 08:25:33 AM
Replace the code above with:
if (file_exists($sourcedir . '/Drafts.php'))
{
$smcFunc['db_query']('', '
DELETE FROM {db_prefix}drafts
WHERE member_id IN ({array_int:users})',
array(
'users' => $users
)
);
}
Title: Re: Drafts
Post by: makv on November 29, 2013, 06:18:35 AM
I have just un-installed this mod, but the Save as Draft button is still appearing when opening a New Topic.

Anyone have any idea how to get rid of this?
Title: Re: Drafts
Post by: jm_araujo on December 25, 2013, 02:31:43 PM
I'm using SMF 2.0.6.
There's a missing string in the language file:
$txt['permissiongroup_simple_drafts'] = 'Drafts';"
Without it in the simple view of permissions it won't show a title.

Also when you add the line to Profile.php:
$profile_areas['info']['areas']['show_drafts']['label'] = '<a href="' . $scripturl . '?action=profile;u=' . $memID . ';area=show_drafts">' . $txt['drafts'][2] . '</a> <span class="smalltext">(' . $num_drafts . ')</span>';

It should be:
$profile_areas['info']['areas']['show_drafts']['label'] = $txt['drafts'][2] . ' (' . $num_drafts . ')';

This way it displays much better in my forum.

Also had to change  in "Drafts.template.php":
"area=showdrafts" to "area=show_drafts
to be able to delete drafts as explained by msauser2

I also include a Portuguese (from Portugal) translation.
Title: Re: Drafts
Post by: jm_araujo on December 26, 2013, 06:28:20 PM
And line 627 in Drafts.php should not be:
'topic' => $topic
but
'topic' => $topicOptions['id']

Or else you will get an error when posting a new topic from a draft.

(this one took a bit longer to find and solve)
Title: Re: Drafts
Post by: KillerKeox on January 03, 2014, 05:15:24 AM
Sorry, I get an error, or is it normal  :P  ????
Title: Re: Drafts
Post by: Nolt on January 14, 2014, 05:49:56 AM
Hello,

recently I've translated modification to polish language. File attached.
Title: Re: Drafts
Post by: live627 on January 14, 2014, 11:32:02 PM
Thanks :)
Title: Re: Drafts
Post by: sardonick007 on January 25, 2014, 12:48:45 PM
Quote from: msauser2 on July 18, 2012, 05:11:46 PM
I also had the problem where the "Delete Drafts" button did not work.  (I'm using Drafts 2.0.1 with SMF 2.0.2.)  I fixed the problem by editing Themes/default/Drafts.template.php as follows:

  • Search for all occurrences of "area=showdrafts" (there should be two)
  • Change to "area=show_drafts"
Now it works!

Thank you for posting this. I just downloaded this mod today from the update of 24JAN2014 and it still had this "issue". Your post solved it for me. Thanks!!
Title: Re: Drafts
Post by: sardonick007 on January 25, 2014, 01:23:52 PM
Has anyone modified or found a way to not allow all members to see each others drafts? I'd like to allow my members to use the drafts mod but not be able to go to a profile and see how many drafts someone else has, or be able to view their drafts. Any ideas?
Title: Re: Drafts
Post by: live627 on January 25, 2014, 05:06:28 PM
I've just uploaded the 2.0.3 update which should fix that.
Title: Re: Drafts
Post by: 0patience on January 26, 2014, 05:13:14 PM
Quote from: live627 on January 25, 2014, 05:06:28 PM
I've just uploaded the 2.0.3 update which should fix that.
Using SMF 2.0.6
Just tried Drafts 2.0.3
When I install it and try to delete the drafts, it brings me back to the profile page.
If I click on the Show Drafts, the Draft is still there. I have to post the draft for it to clear it out of the list.

If you go to delete a member, you get an error
QuoteUnknown column 'id_member' in 'where clause'
File: /home/content/26/12305226/html/forum/Sources/Subs-Members.php
Line: 409
Uninstall Drafts and no error.

I'd really really like to use this mod, but the problems with it are hard to deal with.
Any advice would really be appreciated.
Title: Re: Drafts
Post by: live627 on January 26, 2014, 06:48:33 PM
Both bugs are fixed in 2.0.4.
Title: Re: Drafts
Post by: Mumeishi on January 26, 2014, 10:22:45 PM
Hi, I just installed your mod (2.04) with Package Manager into my forums and although it said it all went successfully, whenever I try to navigate to a new topic, reply, or the drafts page from my profile, the webpages don't load. Here's an example of the error when trying to post a New Topic:

QuoteThe webpage at [website]/forums/index.php?action=post;board=1.0 might be temporarily down or it may have moved permanently to a new web address.

Error code: ERR_CONTENT_DECODING_FAILED

Can you provide me with some assistance on how to fix this? I really want this draft functionality in our forums. It's a great mod, but I just can't get it to work. I'm no expert with this stuff either. These are my first forums.

Thanks in advance!
Title: Re: Drafts
Post by: live627 on January 26, 2014, 10:52:18 PM
This mod does not affect any output buffering.

Did that happen before you installed the mod?
Title: Re: Drafts
Post by: Mumeishi on January 26, 2014, 11:25:50 PM
No, the forums were fine right before installing the package.
Title: Re: Drafts
Post by: live627 on January 27, 2014, 09:09:35 PM
I have no idea how to help you. You can try the other drafts mod.
Title: Re: Drafts
Post by: FireDitto on January 30, 2014, 04:12:58 AM
Hi, I'm getting the following error:

QuoteTemplate Parse Error!
There was a problem loading the /Themes/default/Drafts.template.php template or language file. Please check the syntax and try again - remember, single quotes (') often have to be escaped with a slash (\). To see more specific error information from PHP, try accessing the file directly.

You may want to try to refresh this page or use the default theme.
syntax error, unexpected T_STRING, expecting ',' or ';'

I'm currently still on 2.0.6
Drafts 2.0.4
Title: Re: Drafts
Post by: live627 on January 30, 2014, 04:31:04 AM
Disable template eval, then report back, m'kay..
Title: Re: Drafts
Post by: emanuele on January 30, 2014, 06:31:13 AM
<td align="center">$context['page_ti$context['page_title']tle']
Copy&paste is evil, but testing is useful. :P
Title: Re: Drafts
Post by: live627 on January 30, 2014, 05:45:37 PM
lmao


true dat!
Title: Re: Drafts
Post by: FireDitto on February 05, 2014, 04:46:23 AM
Quote from: live627 on January 30, 2014, 04:31:04 AM
Disable template eval, then report back, m'kay..

I have no idea what you are talking about...
Title: Re: Drafts
Post by: GamePersia on February 07, 2014, 10:34:10 AM
How to edit this line
"Your work has been saved as a draft."
when we save draft,..the line appears in left,...
so i want to modify this line,...
i want to bold this line and adjust it in center and also make it little big !!
Help Needed
Title: Re: Drafts
Post by: Burt on February 09, 2014, 09:42:37 PM
Quote from: FireDitto on February 05, 2014, 04:46:23 AM
Quote from: live627 on January 30, 2014, 04:31:04 AM
Disable template eval, then report back, m'kay..

I have no idea what you are talking about...

You have no idea of what they are talking about, where I'm try to find the actual body of the message around all those silly tag lines....I'm getting too old for all this crap... ;D
Title: Re: Drafts
Post by: Burt on February 09, 2014, 09:52:33 PM
On a more serious note, I just install the 2.0.5 version and every time you try to delete a draft it goes to a new page with the following:


Quote

This XML file does not appear to have any style information associated with it. The document tree is shown below.

<smf>
    <shoutbox>11</shoutbox>
    <updated>0</updated>
</smf>


As you hit the back button in the browser the actual draft message has been deleted, so it works, but is is just that screen with the text that comes up.

Can someone help?

Thanks
Title: Re: Drafts
Post by: live627 on February 09, 2014, 11:25:53 PM
I like your humor :D

Can you list your installed mods?
Title: Re: Drafts
Post by: Burt on February 10, 2014, 12:45:53 AM
Quote from: live627 on February 09, 2014, 11:25:53 PM
I like your humor :D

Can you list your installed mods?

I was dead serious...  ;) Actually I may get one myself that takes two pages to load  ;D. lots of colours and plenty of pointless, useless informations and links... :laugh:  I guess I'm not 12 years old any more....
Oh well....

Do you reckon it has something to do with shoutbox, because the only shoutbox I have installed, is the one that came with Simple Portal 2.3.5...

I also had previously installed the draft version 2.0.3. But I did removed it before installing the 2.0.5
Title: Re: Drafts
Post by: Burt on February 10, 2014, 09:14:31 AM
Hello live627...

I don't know if this will help or not, but I just realise that if you save a draft and just after you have saved (you can still see the green message that confirm that you have save it), you click on the checkbox and select delete, you always get that page with that text.
But if you try to delete the same draft from the Profile page, then it works fine without showing the other page with the text.

Burt
Title: Re: Drafts
Post by: live627 on February 10, 2014, 05:16:29 PM

Can you list your installed mods?
Title: Re: Drafts
Post by: GamePersia on February 11, 2014, 01:09:44 AM
How to edit this line
"Your work has been saved as a draft."
when we save draft,..the line appears in left,...
so i want to modify this line,...
i want to bold this line and adjust it in center and also make it little big !!
Help Needed :'( :'(
Title: Re: Drafts
Post by: GamePersia on February 13, 2014, 07:40:05 AM
How to edit this line
"Your work has been saved as a draft."
when we save draft,..the line appears in left,...
so i want to modify this line,...
i want to bold this line and adjust it in center and also make it little big !!
live627 atleast reply to my problem !!
waiting for your reply willingly...... :-\
Title: Re: Drafts
Post by: Burt on February 13, 2014, 09:55:59 PM
Quote from: GamePersia on February 13, 2014, 07:40:05 AM
How to edit this line
"Your work has been saved as a draft."
when we save draft,..the line appears in left,...
so i want to modify this line,...
i want to bold this line and adjust it in center and also make it little big !!
live627 atleast reply to my problem !!
waiting for your reply willingly...... :-\

To make that bold and in the center just change this line in Draft.english.php

From this:

'Your work has been saved as a draft.',

To This:

'<center><strong>Your work has been saved as a draft.</strong></center>',

I wouldn't make the text any bigger than bold...
I tried and it didn't look good. But if you understand how it works now, you can change any text to anything you want by using the right Syntax...

Burt

Sorry, forgot... You can find the file  Draft.english.php is in Themes/default/languages on your server
Title: Re: Drafts
Post by: GamePersia on February 13, 2014, 10:40:09 PM
Quote from: Burt on February 13, 2014, 09:55:59 PM
Quote from: GamePersia on February 13, 2014, 07:40:05 AM
How to edit this line
"Your work has been saved as a draft."
when we save draft,..the line appears in left,...
so i want to modify this line,...
i want to bold this line and adjust it in center and also make it little big !!
live627 atleast reply to my problem !!
waiting for your reply willingly...... :-\

To make that bold and in the center just change this line in Draft.english.php

From this:

'Your work has been saved as a draft.',

To This:

'<center><strong>Your work has been saved as a draft.</strong></center>',

I wouldn't make the text any bigger than bold...
I tried and it didn't look good. But if you understand how it works now, you can change any text to anything you want by using the right Syntax...
Burt
Sorry, forgot... You can find the file  Draft.english.php is in Themes/default/languages on your server
It worked,...Thanks,..
but how to increase size ??
by adding this code : <size=xxpt></size>  ???.... ???
Title: Re: Drafts
Post by: Burt on February 14, 2014, 07:09:54 AM
Hi there...

Now, You have understood how it works, but I said "by using the right Syntax"

So in this case use this:

'<strong><center><span style="font-size: 16px;">Your work has been saved as a draft.</span></center></strong>',

You can then change the size of the fonts to what ever you like. If you like to experiment, just make a copy of the original file and just play with the other till you are happy with the results. You should also try to google these kind of questions, as the answers are already all out there....

Now go and play with all the other language text.php file that are inside the folder...  :D
Burt
Title: Re: Drafts
Post by: GamePersia on February 14, 2014, 07:19:35 AM
Quote from: Burt on February 14, 2014, 07:09:54 AM
Hi there...

Now, You have understood how it works, but I said "by using the right Syntax"

So in this case use this:

'<strong><center><span style="font-size: 16px;">Your work has been saved as a draft.</span></center></strong>',

You can then change the size of the fonts to what ever you like. If you like to experiment, just make a copy of the original file and just play with the other till you are happy with the results. You should also try to google these kind of questions, as the answers are already all out there....

Now go and play with all the other language text.php file that are inside the folder...  :D
Burt
Amazing Answer Burt !!... ;D
Title: Re: Drafts
Post by: Burt on February 16, 2014, 06:34:11 AM
Quote from: live627 on February 10, 2014, 05:16:29 PM

Can you list your installed mods?

Are you still alive?  :)
Title: Re: Drafts
Post by: live627 on February 16, 2014, 12:05:23 PM
Quote from: Burt on February 16, 2014, 06:34:11 AM
Quote from: live627 on February 10, 2014, 05:16:29 PM

Can you list your installed mods?

Are you still alive?  :)
No, I'm dead :D :P
Title: Re: Drafts
Post by: Burt on February 16, 2014, 09:02:49 PM
So you got me all dress up for the party then nothing!?  8)

I though you would have found the answer to the problem by now.... ;)

It is ok...mate.. You only get the error if you try to delete the draft from the same confirmation page. Other than that, your mod works fine...

Thanks anyway..

Burt


Title: Re: Drafts
Post by: live627 on February 16, 2014, 09:10:28 PM
I do not know why/how/what makes that error. Could be SimplePortal, but you also have a ****** tonne of mods installed. So yeah, drawing a blank here...
Title: Re: Drafts
Post by: sardonick007 on March 03, 2014, 02:54:48 PM
Quote from: live627 on January 25, 2014, 05:06:28 PM
I've just uploaded the 2.0.3 update which should fix that.

I forgot to say thank you for the update. Works a treat. Thank you for your work.
Title: Re: Drafts
Post by: live627 on March 04, 2014, 01:12:48 PM
Quote from: sardonick007 on March 03, 2014, 02:54:48 PM
Quote from: live627 on January 25, 2014, 05:06:28 PM
I've just uploaded the 2.0.3 update which should fix that.

I forgot to say thank you for the update. Works a treat. Thank you for your work.
Thanks for the update!
Title: Re: Drafts
Post by: Pyrhel on March 09, 2014, 09:51:22 PM
Hi there!
I think i found smt strange in the new version. After the update every user can see how much drafts have any other user. Also there is info about the topic subject, the board and the last saved time. Is that a normal behavior and can I stop it from showing that kind of information to any registered member?

Thanks :)
Title: Re: Drafts
Post by: FemR on May 04, 2014, 07:20:23 PM
Hi, Just want to report, installed latest version of this mod on SMF 2.0.2.
Everyone can see others' drafts, they can even post others' drafts.
Also 'Save as Draft' in Quick Reply doesn't show.
Title: Re: Drafts
Post by: margarett on May 04, 2014, 07:56:05 PM
More important, you should *REALLY* update your forum, at least up to 2.0.6. You are several security patches behind...
Title: Re: Drafts
Post by: NoPasaran on May 18, 2014, 06:01:53 PM
everyone can see drafts :S



Title: Re: Drafts
Post by: TourFL on June 19, 2014, 04:32:01 AM
Hello!

Thanks for this great mod  :)

I found a small mistake in the code, raising errors in the logs when publishing a draft (but without visible impact):

In Draft.mod, line 623 (version SMF2):
'board' => $boardOptions['board'],
shall be replaced by:
'board' => $topicOptions['board'],

I didn't see it reported anywhere, I hope this helps!
Title: Re: Drafts
Post by: Steve on June 19, 2014, 09:21:40 AM
Also, just a minor note: this in the first post gives me a 404 error:

Quote from: live627 on June 24, 2008, 01:11:04 PMThis mod is also available via my website here (http://www.degreesofzero.com/blog/article:2)

Title: Re: Drafts
Post by: Big Gee on July 24, 2014, 08:59:52 PM
I'm running SMF 2.0.7 at http://gardenerschat-shed.net/forum (http://gardenerschat-shed.net/forum)

I've just downloaded & installed the Drafts 2.0.5 mod so that members can save a draft for future editing before posting.

The mod seems to have installed OK BUT I now have two 'Save as Draft' buttons:

(http://gardenerschat-shed.net/forum/pics/save_as_draft_screenshot.jpg)

Whichever one is pressed after an editing session the message just gets posted as if the 'Post' button has been pressed.

Can anyone help me resolve this please?

Thanks,

G.[/font][/size]
Title: Re: Drafts
Post by: live627 on July 25, 2014, 01:22:37 AM
comic sans is not a good font to use - ever.
Title: Re: Drafts
Post by: live627 on July 25, 2014, 01:24:21 AM
you have duplicate code
Title: Re: Drafts
Post by: Big Gee on July 26, 2014, 08:21:12 PM
Quote from: live627 on July 25, 2014, 01:22:37 AM
comic sans is not a good font to use - ever.

Why? And how does that impact on my query?
Title: Re: Drafts
Post by: Big Gee on July 26, 2014, 08:25:24 PM
Quote from: live627 on July 25, 2014, 01:24:21 AM
you have duplicate code

O,K. Thanks. Would that be duplicate code because the 'Drafts' mod has been installed twice? Or is it a case that some of the coding is replicated in another mod?

More importantly can you give me some indicator on how to pinpoint the problem and more importantly how I could resolve the issue please?
Title: Re: Drafts
Post by: live627 on July 27, 2014, 01:00:56 AM
http://custom.simplemachines.org/mods/index.php?action=parse;mod=1264;attach=228538;smf_version=2.0.8
Title: Re: Drafts
Post by: Big Gee on July 29, 2014, 09:01:47 PM
Quote from: live627 on July 27, 2014, 01:00:56 AM
http://custom.simplemachines.org/mods/index.php?action=parse;mod=1264;attach=228538;smf_version=2.0.8

Thanks for that live627, but I find your 'minimalist' style answers a little vague. I've read the contents of the link you provided, but do I edit ALL those files to get the Draft mod to work? That's a hefty exercise. A short little explanation would help so that I don't have to continually come back to try and squeeze more information out of you! In the long run it takes longer than providing sufficient information to begin with.

I now find that if I uninstall the Draft mod then I get an error message that the Drafts 'template' cannot be loaded to open the site up at login. So I'm stuck with double 'Save as Draft' buttons that only post comments rather than save them for editing later.

Can you provide a bit more comprehensive support for me please?

thanks.

G.
Title: Re: Drafts
Post by: live627 on July 29, 2014, 09:17:26 PM
The link provided should show you which code is added. Some may be duplicated, such as

if (!$context['make_event'] && $drafts_template_loaded !== false)
template_drafts_post_save_as_draft_button();



in  ./Themes/default/Post.template.php
Title: Re: Drafts
Post by: RawsLy on August 18, 2014, 07:11:11 AM
when i'm trying to add new post,

Table 'kmurawsl_forum.smf_drafts' doesn't exist
File: /home/kmurawsl/public_html/forums/Sources/Drafts.php
Line: 226

how can i fix this?
Title: Re: Drafts
Post by: Justyne on August 22, 2014, 10:33:07 AM
Live, a German user contributed a translation for you here http://www.simplemachines.org/community/index.php?topic=526703.0 if you want to include it in your next build.
Title: Re: Drafts
Post by: live627 on September 07, 2014, 06:24:57 PM
Thanks! <3 :D
Title: Re: Drafts
Post by: MyTime on September 10, 2014, 10:35:11 AM
i'm still fairly new too all of this, but i'm getting a test failed while trying too install in

6.   Execute Modification   ./Themes/default/Post.template.php   Test failed
   1.   Add Before   ./Themes/default/Post.template.php   Test successful
   2.   Replace   ./Themes/default/Post.template.php   Test successful
   3.   Add Before   ./Themes/default/Post.template.php   Test successful
   4.   Add Before   ./Themes/default/Post.template.php   Test successful
   5.   Add After   ./Themes/default/Post.template.php   Test failed

Do I just select the (5. add after) and copy the find code it gives me and than add the code it's telling me after it like it says, sorry if this is  a noob question or if i'm posting this in the wrong place, but it is for this Drafts mod.
Title: Re: Drafts
Post by: Kimmie on September 25, 2014, 11:07:57 PM
Quote from: CannabisGamerClub on September 10, 2014, 10:35:11 AM
i'm still fairly new too all of this, but i'm getting a test failed while trying too install in

6.   Execute Modification   ./Themes/default/Post.template.php   Test failed
   1.   Add Before   ./Themes/default/Post.template.php   Test successful
   2.   Replace   ./Themes/default/Post.template.php   Test successful
   3.   Add Before   ./Themes/default/Post.template.php   Test successful
   4.   Add Before   ./Themes/default/Post.template.php   Test successful
   5.   Add After   ./Themes/default/Post.template.php   Test failed

Do I just select the (5. add after) and copy the find code it gives me and than add the code it's telling me after it like it says, sorry if this is  a noob question or if i'm posting this in the wrong place, but it is for this Drafts mod.


You need to FTP in, edit post.template.php Find the code it is looking for, and add the code it says to after it. Make sure you download a copy of that file before you make any changes. If you make a mistake you can reupload the file before it was changed so you will be back to where you started from.
Title: Re: Drafts
Post by: Ninja ZX-10RR on October 26, 2014, 11:32:59 PM
Referring to this (http://www.simplemachines.org/community/index.php?topic=525857.msg3757965#msg3757965) I might suggest a new feature/improvement/whatever-you-want-to-call-it ;)

It will be a bit different since I am supposed to work with the default theme so... Here we go.

Sources/Subs.php
Code (find) Select

'show' => allowedTo(array('profile_extra_any', 'profile_extra_own')),
),


Code (add after) Select

'drafts' => array(
'title' => $txt['draftsninja'],
'href' => $scripturl . '?action=profile;area=show_drafts',
'show' => allowedTo(array('save_drafts')),
),


And also languages/drafts.english.utf-8.php (or even non-utf, whatever it's the same in both files)
Code (find) Select

?>


Code (add before) Select

$txt['draftsninja'] = 'Drafts';


Refer to the message I linked above to see what it does (well in this case it will only be added below the "Forum profile" sub-menu since it's the default modification, if you install also the other one then the edits should be different).
Title: Re: Drafts
Post by: DSystem on November 01, 2014, 04:25:12 PM
I really like this mod  :) So it lacked automatic saving of drafts

Brazil Portuguese translation attached.
Title: Re: Drafts
Post by: Geor'G on November 04, 2014, 01:41:31 AM
Quote from: TourFL on June 19, 2014, 04:32:01 AM
Hello!

Thanks for this great mod  :)

I found a small mistake in the code, raising errors in the logs when publishing a draft (but without visible impact):

In Draft.mod, line 623 (version SMF2):
'board' => $boardOptions['board'],
shall be replaced by:
'board' => $topicOptions['board'],

I didn't see it reported anywhere, I hope this helps!
And not corrected.


To correct. The file Drafts.php:
Code (find) Select
$notifyData = array(
'body' => $row['body'],
'subject' => $row['subject'],
'name' => $user_info['name'],
'poster' => $user_info['id'],
'msg' => $msgOptions['id'],
'board' => $boardOptions['board'],
'topic' => $topicOptions['id']
);


Code (replace) Select
$notifyData = array(
'body' => $row['body'],
'subject' => $row['subject'],
'name' => $user_info['name'],
'poster' => $user_info['id'],
'msg' => $msgOptions['id'],
'board' => $topicOptions['board'],
'topic' => $topicOptions['id']
);
Title: Re: Drafts
Post by: Ninja ZX-10RR on November 04, 2014, 02:02:02 AM
edit: problem solved.
Title: Re: Drafts
Post by: Ninja ZX-10RR on November 22, 2014, 12:57:41 PM
:)
Title: Re: Drafts
Post by: ebola on November 30, 2014, 02:50:59 PM
Quote from: FemR on May 04, 2014, 07:20:23 PM
Hi, Just want to report, installed latest version of this mod on SMF 2.0.2.
Everyone can see others' drafts, they can even post others' drafts.
Also 'Save as Draft' in Quick Reply doesn't show.

Hi, I get same error using Draft 2.0.5 / SMF 2.0.9. Everyone can view others draft title (not content) and post others' drafts. How to fix this?
Title: Re: Drafts
Post by: Ninja ZX-10RR on November 30, 2014, 03:06:51 PM
Indeed that's true... I hope live will start to reply back again since he is not replying anywhere...
Title: Re: Drafts
Post by: live627 on December 01, 2014, 03:34:06 AM
2.1
================================================================================
! Users could see each others' drafts in the profile area
- Remove support for SMF 1.1.x
+ Added it_it (thanks Flavio93Zena)
! Wrong variable used (thanks TourFL)
+ Added pt_br (thanks DSystem)
Title: Re: Drafts
Post by: Ninja ZX-10RR on December 01, 2014, 07:59:55 AM
Awesome :D live... Is alive :P

Anyway it seems to work like a charm, thank you for the fix! It's much appreciated.
Title: Re: Drafts
Post by: live627 on December 01, 2014, 06:38:13 PM
np :)
Title: Re: Drafts
Post by: Justyne on December 05, 2014, 03:30:04 AM
Did the German translation that was provided not work? If something is missing let me know and I can fix it.
Title: Re: Drafts
Post by: khamseen on July 27, 2015, 07:39:38 AM
First off, great mod! I'd been wanting something like this for a while but kept forgetting to check and see if it existed, eventually got around to it during my massive overhaul of our site.

One thing though that I'm confused by, you mentioned that you'd added a "save draft" option to the quick reply box but it doesn't appear to be there and from looking at the install xml file, you don't modify the display.template at all to even attempt to insert the button so is that a feature you haven't actually implemented or did you forget to include the code for it?
Title: Re: Drafts
Post by: live627 on July 27, 2015, 08:23:11 PM
I do? Where?

Perhaps you confused this with the one by Arantor...
Title: Re: Drafts
Post by: khamseen on July 28, 2015, 08:01:50 AM
Quote from: live627 on July 27, 2015, 08:23:11 PM
I do? Where?

Perhaps you confused this with the one by Arantor...

Hmm, perhaps. Though I thought it because this was on page 14...


Quote from: Charles Hill on September 10, 2010, 12:14:41 PM
+ Added "Save as Draft" button to Quick Reply

Though I'm now suspecting that he's not related to this mod and thus shouldn't really have been posting updates about what exists in this mod's thread? Clearly I wasn't the only one confused by that post though as I ran a search of the topic looking for details of a quick reply save function and did see a lot of people quoting that post asking why it wasn't working haha.

Do you have any plans on adding it to the quick reply box? The only other drafts mod on the mods page seems to add it, but it has other short comings which are greater such as the inability to save polls and it doesn't seem to have any permissions for who can use it.

Title: Re: Drafts
Post by: khamseen on July 29, 2015, 09:06:46 AM
Just saw that you've pushed an update to GitHub with the option added to quick reply, thank you very much for that I'll go give it a try! :)
Title: Re: Drafts
Post by: Obcy on July 29, 2015, 10:24:22 AM
Conflict with Unread PM Favicon
http://custom.simplemachines.org/mods/index.php?mod=3389
If I click delete the drafts.
(https://dl.dropboxusercontent.com/u/17000521/Tymaczasowe/errordel.jpg)
How to fixit ?
Title: Re: Drafts
Post by: KungFuJoe on October 15, 2015, 11:01:32 AM
Quote from: Burt on February 09, 2014, 09:52:33 PM
On a more serious note, I just install the 2.0.5 version and every time you try to delete a draft it goes to a new page with the following:


Quote

This XML file does not appear to have any style information associated with it. The document tree is shown below.

<smf>
    <shoutbox>11</shoutbox>
    <updated>0</updated>
</smf>


As you hit the back button in the browser the actual draft message has been deleted, so it works, but is is just that screen with the text that comes up.

Can someone help?

Thanks

Hello,

I wanted to bump this issue because I'm having the same problem with Drafts 2.2 (previously had 2.0.5 and 2.1).  And it appears the conflicting mod is Shoutbox (and Shoutbox Pro).  If I disable Shoutbox, I'm able to delete drafts with no issue.

Title: Re: Drafts
Post by: Geor'G on December 04, 2015, 07:34:08 PM
Error saving option: "Post new topics, but hide until approved"
Title: Re: Drafts
Post by: nend on September 27, 2016, 11:09:09 PM
Just got done stylizing this to my needs. Looks like I have some more code to play around with.

Thanks to all that have contributed to this modifications development.
Title: Re: Drafts
Post by: nend on September 29, 2016, 07:56:14 AM
This line is causing issues in the post template.
is where it's at!
if (!isset($context['draft_saved']) || $context['draft_saved'] !== true)
echo '


What is happening here is the preview section is excluded after saving a draft. If a member decides to preview, the page is reloaded. Afterwords if they save again a duplicate is created.

A simple fix would be to just exclude the content of the preview div or display:none instead of excluding the entire div. This would give the JavaScript something to hook onto if the user decides to preview after saving.
Title: Re: Drafts
Post by: alexetgus on May 17, 2018, 08:26:19 PM
Hello,

French translation.

Title: Re: Drafts
Post by: jsx on March 06, 2019, 02:51:47 PM
@live627

There is a small mistake in the package-info.xml file:

<version>2.2/version>

As a result, the modification version 2.2 in package manager is not displayed.
Title: Re: Drafts
Post by: live627 on March 06, 2019, 05:06:39 PM
Was that worth 3 PMs?
Title: Re: Drafts
Post by: alexetgus on March 07, 2019, 04:15:00 AM
Quote from: jsx on March 06, 2019, 02:51:47 PM
@live627

There is a small mistake in the package-info.xml file:

<version>2.2/version>

As a result, the modification version 2.2 in package manager is not displayed.

Quote from: live627 on March 06, 2019, 05:06:39 PM
Was that worth 3 PMs?

;D
Title: Re: Drafts
Post by: jsx on March 07, 2019, 02:29:36 PM
Quote from: live627 on March 06, 2019, 05:06:39 PM
Was that worth 3 PMs?

Of course. There was not three private message about it. ::)

I think that you should answer for the errors reported. The second I reported in the subject AJAX Recent Topics (https://www.simplemachines.org/community/index.php?topic=248648.msg4008364#msg4008364).

That's it all.
Title: Re: Drafts
Post by: Arantor on March 07, 2019, 02:43:38 PM
Honestly, any private messages about any of it would be one too many, especially for such a minor thing that honestly doesn't matter to most people.
Title: Re: Drafts
Post by: StarredSkies on May 22, 2020, 05:41:56 PM
Hello! A user recently deleted some drafts and received this error. Any info or fix available?

(https://media.discordapp.net/attachments/395745417817620481/712868266196074506/unknown.png?width=878&height=321)