_TOGGLE

Donations

Donate with PayPal!
Help support Pro_News and become a member of our Sponsors Group
The tip jar is at PayPal, but does not require a PayPal account
مجهول $ 10.00
macavity $ 115.00
RedGerry £ 50.00
مجهول $ 10.00
minor $ 20.00

User Info


مرحبا مجهول


عضوية:
الأخير: Witewolf
جديد اليوم: 0
جديد بالأمس: 0
الكل: 151

المتصفحون الآن:
الأعضاء: 0
الزوار: 36
Bots: 2
المجموع: 38
من و أي:
 الزوار:
Support Forums
Pro News Articles
Nedlastninger
Pro News Articles
Pro News Articles
Support Forums
Support Forums
Support Forums
Downloads
Downloads
Support Forums
My Account
Downloads
Support Forums
Pro News Articles
Support Forums
My Account
Pro News Articles
Support Forums
Pro News Articles
Pro News Articles
Support Forums
Téléchargement
Nedlastninger
Pro News Articles
Support Forums
Pro News Articles
Downloads
Nedlastninger
Nedladdningar
Support Forums
Support Forums
Support Forums
Support Forums
Pro News Articles
Pro News Articles
 Bots:
Google > Pro News Articles
Baidu > Pro News Articles

فريق العمل متص:

لا أحد من فريق العمل متص

Recommended ISP

Limit user editing of old forum posts

Dragonfly issues as they relate to modules discussed here
رد على موضوعرد على موضوع صفحة للطباعة

Limit user editing of old forum posts

مساهمة ارسل: الاربعاء فبراير 04, 2009 4:41 pm

I believe, from my own experience, that having user edits of their own posts disabled presents an unnecessary challenge to the user,: we all make typo mistakes. But equally letting users "go back in time" and change earlier posts [b]after[b/] someone has replied is also not too swift, as it leaves the door open to abuse.

The following mod to CPG-BB Forums (the standard forums in DF) will accomplish this, limiting user edits to their posts so long as no-one has posted a subsequent reply.

Leave basic forum setting at can-edit, and then make the following change to viewtopic.php at line 931 (for revision 9.39 in DF version 9.2.1):

Code:
	if ( ( $userdata['user_id'] == $poster_id && $is_auth['auth_edit'] ) || $is_auth['auth_mod'] ) {



and replace with:

Code:
	if ( ( $userdata['user_id'] == $poster_id && $is_auth['auth_edit'] && $i == $total_posts - 1 ) || $is_auth['auth_mod'] ) {



You are just adding a test, which applies to non-moderators, and non-admins, to see if the post is the last one.

EDIT: Adding an error message and enforcement

In posting.php in same folder, at line 227 insert:

Code:
		} else if ( !$post_data['last_post'] && !$is_auth['auth_mod'] && $mode == 'editpost' ) {
			message_die(GENERAL_MESSAGE, $lang['Cannot_edit_replied']);



And in language/english/forums.php add:

Code:
    'Cannot_edit_replied' => 'Sorry, but you may not edit posts that have been replied to.',



You can test/evaluate here, just register/login and post to this thread. Reply twice and you will see that you can no longer edit your prior post in the thread.



layingback's server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS)
2.6.32 / 1.3.39 - 2.2.12 / 4.4.7 - 5.1.37 / 5.3.0 / 9.2.1


عدل سابقا من قبل layingback في الجمعة فبراير 06, 2009 12:17 pm, عدل 1 مرة

layingback
Site Admin
Site Admin
 
نشرات: 1229
شاركت: مارس 18, 2006

Re: Limit user editing of old forum posts

مساهمة ارسل: الاربعاء فبراير 04, 2009 4:48 pm

Test post 1



testytester please enter your server specs in your user profile! يبكي

testytester
Newbie
Newbie
 
نشرات: 2
شاركت: يناير 16, 2007

Re: Limit user editing of old forum posts

مساهمة ارسل: الاربعاء فبراير 04, 2009 4:48 pm

Test post 2



testytester please enter your server specs in your user profile! يبكي

testytester
Newbie
Newbie
 
نشرات: 2
شاركت: يناير 16, 2007
Link  QR  Share this صفحة للطباعة  facebook   myspace   twitthis  
Show more ...
استعرض مواضيع سابقة:   
رد على موضوعرد على موضوع صفحة 1 من 1

Dragonfly

انتقل الى:  



لاتستطيع وضع مواضيع جديدة في هذا المنتدى
لاتستطيع الرد على المواضيع في هذا المنتدى
لا تستطيع تعديل مواضيعك في هذا المنتدى
لاتستطيع الغاء مواضيعك في هذا المنتدى
لاتستطيع التصويت في هذا المنتدى
You cannot attach files in this forum
You can download files in this forum

جميع الاوقات تستعمل نظام GMT






layingback Non-Human Terms of Use