Title: Deletion Of Posts For Staff Only v1.0

Author: John Briggs

Description:
This modification will prevent the option for members to delete their own posts and allows only staff to delete them.

Copyright:  2009 John Briggs. All rights reserved.

Compatability: XMB 1.9.8 SP3

Install Note: Before adding this modification to your forum you should back up all files related to this modification.

License Note: This modification is released under the GPL License. A copy is provided with this software package.

Author Note:
You downloaded this hack from XMBGarage.com, the #1 source for XMB related downloads.
Please visit http://www.xmbgarage.com/ for support.

=======================================================================================================================================
=======
Step 1:
=======
===============
Edit File: post.php
===============
==========
Find Code:
==========

    global $imgdir, $bbinsert, $altbg1, $altbg2, $lang, $SETTINGS, $spelling_lang;

================
Replace Code With:
================

    global $imgdir, $bbinsert, $altbg1, $altbg2, $lang, $SETTINGS, $spelling_lang, $THEME, $username;

==========
Find Code:
==========

            if ($postinfo['usesig'] == 'yes') {
                $offcheck3 = $cheHTML;
            } else {
                $offcheck3 = '';
            }

===============
Add Code Below:
===============

            // Deletion Of Posts For Staff Only Mod Begin
            $username = '';
            $status1 = modcheck($self['status'], $username, $forums['moderator']);
            if ($self['status'] == 'Super Moderator') {
                $status1 = 'Moderator';
            }

            $deleteoption = '';
            if (X_ADMIN || X_STAFF && $status1 == 'Moderator') {
                $deleteoption = '<input type="checkbox" name="delete" value="yes" /> <strong>'.$lang['textdelete'].'</strong>';
            }
            // Deletion Of Posts For Staff Only Mod End

==========
Find Code:
==========

                if ($isfirstpost['pid'] == $pid && !(isset($delete) && $delete == 'yes')) {

===============
Add Code Above:
===============

                // Deletion Of Posts For Staff Only Mod Begin
                $delete = (isset($delete) && $delete == 'yes' && X_STAFF && $status1 == 'Moderator') ? 'yes' : 'no';
                // Deletion Of Posts For Staff Only Mod End

=======================================================================================================================================
=======
Step 2:
=======
==========================
Go To Admin Panel --> Templates
==========================
===================
Edit Template: post_edit
===================
==========
Find Code:
==========

<input type="checkbox" name="delete" value="yes" /> <strong>$lang[textdelete]</strong>

================
Replace Code With:
================

$deleteoption

=======================================================================================================================================
Enjoy!