News:

Bored?  Looking to kill some time?  Want to chat with other SMF users?  Join us in IRC chat or Discord

Main Menu

Drafts

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

Previous topic - Next topic

Arantor

Nope, the emulate is only by default in 2.1...
Holder of controversial views, all of which my own.

Gwenwyfar

So emulate and version emulation would be two different things?  ??? I was just talking about version emulation when I said emulate, which since I just used it is in 2.0 as well.

Arantor

No, they're the same thing.

They just tell the package manager which version of SMF to use instead of the real version for the purposes of deciding what installation instructions to use.
Holder of controversial views, all of which my own.

Gwenwyfar

Then I don't get what you mean by
Quotethe emulate is only by default in 2.1...
if you also said that
QuoteVersion emulation is built in to 2.0.

Arantor

The one in 2.0 requires you to put the version number in yourself, the one in 2.1 looks at what's in the package and offers to emulate the most recent version for you without you having to click on anything - hence the 'by default' bit.
Holder of controversial views, all of which my own.

Gwenwyfar

Ahh, I see. That's definitely better, the one on 2.0 is quite on a hidden corner too.

Arantor

At least it had a UI, 1.1.x expected people to do it via URL manipulation until I made a mod for it :P
Holder of controversial views, all of which my own.

bethkozlowski

This might have been asked already, but any chance this will be available for 2.0.9?

Gwenwyfar

Read from here: http://www.simplemachines.org/community/index.php?topic=392598.msg3773445#msg3773445

Answers both questions (how to install and being available :P)

bethkozlowski

Thank you :) I'm brand new to Simple Machines, so I have no idea at all what I am doing LOL

Gwenwyfar

Quote from: bethkozlowski on December 19, 2014, 09:50:57 PM
Thank you :) I'm brand new to Simple Machines, so I have no idea at all what I am doing LOL
No problem :) Many of these mod topics can get way too long to read too, you can use the search to try to find what you want in them ;)

bethkozlowski

Quote from: Fortytwo on December 19, 2014, 09:54:56 PM

No problem :) Many of these mod topics can get way too long to read too, you can use the search to try to find what you want in them ;)
[/quote]

LOl I should have thought of that before I asked. *head desk*. Doesn't help that it's been a mega long day. This looks like an amazing Mod, and can't wait for it to be updated to be able to install into 2.0.9. (I did say I was new to SMF LOL). I'm still learning my way around this place.

Gwenwyfar

Well, actually you can. On the list packages area, on the bottom corner, go to advanced and type in 2.0.4, then install it ;)

Arantor

I will update this when I get free time, maybe next week.
Holder of controversial views, all of which my own.

Goten22

I figured out how to massive delete drafts. It deletes all drafts from all users but I think it's still better than deleting it one by one. It works as scheduled task so you can set the interval as you wish.


In themes/default/languages/ManageScheduledTasks.english.php add
$txt['scheduled_task_cleardrafts'] = 'clear ALL drafts';
$txt['scheduled_task_desc_cleardrafts'] = 'Delete all drafts for every user, clears database.';



In Sources/ScheduledTasks.php
function scheduled_cleardrafts()
{
global $modSettings, $sourcedir, $mbname, $txt, $smcFunc, $scripturl;

$timestamp = time() - (30 * 86400);
$query = 'TRUNCATE TABLE {db_prefix}post_drafts';

$result = $smcFunc['db_query']('',
$query,
array(
'timestamp' => $timestamp,
)
);
return true;
}


Now go to PHPmyADMIN on your server and find smf_scheduled_tasks. There copy existing or create new record. Here simple pattern.
   INSERT INTO {db_prefix}scheduled_tasks (id_task, next_time, time_offset, time_regularity, time_unit, disabled, task)
      VALUES (NULL, 0, 0, 1, "d", 1, "cleardrafts")

See attachment.

You can find new option under admin>scheduled tasks


Great mod BTW, thanks for it!

Gwenwyfar

I think there might be a problem with this mod on autosave + slow internet. I can't confirm its related solely with this mod and not because of another one I have interfering with it, merge posts, (and I don't have a slow internet to test in on my test server, so I'm only taking this info from users that trigger it. It seems to happen only to users posting from mobile or with wifi connection in a laptop) but what happens is that a topic gets locked if the user has permission and his post was (likely unproperly?) autosaved.

It also sometimes duplicates the post, though this does seem to happen only because of the automerge, could be a useful hint on what is going on. So the user will go on to post and it will post all autosaves of his message, one after the other. On pretty much all cable internet users, everything works properly. I actually haven't seen anyone with proper internet have this issue. I don't know if this happens when posting from the "post reply" area, most people just use quickreply.

I disabled the autosave and I have not seen it happen again since.

This error also started showing up on the logs:
http://domain.com/index.php?action=post2;draft;xml;board=142
2: in_array() expects parameter 2 to be array, null given
Arquivo: /home/name/public_html/Sources/Post.php
Line: 1420

And I can't think of any other mods doing something that could interfere with it besides automerge.

Grammy

Hi, Arantor; I was wondering if there are any plans to revamp this mod for 2.0.11?  I suspect you have a lot going on and may have moved on to other things, but one has to ask.   :)

Arantor

Emulate 2.0.4, should install.
Holder of controversial views, all of which my own.

Grammy

Quote from: Arantor on July 02, 2016, 08:57:22 AM
Emulate 2.0.4, should install.

Oh, I've not done that before (I'm still kicking the tires on SMF).  I see the option now, though, so I'll have a go.  Thanks! 

Arantor

If in doubt do it on a test forum first :)
Holder of controversial views, all of which my own.

Advertisement: