1 (edited by YonasH 2009-01-16 18:36)

Topic: [release] Lock topic (for moderators)

Hello

First I was doing it only for myself, but then decided to share. Thats why description is so long and maybe complex.

This extension let moderators to lock selectable topics for unruly users. You can select lock method in Administration » Settings » Features:
-Just disable posting - it mean that user can't post/quote in locked topic
-Disable posting and hide - like before + topic is hidden on viewforum and search pages (including search actions like "Show new posts"). User can access locked topics only manually
-Disable access - User can't access locked topics at all

Locks are turned off for assigned moderators and administrators, but there is one known bug (ONLY if option 2 or 3 is set). There is no moderator assign check on search pages, so existing locks are turned off only for administrators. It mean that:
case 1. user is moderator on forum X and is subscribed to locked topic Y (on this forum). He will be able to see this topic on viewforum (he should), but unable to find it through "New posts" or "Active topics" or "Show my subscriptions" (if subscribed) (he should too).
case 2. user is moderator on forum X and someone post into locked topic Y (on this forum). This topic will be marked as new on viewforum.php (it should), he will see "New posts" on index.php (he should), but after clicking it, there will be no result for this topic (it should be). If it was only topic with new posts, there will be "No results" info.

Of course it is strange situation when someone with locked topics became moderator wink

case 3. user is moderator on forum Z and had subscribed to locked topic Y (on X forum). In this case lock is working properly.
Bug exist only on forums moderated by this moderator and only in seach.php. On index.php, viewforum.php, viewtopic.php, post.php moderators are fully recognized.
I decided that there is very low probability for situation like this so I'm not planing to fix it.


There is no possibility to lock administrator or assigned moderator.

There is no admin/moderator check while sending subscriptions. All subscriptions for locked users are aborted.
If option 1 is selected subscriptions are sent normally.


Lock/Unlock option is displayed before "Report". If you will delete locked user post, then you can still unlock him using locked users list.
List is displayed in topic footer. I created new div for this, and I'm sharing this solution between 4 extensions:
-Favorite topic (check for new version)
-Hide topic (check for new version)
-Lock topic
-Show subscriptions
It mean that there is only one div (frame) created for all of them. Of course is working separately as well.


Version 0.9.5 beta
it's beta, but there should be no errors, others than described.
lock_topic_0.9.5_beta.zip

YonasH's repository + Extensions Directory = PunBB Extensions Online Library (in progress....)

Away. I will be back soon.

Re: [release] Lock topic (for moderators)

In final 1.0 version I'm planing to add "Show user's locked topics" link in usrer's profile (for moderators only).

I'm thinking about disabling possibility to unlock yourself. I mean if some user has some locks, and then he became moderator, he should be unable to remove those locks. What do you think? I will wait with this final release for few days and wait for your comments (if any wink )

YonasH's repository + Extensions Directory = PunBB Extensions Online Library (in progress....)

Away. I will be back soon.

Re: [release] Lock topic (for moderators)

mmm, when final version will be released. Thanks

MyFootballCafe.com  is Now Online!

4

Re: [release] Lock topic (for moderators)

Just installed the mod and on the post screen is the following error:

Notice: Undefined index: user_locked in C:\www\ajb\punbb\post.php(90) : eval()'d code on line 10

There is also an error on the post redirect page but I missed it to copy it.

I am a little confused what does this actually do? What I am looking for is the ability to disable a topic, so that it is invisible to users but not moderators. I thought this is what this did but after testing it I think I've misunderstood?

5

Re: [release] Lock topic (for moderators)

Hi YonasH, is there a way to add a preference  as the one I described a few days ago? My question of course excluded moderators and admins.

forum, Art, Architecture

Did you visit the textpattern forum?

Re: [release] Lock topic (for moderators)

There was no discusion and error reports, so that was final version wink
Now I have something to do. I'll work with this soon.

@colak
It should be new extension imo.

YonasH's repository + Extensions Directory = PunBB Extensions Online Library (in progress....)

Away. I will be back soon.