XMB Forum Software

minor issue in quick post delete hack 2.0

vamsee - 10-30-2012 at 04:18 PM

after quick post delete, it says 'returning to thread' but returns to forum instead of thread

this is the hack i used
http://www.xmbforum2.com/hacks/quick-post-delete-2.0.zip

lottos - 10-31-2012 at 12:42 PM

This has not been tested.
Make a backup copy of post.php then edit post.php and upload after changing -


Find:

$deletevalid = TRUE; // This new flag will indicate a message was submitted and successful.

Add after:

$rtnfid = FALSE;


Find:
$db->query("DELETE FROM ".X_PREFIX."threads WHERE tid=$tid OR closed='moved|$tid'");

Add after:

$rtnfid=TRUE;


find:
updateforumcount($fid);

Add after:

if ($rtnfid) {


find:
message($lang['editpostmsg'], TRUE, '', '', $full_url.'forumdisplay.php?fid='.$fid, true, false, true);

Add after:

} else {
message($lang['editpostmsg'], TRUE, '', '', $full_url.'viewthread.php?tid='.$tid, true, false, true);
}

vamsee - 11-1-2012 at 04:20 AM

there are two instances of updateforumcount($fid);
after which one should
if ($rtnfid) {
be added ?

lottos - 11-1-2012 at 06:49 AM

The one mentioned in the original hack instructions.

vamsee - 11-6-2012 at 12:52 AM

how to make 'delete' button/option visible only to mods/admin ?
because in my board, edit/delete option is disabled for members

lottos - 11-6-2012 at 03:38 AM

It would be helpful to know if the changes already provided worked as per the original request.

vamsee - 11-6-2012 at 06:15 AM

sorry..i forgot to mention but above changes suggested are working perfectly fine

vamsee - 11-7-2012 at 12:11 PM

but how to disable 'delete' button for all members, except mods/admin

vamsee - 11-17-2012 at 12:13 AM

can someone plz update me on this...

Daniel Gouveia - 11-17-2012 at 01:06 PM

viewthread.php

Find:

Code:
$delete = ''; if (modcheckPost($self['username'], $forum['moderator'], $post['status']) == 'Moderator' || ($thread['closed'] != 'yes' && $post['author'] == $xmbuser)) { eval('$delete = "'.template('viewthread_post_delete').'";'); }


Replace:

Code:
$delete = ''; if (X_STAFF && modcheckPost($self['username'], $forum['moderator'], $post['status']) == 'Moderator' || ($thread['closed'] != 'yes' && $post['author'] == $xmbuser)) { eval('$delete = "'.template('viewthread_post_delete').'";'); }

vamsee - 11-17-2012 at 05:49 PM

okay that didnt work for me.
members were still able to see delete button.

so i made this change

replaced the code you mentioned , with this code


Code:
$delete = ''; if (modcheckPost($self['username'], $forum['moderator'], $post['status']) == 'Moderator') { eval('$delete = "'.template('viewthread_post_delete').'";'); }

Daniel Gouveia - 11-17-2012 at 07:49 PM

Quote: Originally posted by vamsee  
okay that didnt work for me.
members were still able to see delete button.

so i made this change

replaced the code you mentioned , with this code


Code:
$delete = ''; if (modcheckPost($self['username'], $forum['moderator'], $post['status']) == 'Moderator') { eval('$delete = "'.template('viewthread_post_delete').'";'); }


Replace with this:

Code:
$delete = ''; if (modcheckPost($self['username'], $forum['moderator'], $post['status']) == 'Moderator' || ($thread['closed'] != 'yes')) { eval('$delete = "'.template('viewthread_post_delete').'";'); }