vamsee
Experienced
Posts: 50
Registered: 1-5-2003
Member Is Offline
Mood: No Mood
|
|
minor issue in quick post delete hack 2.0
|
|
lottos
Administrator
Posts: 477
Registered: 6-3-2002
Member Is Offline
Mood: pass me a TimTam
|
|
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
Experienced
Posts: 50
Registered: 1-5-2003
Member Is Offline
Mood: No Mood
|
|
there are two instances of updateforumcount($fid);
after which one should
if ($rtnfid) {
be added ?
|
|
lottos
Administrator
Posts: 477
Registered: 6-3-2002
Member Is Offline
Mood: pass me a TimTam
|
|
The one mentioned in the original hack instructions.
|
|
vamsee
Experienced
Posts: 50
Registered: 1-5-2003
Member Is Offline
Mood: No Mood
|
|
how to make 'delete' button/option visible only to mods/admin ?
because in my board, edit/delete option is disabled for members
|
|
lottos
Administrator
Posts: 477
Registered: 6-3-2002
Member Is Offline
Mood: pass me a TimTam
|
|
It would be helpful to know if the changes already provided worked as per the original request.
|
|
vamsee
Experienced
Posts: 50
Registered: 1-5-2003
Member Is Offline
Mood: No Mood
|
|
sorry..i forgot to mention but above changes suggested are working perfectly fine
|
|
vamsee
Experienced
Posts: 50
Registered: 1-5-2003
Member Is Offline
Mood: No Mood
|
|
but how to disable 'delete' button for all members, except mods/admin
|
|
vamsee
Experienced
Posts: 50
Registered: 1-5-2003
Member Is Offline
Mood: No Mood
|
|
can someone plz update me on this...
|
|
Daniel Gouveia
XMB International Support
Posts: 64
Registered: 4-10-2007
Location: Portugal, Braga
Member Is Offline
Mood: |Catch Me If You Can|
|
|
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
Experienced
Posts: 50
Registered: 1-5-2003
Member Is Offline
Mood: No Mood
|
|
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
XMB International Support
Posts: 64
Registered: 4-10-2007
Location: Portugal, Braga
Member Is Offline
Mood: |Catch Me If You Can|
|
|
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').'";');
} |
|
|