Auto lock topic

Looking for a MOD? Have a MOD request? Post here for help. (Note: This forum is community supported; phpBB does not have official MOD authors)
Get Involved
User avatar
ban_zai™
Registered User
Posts: 17
Joined: Mon Dec 12, 2005 4:59 pm
Location: Singapore
Contact:

Auto lock topic

Post by ban_zai™ » Sat Mar 22, 2008 6:20 am

Hi,

I am wondering if there is a mod to auto lock a topic on a set number of days/months posted?
Let's say i want a topic to be lock after 30 days of no reply, is it possible?

Thanks in advance.

User avatar
karlsemple
Former Team Member
Posts: 39802
Joined: Mon Nov 01, 2004 8:54 am
Location: Hereford, UK
Contact:

Re: Auto lock topic

Post by karlsemple » Sat Mar 22, 2008 6:23 am

Mod requests should be posted in the mod request forum which is where I am going to move this.
Image

mcK
Registered User
Posts: 23
Joined: Wed Dec 12, 2007 10:22 am

Re: Auto lock topic

Post by mcK » Sun Mar 23, 2008 11:06 am

I hope someone does this

stokerpiller
Registered User
Posts: 1934
Joined: Wed Feb 28, 2007 8:06 pm

Re: Auto lock topic

Post by stokerpiller » Sun Mar 23, 2008 10:16 pm

I would like this too.
I had it on my phpbb2 forum and it was GREAT :D
I am done with phpBB

User avatar
SuperMaurim®
Registered User
Posts: 12
Joined: Thu Aug 07, 2008 1:28 pm

Re: Auto lock topic

Post by SuperMaurim® » Thu Aug 07, 2008 3:47 pm

Do I need this much for MOD phpbb3. I found only for phpbb2. Someone could adapt it for me, please?

User avatar
SuperMaurim®
Registered User
Posts: 12
Joined: Thu Aug 07, 2008 1:28 pm

Re: Auto lock topic

Post by SuperMaurim® » Thu Aug 07, 2008 10:40 pm

anybody would help me? I need much this MOD.

User avatar
SuperMaurim®
Registered User
Posts: 12
Joined: Thu Aug 07, 2008 1:28 pm

Re: Auto lock topic

Post by SuperMaurim® » Fri Aug 08, 2008 12:25 pm

Please. Help me !!!

nobody would help me?

I need this MOD for phpbb3.

Shining Phoenix
Registered User
Posts: 27
Joined: Wed Feb 28, 2007 8:15 am
Contact:

Re: Auto lock topic

Post by Shining Phoenix » Sun Aug 10, 2008 1:27 am

*bump*

Every so often a newbie comes in and starts beating a dozen dead horses, so this mod would make moderating much easier.

Midwinter
Registered User
Posts: 1
Joined: Tue Oct 07, 2008 9:18 am

Re: Auto lock topic

Post by Midwinter » Tue Oct 07, 2008 9:23 am

I hope this isn't a dead horse yet. I hope this mod gets made. It would stimulate new discussions without having to erase old content.

User avatar
A_Jelly_Doughnut
Former Team Member
Posts: 34448
Joined: Sat Jan 18, 2003 1:26 am
Location: Where the Rivers Run
Contact:

Re: Auto lock topic

Post by A_Jelly_Doughnut » Tue Oct 07, 2008 1:38 pm

This is fairly easy to accomplish, code-wise. I'll try to get something put together :)
A Donut's Blog
"Bach's Prelude (Cello Suite No. 1) is driving Indiana country roads in Autumn" - Ann Kish

User avatar
Paul
Infrastructure Team Leader
Infrastructure Team Leader
Posts: 23720
Joined: Sat Dec 04, 2004 3:44 pm
Location: The netherlands.
Name: Paul Sohier
Contact:

Re: Auto lock topic

Post by Paul » Tue Oct 07, 2008 1:58 pm

A_Jelly_Doughnut wrote:This is fairly easy to accomplish, code-wise. I'll try to get something put together :)
I actually have this nearly finished already for someone else, I will be publising this later this week.
Knock knock
Race condition
Who's there?

My BlogMy Photosmy phpBB Extensionscustom phpBB work & Development

Vampire1812
Registered User
Posts: 31
Joined: Fri Sep 12, 2008 1:04 pm

Re: Auto lock topic

Post by Vampire1812 » Fri Nov 07, 2008 11:51 am

Sorry to necro the thread but did this get done?

9moska3
Registered User
Posts: 21
Joined: Sun Nov 16, 2008 12:00 am

Re: Auto lock topic

Post by 9moska3 » Wed Nov 19, 2008 3:51 pm

Paul wrote:
A_Jelly_Doughnut wrote:This is fairly easy to accomplish, code-wise. I'll try to get something put together :)
I actually have this nearly finished already for someone else, I will be publising this later this week.
So?

mtrs
Registered User
Posts: 2049
Joined: Sat Sep 22, 2007 2:39 pm

Re: Auto lock topic

Post by mtrs » Fri Nov 21, 2008 7:01 pm

I tried a short code for this, moderators and posters above 100 post counts are not affected, topic last post time checked and NORMAL_TOPICS locked upon reply/quote attempts.
I updated the code
http://www.phpbb.com/community/viewtopi ... #p10895205
Last edited by mtrs on Sat Jan 23, 2010 10:14 pm, edited 6 times in total.
I abandoned all of my mods.

User avatar
damsprivate
Registered User
Posts: 461
Joined: Sun Aug 17, 2008 10:39 pm
Location: indonesia
Contact:

Re: Auto lock topic

Post by damsprivate » Fri Nov 21, 2008 10:58 pm

mtrs wrote:I tried a short code for this, moderators are not affected, topic last post time checked and locked upon reply attempt.

Open
posting.php
Find

Code: Select all

$current_time = time(); 
Add after

Code: Select all

$current_time = time();
//Check topic last post time and lock if last post is older than 30 days - moderators and posters above 100 post counts are not affected
    if (($mode == 'reply' || $mode == 'quote') && !$auth->acl_gets('a_', 'm_') && !$auth->acl_getf_global('m_') && $user->data['user_posts'] < 100)
    {
    // Learn the last post time
        $sql = 'SELECT topic_last_post_time
            FROM ' . TOPICS_TABLE . '
            WHERE topic_id = ' . $topic_id;
               
        $result = $db->sql_query_limit($sql, 1);
          
        if ($row = $db->sql_fetchrow($result))
        {
            $topic_age = $row['topic_last_post_time'];
        }
        $db->sql_freeresult($result);
                  
        if ((time() - $topic_age) > 2592000 )//The last topic post 30 days old topics, are locked
        {
        //Lock topic and give error warning
            $sql = 'UPDATE ' . TOPICS_TABLE . "
                SET topic_status = 1
                WHERE topic_id = $topic_id";
            $db->sql_query($sql);
            
            trigger_error('This topic is too old to reply, so, it\'s locked now. Thanks.');
        }   
    }
//End of lock topic         
does this effect the theme ? btw really thanks. im looking for it too.
binus university 2009 .
"did u know that 17 august ( when i join this forum ) is at Indonesia independence day ? "

Locked

Return to “[3.0.x] MOD Requests”

Who is online

Users browsing this forum: No registered users and 21 guests

cron