News:

SMF 2.1.4 has been released! Take it for a spin! Read more.

Main Menu

Move Old Topics

Started by live627, October 24, 2006, 05:28:02 PM

Previous topic - Next topic

cellax

the help box speaks about REMOVE topics, I fixed.


On your language folder, look for "Help.english.php" (english means your language too)
Code (search for) Select
$helptxt['maintenance_rot']

Code (add before) Select
//Move Old Posts BEGIN
$helptxt['maintenance_mot'] = 'This allows you to <b>irrevocably</b> move old topics, if something goes wrong, you have to move topics one by one.  You should try to make a backup first, just in case you remove something you didn\'t mean to.<br /><br />Use this option with care.';
//Move Old Posts END

   
   
on your Theme folder, look for "Admin.template.php"
   
Code (search for) Select
// Moving any older posts.
echo '
<tr class="titlebg">
<td><a href="', $scripturl, '?action=helpadmin;help=maintenance_rot" onclick="return reqWin(this.href);" class="help"><img src="', $settings['images_url'], '/helptopics.gif" alt="', $txt[119], '" align="top" /></a> ', $txt['maintain_title'], ' - ', $txt['move_maintain_old'], '</td>
</tr>
<tr>
<td class="windowbg2">
<a name="rotLink"></a>';

               
Code (replace) Select
// Moving any older posts.
echo '
<tr class="titlebg">
<td><a href="', $scripturl, '?action=helpadmin;help=maintenance_mot" onclick="return reqWin(this.href);" class="help"><img src="', $settings['images_url'], '/helptopics.gif" alt="', $txt[119], '" align="top" /></a> ', $txt['maintain_title'], ' - ', $txt['move_maintain_old'], '</td>
</tr>
<tr>
<td class="windowbg2">
<a name="rotLink"></a>';


thx for this mod

Soti-Dragon

Hi Sleepy ...

I like the look of this mod, but I was wondering if there was a cheap and easy way to change if from Old Posts to Inactive Posts ... basing it off the last post in the thread, rather than the first.

I read somewhere in this thread that you thought that might be a seperate mod, or maybe you were referring to making it automatic.

I don't care if it is automatic, if it only happens when I am not to lazy to click the button, that is fine, but I would rather move inactive threads than active threads that are old.

Any idea's ? or shall I wait and hope someone makes that mod (mainly because my own coding ability is rather limited).

SleePy

I did take a peak at things, but to to be able to do this I would have to join another table (I think) in the query and get the last poster time. I haven't had the time at the moment to look into doing this though :)
Jeremy D ~ Site Team / SMF Developer ~ GitHub Profile ~ Join us on IRC @ Libera.chat/#smf ~ Support the SMF Support team!

Soti-Dragon

No problems ... I can wait ... and if you do manage to find the time to be able to do it ... I will shower you in monopoly money stolen from someone elses monopoly game ...  Thanks for looking though :)

SleePy

Soti-Dragon,

I just looked at this and the mod does do this by the last poster time.

    // Now that we made the checks lets get going with this function
    $request = db_query("
        SELECT t.ID_TOPIC
        FROM ({$db_prefix}topics AS t, {$db_prefix}messages AS m)
        WHERE m.ID_MSG = t.ID_LAST_MSG
            AND m.posterTime < " . (time() - 3600 * 24 * $_POST['maxdays']) . "
            AND t.ID_BOARD != ".$_POST['toboard']."
            $additional
            AND t.ID_BOARD IN (" . implode(', ', array_keys($_POST['boards'])) . ")", __FILE__, __LINE__);


That will check for where the id_msg is equal ot the id of the last message made and where the the poster time is below a certain limit. As well as a few other checks.

Jeremy D ~ Site Team / SMF Developer ~ GitHub Profile ~ Join us on IRC @ Libera.chat/#smf ~ Support the SMF Support team!

Soti-Dragon

Sleepy,

Thanks man ... total bonus, and you didn't even have to do any coding, just reading ... I'll shower you in monopoly money later ...

I'll chuck this into my forums and have a play ... thanks for your time man ... no doubt I will be posting in here if I fubar the intall ... (using custom skin) ... but I am pretty good at making mods work even with my customer skin ...

Thanks again for your time ...

SleePy

Well if your unsure about it, I always suggest a test forum. So if you screw things over, your live site isn't affected ;)
Jeremy D ~ Site Team / SMF Developer ~ GitHub Profile ~ Join us on IRC @ Libera.chat/#smf ~ Support the SMF Support team!

Soti-Dragon

Well, I am a lazy bugger, so put all mods into the Live forum, cross my fingers and pray ...

But this Mod works as I was hoping it would ...

Thank you man ... you are a legend ...

*bows down in worship to SleePy*

If you need any testing done for other mods, feel free to let me know, I am silly enough to break my forums :)

