News:

Wondering if this will always be free?  See why free is better.

Main Menu

Drafts

Started by Arantor, July 26, 2010, 05:07:17 AM

Previous topic - Next topic

TheListener

All I see is a white page and no more.

???

Dhayzon

sorry
personally was trying to repair

but I can not

TheListener

Did you get a test failed when installing the mod?

Dhayzon


TheListener

Hey Spoogs ta for the update.


Draffi

Is there a way to show in the profile-info how many drafts the user have?

i mean:

Postings:               3467
Drafts:                       17


thank you, great Mod!

TheListener

This info is shown when you go to view how many posts a member has via their profile.

Wilcop™

#87
Quote from: FrizzleFried on April 29, 2012, 04:56:05 AM
Another interesting issue...

If you REMOVE a post that has drafts saved for it... you are unable to remove those drafts they are forever stuck in your drafts list.

:(

Sorry, my english is not so good today.

After deleting the real topic this sets the topic id from the draft on 0.
0 means "new topic".
Now you can easily delete the draft if needed.

It works perfectly for me on smf 2.0.4 and drafts 1.1.4.


Go to: Sources => RemoveTopic.php

Find:
$smcFunc['db_query']('', '
DELETE FROM {db_prefix}topics
WHERE id_topic IN ({array_int:topics})',
array(
'topics' => $topics,
)
);


Add after:
$smcFunc['db_query']('', '
UPDATE {db_prefix}post_drafts
SET `id_topic` = 0
WHERE `id_topic` IN ({array_int:topics})',
array(
'topics' => $topics,
)
);




But you have another problem as well.
When you move a topic the draft has not moved along.
The way to fix this.

Go to: Sources => MoveTopic.php

Find:
// Move the topic.  Done.  :P
$smcFunc['db_query']('', '
UPDATE {db_prefix}topics
SET id_board = {int:id_board}' . ($isRecycleDest ? ',
unapproved_posts = {int:no_unapproved}, approved = {int:is_approved}' : '') . '
WHERE id_topic IN ({array_int:topics})',
array(
'id_board' => $toBoard,
'topics' => $topics,
'is_approved' => 1,
'no_unapproved' => 0,
)
);


Add after:
// Move the draft also.  Done.  :P
if (!$isRecycleDest)
$smcFunc['db_query']('', '
UPDATE {db_prefix}post_drafts
SET id_board = {int:id_board}
WHERE id_topic IN ({array_int:topics})',
array(
'id_board' => $toBoard,
'topics' => $topics,
)
);

Draffi

QuoteThis info is shown when you go to view how many posts a member has via their profile.

SMF 2.0.4, default (Curve) Theme - I have no errors during the installation, but the Number of drafts are not showing for me...(as admin)

Including in my xampp-testground (with this as the only mod installed) it is not showing.

Please, can somebody provide a screenshot how it looks like? Is this in the menu?

Skaty

can we clear all drafts in one time ? all of forum or all of mine ?

Draffi

#90
Pls...nobody?




TheListener

Quote from: Draffi on July 23, 2013, 07:55:14 PM
Pls...nobody?

The drafts are shown in a persons profile.

Profile Info

Show Posts.

Magnolia Outdoors

"An Error Has Occurred!
The topic or board you are looking for appears to be either missing or off limits to you"

Despite not having a IT background I've been able to muddle through SMF over the last month to create a forum, hxxp:magnoliaoutdoorforums.com [nonactive], and load it up with some pretty nifty mods. I really like this draft mod but have hit a small snag that I could use a little help with.

I have a single draft saved within my profile that I can not remove. I receive the above error message when attempting to. I suspect I deleted the post/thread before I cleared my drafts. I've since incorporated the code provided by Wilcop into my source/move and source/remove files but that hasn't allowed me to remove the draft either.

Can someone tell me what file this draft may be stored in, how to locate and identify, or how to clear it else where?

Thanks in advance!   8)

Hristo

#93
Check http://www.simplemachines.org/community/index.php?topic=392598.msg3568046#msg3568046
BTW thank you Wilcop™

Magnolia, making these changes will not help to remove the old draft, so the easiest way is to uninstall the mod, during that it will ask you to remove all the mod's data, check the box and uninstall. Then install again and make the above changes.

Edit: This method will remove all the drafts. You may want to notice the members beforehand.

Draffi

Thank you, old fossil.

But i want to show the number of drafts inside the main-profil-page

(Where is:
Username:           Draffi
Posts:                  1350 (2 per Day)
Drafts:                 15
Email:                  [email protected]
Age:                     N/A
)

Magnolia Outdoors

Thanks to Hristo & Wilcop. Everything looks great again.

Note to others with same issue. I had already installed Wilcop's code prior to uninstalling and reinstalling and forgot about it before beginning the fix. It did not affect either the uninstall or install so if you already have it in, I suppose you can just leave it. It doesn't hurt a thing and will save you from having to do it again.

Arantor

There isn't a function to get the number of drafts in the profile page and doing so is not exactly efficient.

Bluearrow

I  installed today and having a little problem. Admins can see this Draft button but none of other members can see it. Only Admins.

I checked Forum > Post Settings but there are no additional options.

Installation didn't show me any errors.

I use Outline theme by DzinerStudio.

Arantor

Think you need to add permissions. Both simple drafts and auto-saved drafts need permissions to be enabled; admins have all permissions for everything by default.

Bluearrow

I checked General Permissions too. Couldn't find anything there either.

Advertisement: