News:

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

Main Menu

I want 1000 subjects per page. How?

Started by rmcelwee, December 13, 2012, 07:30:09 AM

Previous topic - Next topic

rmcelwee

I have a ver 1.1.11 board that I have not messed with for years. I looked at it last night and it has become overrun with spam. I deleted the spam members by listing 1000 per page and doing mass deletes. Now I am left with 1000s of spam messages posted by "guest" accts in each forum. I would like to do a mass delete of 1000 messages per page until everything that was written in the past year or so is gone but I cannot find where the 1000 subjects per page option is. Any ideas?

hadesflames

Go to Admin > Maintenance > Forum Maintenance > Topics

It should be something similar to that.

There, you should be able to prune topics older than a specified number of days, in whatever boards you want. Should be faster than going through a bunch of pages.

rmcelwee

I need to do just the opposite of that. I want to remove all topics NEWER than 1 year old. All the good stuff I need to save is several years old.


Night09

You need to run a query on your databases messages table. You will have to make it if date newer than a certain one it deletes it.  I dont have the exact query to hand but thats the way id look at doing it.

rmcelwee

I don't have a clue on how to do that.

Still looking for a way to increase the number of subjects per page. I can't believe there is not a setting for this.

rmcelwee


MrPhil

QuoteAdmin > Maintenance > Forum Maintenance > Topics
It should be possible to (temporarily) modify the code/query that removes OLDER topics to remove NEWER ones by flipping a comparison. I can't look at it right now, but I'll try to remember to look at it tonight. That would be much safer than trying to manually update the database tables, as there are pointers between tables that need to be kept in sync.

I'm not sure it exists in SMF 1, but in SMF 2 when you deleted the spammers you could delete all their posts at the same time. It may be too late to consider that (upgrade to 2.0.3 first) if you've already deleted the member accounts.

emanuele

admin > posts and topic > topic settings
and set "Number of posts per page in a topic page"?
The you can register a new account, and go to all unread topics?


Take a peek at what I'm doing! ;D




Hai bisogno di supporto in Italiano?

Aiutateci ad aiutarvi: spiegate bene il vostro problema: no, "non funziona" non è una spiegazione!!
1) Cosa fai,
2) cosa ti aspetti,
3) cosa ottieni.

MrPhil

I did some digging through the code, and I think I found what we're looking for. Before running this modification, make a backup of your database just in case it does something unexpected! Use phpMyAdmin or some other database utility; don't use SMF's Admin database backup.

In Sources/RemoveTopic.php, find the following chunk of code in function RemoveOldTopics2():
// All we're gonna do here is grab the ID_TOPICs and send them to removeTopics().
$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']) . "$condition
AND t.ID_BOARD IN (" . implode(', ', array_keys($_POST['boards'])) . ')', __FILE__, __LINE__);


Take the line in there
AND m.posterTime < " . (time() - 3600 * 24 * $_POST['maxdays']) . "$condition
and flip the relation around:
AND m.posterTime >= " . (time() - 3600 * 24 * $_POST['maxdays']) . "$condition

I have not run this change, but I think it should be that one change. Remember that the labels and prompts are still for the old way (remove OLDER than N days) so don't get confused when you use it. When done, restore the code so you don't have an accident in the future.

By the way, this is 1.1.16 (I couldn't obtain a copy of 1.1.11), but it should be similar.

Sir Osis of Liver


That code block is the same in 1.1.11.

Ashes and diamonds, foe and friend,
 we were all equal in the end.

                                     - R. Waters

Advertisement: