Patch - locking of individual posts (General)

by erik_p, Wednesday, June 25, 2008, 01:43 (5755 days ago)

Hello!

I find that mostly when a thread needs to be locked it is due to a dispute that is no longer constructive. There can however be very interesting discussions at other places in the same thread. Locking of the whole thread thus seems to be somewhat less granular than what maybe is wanted.

I have made a patch for 2.0 beta 25, I haven't tried it on the RC, that does this. It allows locking of individual posts as well as locking of subthreads (that is; a post and all posts below it). It is fairly simple, since locking of a thread in the main release really just locks all posts in the thread. It also adds a "lock" symbol after the subject and time stamp in the complete thread view (which is also the only place where subthread locking can be done) if the post is locked.

Is anyone interested? Is there any interest in adding this to the dev branch of 2.0?

Regards,
Erik

locked
4132 views

Patch - locking of individual posts

by Uli @, Wednesday, June 25, 2008, 10:24 (5755 days ago) @ erik_p

Good idea and yes, I am interested. :yes:


Would you kindly post a link or send an email to me?


cheers

Uli

locked
3540 views

Patch - locking of individual posts

by erik_p, Wednesday, June 25, 2008, 21:39 (5754 days ago) @ Uli

Good idea and yes, I am interested. :yes:


Would you kindly post a link or send an email to me?


cheers

Uli

Ofcourse you can get the patch, see below.

The patch will *not* work against 2.0_RC1 !!!
I'll fix it and release another patch in a couple of hours - I hope :-)

Dont forget to save the originals before applying the patch - in the parent dir to the forum do a:
tar czf my-mlf.tar.gz forum/ --exclude 'templates_c/*'

You can get the patch from:
http://www.djingis.se/~ep/patch-lock-20b25.zip
Just put it in your forum directory and unzip it.

The changed files are:
ep@shere:~/src/mlf/forum$ svn -r 9:12 diff --summarize
M lang/english.lang
M includes/posting.inc.php
M includes/entry.inc.php
M templates/default/style.css
AM templates/default/images/lock2.png
M templates/default/entry.tpl.inc
M templates/default/thread_linear.tpl.inc
M templates/default/thread.tpl.inc


If you want a patch-file, you can get it from:
http://www.djingis.se/~ep/patchfile-lock-20b25.patch
cd to your forum directory and apply the patch with
patch -p0 < path/to/patchfile/patchfile-lock-20b25.patch

In the later case, you need the zip anyway, since there is a png (a monochrome lock) that you don't get from the patch file. Put the png (lock2.png) from the zip-file in templates/default/images/

As always, no guarantee about function. Please tell me if there are any problems and I'll try to fix them.

/erik

locked
3627 views

Patch - locking of individual posts

by erik_p, Wednesday, June 25, 2008, 23:40 (5754 days ago) @ erik_p
edited by erik_p, Thursday, June 26, 2008, 00:31

Below is the address to the patch for 2.0RC1. The only things that differed between beta25 and RC1, with impact on the patch, were the location of the template files. I guess the patch for beta 25 will work for beta 26 if you use the PATCHFILE (NOT the zip-file!!!), at least if you correct some possibly different paths in the patch file.

As before, no guarantee about function. Save the originals before applying the patch.

You either apply the patch with the zip file or with the patch file. Don't use both. (At least, dont try to apply the patch file to already patched files, if you dont want "strange" questions.)

Applying the patch using the zip-file
=====================================
You can get the patch here:
http://www.djingis.se/~ep/patch-lock-20RC1.zip
Put it in your forum dir and unzip it.

The changed files are, as before:
ep@shere:~/src/mlf/forum_RC1$ svn -r 3:4 diff --summarize
M lang/english.lang
M includes/posting.inc.php
M includes/entry.inc.php
AM templates/default/images/lock2.png
M templates/default/style.css
M templates/default/subtemplates/entry.tpl.inc
M templates/default/subtemplates/thread_linear.tpl.inc
M templates/default/subtemplates/thread.tpl.inc

Applying the patch using the patch file
=======================================
If you want to use a patch file instead, it is here:
http://www.djingis.se/~ep/patchfile-lock-20RC1.patch

cd to your forum dir and apply the patch, as before, with:
patch -p0 < /path/to/patchfile/patchfile-lock-20RC1.patch

As before, you need the lock2.png file from the zip-file if you apply the patch using the patchfile. You can however also get the png here:
http://www.djingis.se/~ep/lock2.png
Put it in templates/default/images/

Thus you don't need to download the zip file if you want to apply the patch using the patch file.

You can reverse the patch (applied in either way) with the patch file, if you do a:
patch -R -p0 < /path/to/patchfile/patchfile-lock-20RC1.patch
This will of course not remove lock2.png

You only need to download the png separately if you apply the patch using the patch file!

You can try to patch beta 26 by using the patch file for beta 25 (see the posting above), or by using the patch file for RC1. Check the paths in the patch file and change them if necessary, and it will probably work. You should *not* use the zip file to patch any other releases than the intended.

/erik

locked
3506 views

Patch - locking of individual posts

by erik_p, Thursday, June 26, 2008, 02:29 (5754 days ago) @ erik_p

I've forgotten to mention that it is of course possible to unlock subthreads and individual postings as well as locking them :-)

/erik

locked
3507 views

RSS Feed of thread