shacon

Will this work with ver. 2.0,  3 Beta Public?  I noticed that an error occurred for the manual install when submitted on modification link.

Thanks.

-shacon :)
we make a living by what we get...we make a life by what we give

SleePy

It should, but I would recommend you upgrade to 2.0 beta 4 Public :)
Jeremy D ~ Site Team / SMF Developer ~ GitHub Profile ~ Join us on IRC @ Libera.chat/#smf ~ Support the SMF Support team!

shacon

Quote from: SleePy on September 14, 2008, 03:00:09 PM
It should, but I would recommend you upgrade to 2.0 beta 4 Public :)

I would in a heartbeat, however the other admins want to wait until SMF is final.

-s
we make a living by what we get...we make a life by what we give

SleePy

I hope your admins realize that 2.0 Beta 4 Public had a security issue patched in it. May be something to consider.

I don't officially support old versions of 2.0, but if they install and work for you then it does  ;D

I do keep all releases I have ever done on my own site. So one of those versions most likely will work for 2.0 beta 3.
http://sleepycode.com/index.php/action,hacks/hack,2.html
Jeremy D ~ Site Team / SMF Developer ~ GitHub Profile ~ Join us on IRC @ Libera.chat/#smf ~ Support the SMF Support team!

wowyahoo

thanks for the mod link! I like it.

PetrusCorporated

HI! I've found a problem using this mod. I was moving some topics from a subforum to another, a lot of topics [it was over 300], and some of the moved topics become blank topics, like this one:

http://www.gtacrew.net/index.php?topic=3661.0

This Topic is in this subforum:

http://www.gtacrew.net/index.php?board=18.0

It's named 'Tupac esta vivo?', at the bottom of the page.

Do you have any idea about what happened, or how can I fix this? There are not too much blank topics, but it's a problem :S

SleePy

Do you get any errors in the error log?

This topic makes use of the built in SMF function for moving topics, so the only thing I can think of is there was to many to do at once and then a server time out happened resulting in not all the queries able to be executed.
Jeremy D ~ Site Team / SMF Developer ~ GitHub Profile ~ Join us on IRC @ Libera.chat/#smf ~ Support the SMF Support team!

DirtRider

Well I gave this mod a bash with the remove option and I got the following error

An Error Has Occurred!
Unable to verify referring url. Please go back and try again.
http://www.triumphtalk.com

"The real question is not whether machines think but whether men do. "

SleePy

Jeremy D ~ Site Team / SMF Developer ~ GitHub Profile ~ Join us on IRC @ Libera.chat/#smf ~ Support the SMF Support team!

DirtRider

Ooops sorry I am running RC1 but the funny thing another member here has had the same error when trying to do file maintenance http://www.simplemachines.org/community/index.php?topic=309729.0;topicseen so I am not sure now if this could be a RC1 bug or not
http://www.triumphtalk.com

"The real question is not whether machines think but whether men do. "

SleePy

Where you using multiple tabs in your browser.
This can happen sometimes when browsing around or if you clicked something, then went back and clicked on the submission button.

Basically what is going on is the SMF session check is saying our previous url doesn't match up to the site you are on. So its throwing the security error out.
Jeremy D ~ Site Team / SMF Developer ~ GitHub Profile ~ Join us on IRC @ Libera.chat/#smf ~ Support the SMF Support team!

defcrash

Hi there SleePy, this mod is exactly what i was looking for, thanks a lot! ;D

I've only have 2 questions, is the "igonre sticky" topics only avaiable at the version 1.3.5? Because i instaled the 1.3.4 version (cause i'm on the 2.0 beta 4) and i can't see that option! :-\

Another thing that i wanted to ask its if theres any way of adding this to the moderation center?

Thanks for your time,

Best Regards,
defcrash

Advertisement: