Advertisement:

Author Topic: I want 1000 subjects per page. How?  (Read 3957 times)

Offline rmcelwee

  • Newbie
  • *
  • Posts: 5
I want 1000 subjects per page. How?
« on: December 13, 2012, 07:30:09 AM »
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?

Offline hadesflames

  • SMF Hero
  • ******
  • Posts: 2,773
  • Gender: Male
  • C++ Coder
Re: I want 1000 subjects per page. How?
« Reply #1 on: December 13, 2012, 06:24:58 PM »
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.

Offline rmcelwee

  • Newbie
  • *
  • Posts: 5
Re: I want 1000 subjects per page. How?
« Reply #2 on: December 14, 2012, 09:03:03 AM »
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.

Offline rmcelwee

  • Newbie
  • *
  • Posts: 5
Re: I want 1000 subjects per page. How?
« Reply #3 on: December 17, 2012, 08:09:05 PM »
Anyone?

Offline Night09

  • SMF Hero
  • ******
  • Posts: 1,940
  • Gender: Male
Re: I want 1000 subjects per page. How?
« Reply #4 on: December 17, 2012, 09:11:17 PM »
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.

Offline rmcelwee

  • Newbie
  • *
  • Posts: 5
Re: I want 1000 subjects per page. How?
« Reply #5 on: December 22, 2012, 10:32:26 AM »
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.

Offline rmcelwee

  • Newbie
  • *
  • Posts: 5
Re: I want 1000 subjects per page. How?
« Reply #6 on: January 23, 2013, 09:55:43 AM »
Still looking for help on this...

MrPhil

  • Guest
Re: I want 1000 subjects per page. How?
« Reply #7 on: January 23, 2013, 10:06:27 AM »
Quote
Admin > 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.

Offline emanuele

  • SMF Super Hero
  • *******
  • Posts: 14,156
  • Gender: Male
  • THERE'S JUST ME
Re: I want 1000 subjects per page. How?
« Reply #8 on: January 23, 2013, 11:43:48 AM »
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

  • Guest
Re: I want 1000 subjects per page. How?
« Reply #9 on: January 23, 2013, 10:11:37 PM »
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():
Code: [Select]
// 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
Code: [Select]
AND m.posterTime < " . (time() - 3600 * 24 * $_POST['maxdays']) . "$conditionand flip the relation around:
Code: [Select]
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.

Offline Sir Osis of Liver

  • SMF Super Hero
  • *******
  • Posts: 10,936
  • We were all equal in the end.
Re: I want 1000 subjects per page. How?
« Reply #10 on: January 23, 2013, 10:25:07 PM »

That code block is the same in 1.1.11.

“The best laid schemes o' mice an' men / Gang aft a-gley.” - Robert Burns