Author Topic: new chat feature. (show the love)  (Read 12348 times)

Offline Shecky

  • Bartender
  • O. M. G.
  • ****
  • Posts: 34672
  • Feh.
    • View Profile
Re: new chat feature. (show the love)
« Reply #30 on: June 01, 2010, 11:50:23 PM »
That's why I asked. Never mind.

Hey, you can't know if you don't ask.
Official forum rules and precepts; please read: http://www.jimbutcheronline.com/bb/index.php/topic,23096.0.html

Quote from: Stanton Infeld
Well, if you couldn't do that with your bulls***, Leonard, I suspect the lad's impervious.

meh

  • Guest
Re: new chat feature. (show the love)
« Reply #31 on: June 01, 2010, 11:51:34 PM »
Hey, you can't know if you don't ask.

You can /experiment\   ;D

Offline iago

  • The Merlin
  • Posty McPostington
  • *******
  • Posts: 3071
  • I'm the site administrator.
    • View Profile
    • Deadly Fredly
Re: new chat feature. (show the love)
« Reply #32 on: June 02, 2010, 12:23:31 AM »
We're *also* going to be giving most community topics about a 90 day window for inactivity before they go away -- but that's a manual (and now that I'm doing it, tedious) process and probably won't be done with high consistency. Pruning makes the database leaner, which will help the site function better.
Fred Hicks
I own the board. If I start talking in my moderator voice, expect the Fist of God to be close on my heels. Red is my Fist of God voice.
www.evilhat.com * www.dresdenfilesrpg.com
Support this site: http://www.jim-butcher.com/store/

Offline Niccos Shadow

  • Conversationalist
  • **
  • Posts: 399
    • View Profile
Re: new chat feature. (show the love)
« Reply #33 on: June 02, 2010, 06:50:55 PM »
We're *also* going to be giving most community topics about a 90 day window for inactivity before they go away -- but that's a manual (and now that I'm doing it, tedious) process and probably won't be done with high consistency. Pruning makes the database leaner, which will help the site function better.

Ouch. There's no way to add automatic topic pruning? Or is it just that doing so would prune off inactive topics that need to be kept like the rules, stickies, etc. ? If it's the latter, I'm sure something could be figured out to make it work and thus easier. But if it's just not available, you might want to look into it (or better, I'll look into it and provide links :P), I'm 99% sure we had automatic pruning set up on the forum I ran for my last MMO Guild.
Quote
"I still can't believe that you came to the Vampires' Masquerade Ball dressed as a vampire."
Quote
"Not just a vampire, a cheesy vampire. Do you think they got the point?"

Offline iago

  • The Merlin
  • Posty McPostington
  • *******
  • Posts: 3071
  • I'm the site administrator.
    • View Profile
    • Deadly Fredly
Re: new chat feature. (show the love)
« Reply #34 on: June 02, 2010, 07:05:19 PM »
I've written a perl script that'll take care of 90-95% of the job, actually. I just need to get the all-clear from Pris so I can point it at the other boards outside of the Community area.
Fred Hicks
I own the board. If I start talking in my moderator voice, expect the Fist of God to be close on my heels. Red is my Fist of God voice.
www.evilhat.com * www.dresdenfilesrpg.com
Support this site: http://www.jim-butcher.com/store/

Offline Niccos Shadow

  • Conversationalist
  • **
  • Posts: 399
    • View Profile
Re: new chat feature. (show the love)
« Reply #35 on: June 02, 2010, 07:16:44 PM »
I've written a perl script that'll take care of 90-95% of the job, actually. I just need to get the all-clear from Pris so I can point it at the other boards outside of the Community area.

Ah, ok. That makes more sense :P Just for future reference though, what SMF version are you using? I assume it's 2.0?
Quote
"I still can't believe that you came to the Vampires' Masquerade Ball dressed as a vampire."
Quote
"Not just a vampire, a cheesy vampire. Do you think they got the point?"

Offline iago

  • The Merlin
  • Posty McPostington
  • *******
  • Posts: 3071
  • I'm the site administrator.
    • View Profile
    • Deadly Fredly
Re: new chat feature. (show the love)
« Reply #36 on: June 02, 2010, 07:20:06 PM »
Ah, ok. That makes more sense :P Just for future reference though, what SMF version are you using? I assume it's 2.0?

I wouldn't make that assumption. The 2.x line is still all "release candidate" with its versions. Not ready for primetime, for my taste. :)

If you look at the bottom of the page you'll see the version we're on! :)
Fred Hicks
I own the board. If I start talking in my moderator voice, expect the Fist of God to be close on my heels. Red is my Fist of God voice.
www.evilhat.com * www.dresdenfilesrpg.com
Support this site: http://www.jim-butcher.com/store/

Offline Niccos Shadow

  • Conversationalist
  • **
  • Posts: 399
    • View Profile
Re: new chat feature. (show the love)
« Reply #37 on: June 02, 2010, 07:26:48 PM »
I wouldn't make that assumption. The 2.x line is still all "release candidate" with its versions. Not ready for primetime, for my taste. :)

If you look at the bottom of the page you'll see the version we're on! :)

Ah, duh, I probably should have checked more thoroughly (brain fart) :P Anyways, I was going through the mod list for various SMF versions. A lot of good stuff there. But it's well.. a lot :P
Quote
"I still can't believe that you came to the Vampires' Masquerade Ball dressed as a vampire."
Quote
"Not just a vampire, a cheesy vampire. Do you think they got the point?"

Offline Amber

  • Posty McPostington
  • ***
  • Posts: 4256
  • Enchanted Storm
    • View Profile
    • My Own Message Board
Re: new chat feature. (show the love)
« Reply #38 on: June 02, 2010, 07:48:47 PM »
Does the board by board purge built into SMF not work?  I've never tried to use it on my board.  Or is that what you mean by manual?
"I am among those who think that science has great beauty. A scientist in his laboratory is not only a technician: he is also a child placed before natural phenomena which impress him like a fairy tale."
- Marie Curie

Offline iago

  • The Merlin
  • Posty McPostington
  • *******
  • Posts: 3071
  • I'm the site administrator.
    • View Profile
    • Deadly Fredly
Re: new chat feature. (show the love)
« Reply #39 on: June 02, 2010, 07:56:07 PM »
Does the board by board purge built into SMF not work?  I've never tried to use it on my board.  Or is that what you mean by manual?

It doesn't appear to work when you have many thousands of topics with hundreds of thousands of messages. Nor, even, on a board with a much smaller set than that. It ran out of memory, and looked like it had removed a number of topics, but when I ran "recount forum statistics", all the topics re-appeared. So I had to make a perl script that did the job for me, partly by itemizing the task into a series of smaller queries and delete statements.
Fred Hicks
I own the board. If I start talking in my moderator voice, expect the Fist of God to be close on my heels. Red is my Fist of God voice.
www.evilhat.com * www.dresdenfilesrpg.com
Support this site: http://www.jim-butcher.com/store/

Offline Amber

  • Posty McPostington
  • ***
  • Posts: 4256
  • Enchanted Storm
    • View Profile
    • My Own Message Board
Re: new chat feature. (show the love)
« Reply #40 on: June 02, 2010, 08:05:08 PM »
Wow.  *bows to your awesome*

"I am among those who think that science has great beauty. A scientist in his laboratory is not only a technician: he is also a child placed before natural phenomena which impress him like a fairy tale."
- Marie Curie

Offline iago

  • The Merlin
  • Posty McPostington
  • *******
  • Posts: 3071
  • I'm the site administrator.
    • View Profile
    • Deadly Fredly
Re: new chat feature. (show the love)
« Reply #41 on: June 02, 2010, 08:23:50 PM »
Some parts of this can (and should) be done more elegantly, but this is the script.

Code: [Select]
#!/usr/local/bin/perl

$time = time();
$timeago90 = $time - ( 24*60*60*90 ) ; # 90 days ago
$timeago360 = $time - ( 24*60*60*360 ) ; # 360 days ago
$boards90 = "41,42,1,40,28,39,37,36"; # comma delimited list of board IDs that have a 90 day expiration
$boards360 = "22";

# ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = localtime(time);
# $year -= 1;
# $timeago = timelocal($sec,$min,$hour,$mday,$mon,$year);

use DBI;

# Replace with your connect information

$dbh = DBI->connect("DBI:mysql:DATABASENAME:localhost","DATABASEUSER","DATABASEPASSWORD");

# The prefix for my boards is "jbc_". Yours is likely different. You'd need to change that prefix wherever you find it below.

print "Beginning 90 day scan\n\n";

$sth = $dbh->prepare(qq(
        select b.id_topic, m.subject, m.posterTime
        from jbc_topics b, jbc_messages m
        where b.id_last_msg = m.id_msg
        and b.id_board IN ( $boards90 )
        and b.isSticky = 0
        and m.posterTime < $timeago90
));

$rv = $sth->execute;

while ( $row = $sth->fetchrow_hashref ) {
        push(@topics,$row->{id_topic});
        print "$row->{id_topic} ($row->{subject}) " . scalar(localtime($row->{posterTime})) . "\n";
}

print "\n\nBeginning 360 day scan\n\n";

$sth = $dbh->prepare(qq(
        select b.id_topic, m.subject, m.posterTime
        from jbc_topics b, jbc_messages m
        where b.id_last_msg = m.id_msg
        and b.id_board IN ( $boards360 )
        and b.isSticky = 0
        and m.posterTime < $timeago360
));


$rv = $sth->execute;

while ( $row = $sth->fetchrow_hashref ) {
        push(@topics,$row->{id_topic});
        print "$row->{id_topic} ($row->{subject}) " . scalar(localtime($row->{posterTime})) . "\n";
}

print $#topics + 1, " topics found\n\n";

print "\n\nBEGINNING TERMINATION in 5 seconds\n\n";

# Pause five seconds so you can kill the script from actually deleting topics. Point of no return after the break...

sleep 5;

foreach $topic ( @topics ) {

        print "Expunging topic $topic\n";

        $sth = $dbh->prepare(qq(
                delete from jbc_messages where id_topic = $topic
        ));

        $rv = $sth->execute;

        $sth = $dbh->prepare(qq(
                delete from jbc_topics where id_topic = $topic
        ));

        $rv = $sth->execute;

}


print "Now that this is done, you need to 'Recount all forum stats' to get the boards to look right!\n";
Fred Hicks
I own the board. If I start talking in my moderator voice, expect the Fist of God to be close on my heels. Red is my Fist of God voice.
www.evilhat.com * www.dresdenfilesrpg.com
Support this site: http://www.jim-butcher.com/store/

Offline Shecky

  • Bartender
  • O. M. G.
  • ****
  • Posts: 34672
  • Feh.
    • View Profile
Re: new chat feature. (show the love)
« Reply #42 on: June 02, 2010, 10:32:38 PM »
Some parts of this can (and should) be done more elegantly, but this is the script.

CODE MONKEY ALERT! RAISE SHIELDS!
« Last Edit: June 02, 2010, 11:02:44 PM by iago »
Official forum rules and precepts; please read: http://www.jimbutcheronline.com/bb/index.php/topic,23096.0.html

Quote from: Stanton Infeld
Well, if you couldn't do that with your bulls***, Leonard, I suspect the lad's impervious.