News:

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

Main Menu

Recycle Bin Cleaner

Started by SONSiVRi, September 29, 2008, 06:03:21 PM

Previous topic - Next topic

SONSiVRi

Link to Mod

Brief:

  • This mod gives you auto cleaning option of your Recyle Bin board.
  • Normally there is no option set for cleaning old aged recyled topics.
    You send removed topics into Recycle Bin and they will stay forever until you purge from there.
  • With this mod you can set age for recyled topics and leave rest to the mod.
    Older topics than your setting will be purged every day.
  • Also there will be manual purge option in Forum Maintenance (If recycling of deleted topics enabled).
    You can manually purge recyled topics from there.
  • Beware: Exist posts and topics (sticky or not) in Recycle Bin will be emptied in first time installation.
    Move them into another place if you need. Take a database backup just in case.

Version Info:

  • Its only working with smf 1.1.x versions.

How To Use:

  • Download mod file and place it in packages folder and then begin the setup process within admin panel.
  • This mod changing 10 file.
  • Manually edit your MessageIndex.template.php if you use custom theme shown as below.
  • Default option of Auto clean recycle bin is disabled. You need to enable it after installation. Its located under:
    "Admin (Top Menu) -> Boards (Lef handed menu) -> Settings (Upper Menu)".
  • You can find manual purge option in (It will shown if recycling of deleted topics enabled)
    "Admin (Top Menu) -> Forum Maintenance (Lef handed menu)".
  • Help of each settings are included, just click the icons and see whats those options for.
  • In default working of Recycle Bin; it sorts topics according to posting date, not the date of deleting.
    With this mod forum engine will sort Recycled Posts according to their deletion time.
  • For doing this; Last post column replaced with Recycled time in Recycle Bin board.
  • If you setup correctly, forum engine will purge Recyle Bin once for every day at 00:00.

Version History:

  • v1.1 (11-06-2009)

    • Fixed db_query error (missing __FILE__, __LINE__).
  • v1.0 (10-09-2008)

    • Initial release.




Manual Edit Custom Theme: (MessageIndex.template.php)
Find:
<td class="catbg3" width="22%"><a href="', $scripturl, '?board=', $context['current_board'], '.', $context['start'], ';sort=last_post', $context['sort_by'] == 'last_post' && $context['sort_direction'] == 'up' ? ';desc' : '', '">', $txt[111], $context['sort_by'] == 'last_post' ? ' <img src="' . $settings['images_url'] . '/sort_' . $context['sort_direction'] . '.gif" alt="" />' : '', '</a></td>';

Replace:
<td class="catbg3" width="22%"><a href="', $scripturl, '?board=', $context['current_board'], '.', $context['start'], ';sort=last_post', $context['sort_by'] == 'last_post' && $context['sort_direction'] == 'up' ? ';desc' : '', '">', ((!empty($modSettings['recycle_enable']) && !empty($modSettings['recycle_board'])) && ($modSettings['recycle_board'] == $context['current_board'])) ? $txt['recycle_recycled_time'] : $txt[111], $context['sort_by'] == 'last_post' ? ' <img src="' . $settings['images_url'] . '/sort_' . $context['sort_direction'] . '.gif" alt="" />' : '', '</a></td>';




Uninstall:

  • First of uninstall this mod within admin panel.
  • If you manually edited your custom theme, dont forget to change it back.
  • recycledTime column in {$db_prefix}topics table wont be deleted, in case you install back.
    If you wont install this mod back, delete that column without hesitate.
  • You can use SQL codes shown as below, or do it by yourself.

Manual Uninstall SQL Entries:

  • Use this SQL code to delete unnecessary column (smf_ is table prefix, change with yours).
ALTER TABLE `smf_topics`
DROP `recycledTime`;



  • Use this SQL code to delete modsettings variables used by this mod.
DELETE FROM `smf_settings`  WHERE `variable`  IN (
'recycle_auto',
'recycle_amount',
'recycled_date'
);


My Mods - IP View Permission - Recycle Bin Cleaner - Ip to Country
www.sonsivri.com - microcontrollers
- Houston, we have a problem.

qtime

Great future! Will it decrease the post count after deleting the posts?

SONSiVRi

Quote from: qtime on November 20, 2008, 03:23:55 PM
Great future! Will it decrease the post count after deleting the posts?

Answer is no. But there is a mod for it, name like "post recount" or something else. This mod give you re-calculation of total posts while maintenance.
My Mods - IP View Permission - Recycle Bin Cleaner - Ip to Country
www.sonsivri.com - microcontrollers
- Houston, we have a problem.

qtime

thanks for your prompt reply, I am looking for this function, without reducing post count, because members have access to some boards wich are post counted.

SONSiVRi

ahh you mean you don't want to reduce user's post count?
If you want re-calculate (and reduce), I can help with that.
My Mods - IP View Permission - Recycle Bin Cleaner - Ip to Country
www.sonsivri.com - microcontrollers
- Houston, we have a problem.

qtime

Ok, thanks for offering the help. I like to keep the total posts a member the same, after cleaning up my trashbin.
It contains:
386635 Posts
86279 Topics
So if I understand it correct, no other action is needed, only move all posts to another temp board before installing your modification.

SONSiVRi

Yep, you understood correctly.
Because recycle bin controls deleted date at every midnight and wipes out topics older than your setting. In this case your whole old deleted topics will wiped out at first midnight (and once for after installation) because no deleted date is set.
But its always better idea to make a backup first.
My Mods - IP View Permission - Recycle Bin Cleaner - Ip to Country
www.sonsivri.com - microcontrollers
- Houston, we have a problem.

L'AltroWeb

Thanks!
This mod is very useful and I've installed without any problem.
But I've one question for qtime:
In my forum when a post/topic will be deleted (send to recycle bin board) user post count is decreased by default. In your forum is different?

edi67

i hope to see it for smf 2.0 version thx
CrazyZone - My SMF Forum


From the difficult the hardening of the man you can see

L'AltroWeb

Quote from: edi67 on January 22, 2009, 12:25:42 PM
i hope to see it for smf 2.0 version thx
Hi! edi67 :)
Please can you confirm if, from default, post count is decreased or not?

edi67

Quote from: Dark-Wolf on January 22, 2009, 12:28:50 PM
Quote from: edi67 on January 22, 2009, 12:25:42 PM
i hope to see it for smf 2.0 version thx
Hi! edi67 :)
Please can you confirm if, from default, post count is decreased or not?

i have smf 2.0 and not work for me i waiting for my version ;) if will be released
CrazyZone - My SMF Forum


From the difficult the hardening of the man you can see

L'AltroWeb

OK thanks!
PS: i've test "purge now" function but i receive this error:
Unable to verify referring url. Please go back and try again.
i've prettyurls installed.

SONSiVRi

Quote from: Dark-Wolf on January 22, 2009, 12:07:04 PM
Thanks!
This mod is very useful and I've installed without any problem.
But I've one question for qtime:
In my forum when a post/topic will be deleted (send to recycle bin board) user post count is decreased by default. In your forum is different?
It depends options of "recycle bin" board. You have a checkbox in there and it counts posts or not. So if you unchecked it, then deleting process will automatically decrease post count.

Quote from: Dark-Wolf on January 22, 2009, 03:43:38 PM
OK thanks!
PS: i've test "purge now" function but i receive this error:
Unable to verify referring url. Please go back and try again.
i've prettyurls installed.
Then it must be about it. I never installed that mod before, so I don't know what can be problem. I will took care of it, but I have no time right now. So please be patient for that error.

Quote from: edi67 on January 22, 2009, 12:25:42 PM
i hope to see it for smf 2.0 version thx
Unless smf 2.0 is final version, I can't touch it. Later on I will prepare for 2.0 (I hope I do have time then).
My Mods - IP View Permission - Recycle Bin Cleaner - Ip to Country
www.sonsivri.com - microcontrollers
- Houston, we have a problem.

xyxis_fahim

Hello,
Will this reduce the number of over all post in forum to actual one right?

SONSiVRi

Quote from: xyxis_fahim on February 14, 2009, 09:00:41 PM
Hello,
Will this reduce the number of over all post in forum to actual one right?
I didn't get you but if you are asking this; yes this mod will wipe of current recycle bin's content and your total post count will reduce.
My Mods - IP View Permission - Recycle Bin Cleaner - Ip to Country
www.sonsivri.com - microcontrollers
- Houston, we have a problem.

xyxis_fahim

Quote from: SONSiVRi on February 15, 2009, 04:50:17 AM
Quote from: xyxis_fahim on February 14, 2009, 09:00:41 PM
Hello,
Will this reduce the number of over all post in forum to actual one right?
I didn't get you but if you are asking this; yes this mod will wipe of current recycle bin's content and your total post count will reduce.
Yes I was asking , Thanks for clarifying it.

villasg

Plz need some help .
Have errors .
take a look

2: Missing argument 3 for db_query(), called in /home/thai.gr/www/forum/Sources/Subs.php on line 3792 and defined
Αρχείο: /////////////Sources/Subs.php
Γραμμή: 238


2: Missing argument 2 for db_query(), called in /home/thai.gr/www/forum/Sources/Subs.php on line 3792 and defined
Αρχείο: ////////////Sources/Subs.php
Γραμμή: 238


line 3792 is :    ");

from 3787 to 3792
db_query("
UPDATE {$db_prefix}settings
SET value = $current_date
WHERE variable = 'recycled_date'
AND value <> $current_date
");


Any help plz ? ?

Eclipse16V

I need it for my SMF 2.0RC1

THX
I worked with:
SMF 2 in German

Shop:
SID Giessen

SONSiVRi

Quote from: villasg on March 23, 2009, 09:11:54 AM
Plz need some help .
Have errors.

Any help plz ? ?

It's my mistake, I forgot to add 2nd and 3rd operators into query. You need to change your code between lines 3787 and 3792. Here is a summary;

Code (find) Select
db_query("
UPDATE {$db_prefix}settings
SET value = $current_date
WHERE variable = 'recycled_date'
AND value <> $current_date
");


Code (replace) Select
db_query("
UPDATE {$db_prefix}settings
SET value = $current_date
WHERE variable = 'recycled_date'
AND value <> $current_date
", __FILE__, __LINE__);


Please leave your feedback about result.
My Mods - IP View Permission - Recycle Bin Cleaner - Ip to Country
www.sonsivri.com - microcontrollers
- Houston, we have a problem.

SONSiVRi

Quote from: Eclipse16V on March 26, 2009, 01:08:05 AM
I need it for my SMF 2.0RC1

THX

You may port it yourself. I can only work for it when 2.0 becomes final and I have a free time.
My Mods - IP View Permission - Recycle Bin Cleaner - Ip to Country
www.sonsivri.com - microcontrollers
- Houston, we have a problem.

Advertisement: