XMB Forum Software
Not logged in [Login - Register]
Go To Bottom

Printable Version  
Author: Subject: minor issue in quick post delete hack 2.0
vamsee
Experienced
***


Avatar


Posts: 50
Registered: 1-5-2003
Member Is Offline

Mood: No Mood

[*] posted on 10-30-2012 at 04:18 PM
minor issue in quick post delete hack 2.0


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



Life is taxing, and death is relaxing
Astrology in Modern World
View user's profile Visit user's homepage View All Posts By User
lottos
Administrator
********




Posts: 461
Registered: 6-3-2002
Member Is Offline

Mood: pass me a TimTam

[*] posted on 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);
}




View user's profile View All Posts By User
vamsee
Experienced
***


Avatar


Posts: 50
Registered: 1-5-2003
Member Is Offline

Mood: No Mood

[*] posted on 11-1-2012 at 04:20 AM


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



Life is taxing, and death is relaxing
Astrology in Modern World
View user's profile Visit user's homepage View All Posts By User
lottos
Administrator
********




Posts: 461
Registered: 6-3-2002
Member Is Offline

Mood: pass me a TimTam

[*] posted on 11-1-2012 at 06:49 AM


The one mentioned in the original hack instructions.



View user's profile View All Posts By User
vamsee
Experienced
***


Avatar


Posts: 50
Registered: 1-5-2003
Member Is Offline

Mood: No Mood

[*] posted on 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



Life is taxing, and death is relaxing
Astrology in Modern World
View user's profile Visit user's homepage View All Posts By User
lottos
Administrator
********




Posts: 461
Registered: 6-3-2002
Member Is Offline

Mood: pass me a TimTam

[*] posted on 11-6-2012 at 03:38 AM


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



View user's profile View All Posts By User
vamsee
Experienced
***


Avatar


Posts: 50
Registered: 1-5-2003
Member Is Offline

Mood: No Mood

[*] posted on 11-6-2012 at 06:15 AM


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



Life is taxing, and death is relaxing
Astrology in Modern World
View user's profile Visit user's homepage View All Posts By User
vamsee
Experienced
***


Avatar


Posts: 50
Registered: 1-5-2003
Member Is Offline

Mood: No Mood

[*] posted on 11-7-2012 at 12:11 PM


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



Life is taxing, and death is relaxing
Astrology in Modern World
View user's profile Visit user's homepage View All Posts By User
vamsee
Experienced
***


Avatar


Posts: 50
Registered: 1-5-2003
Member Is Offline

Mood: No Mood

[*] posted on 11-17-2012 at 12:13 AM


can someone plz update me on this...



Life is taxing, and death is relaxing
Astrology in Modern World
View user's profile Visit user's homepage View All Posts By User
Daniel Gouveia
XMB International Support
*******




Posts: 64
Registered: 4-10-2007
Location: Portugal, Braga
Member Is Offline

Mood: |Catch Me If You Can|

[*] posted on 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').'";'); }




You Never Walk Alone
View user's profile View All Posts By User
vamsee
Experienced
***


Avatar


Posts: 50
Registered: 1-5-2003
Member Is Offline

Mood: No Mood

[*] posted on 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').'";'); }




Life is taxing, and death is relaxing
Astrology in Modern World
View user's profile Visit user's homepage View All Posts By User
Daniel Gouveia
XMB International Support
*******




Posts: 64
Registered: 4-10-2007
Location: Portugal, Braga
Member Is Offline

Mood: |Catch Me If You Can|

[*] posted on 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').'";'); }




You Never Walk Alone
View user's profile View All Posts By User

  Go To Top

Powered by XMB 1.9.12 (Debug Mode)
XMB Forum Software © 2001-2024 The XMB Group
[Queries: 16] [PHP: 48.7% - SQL: 51.3%]