PDA

View Full Version : Hide Post Delete Option Hack Ver. 1.0


Birdie501
07-08-2002, 10:00 PM
************************************************** **
Hide Post Delete Option Hack Ver. 1.0
by Birdie501
Requested by Darren Lewis
here -> https://vborg.vbsupport.ru/showthread.php?s=&postid=270940
Latest Version 1.0, tested for vb 2.2.x
Support: As good as i can :)
************************************************** **

What this hack does?
It hide the delete post option for users in editing post!
Only admins or moderators can delete posts!

Please click install if you use this hack!

zip attached.
;)

I think screenshots are not neccessary!

Velocd
07-09-2002, 03:32 PM
Isn't there an option for this in the admin cp? I don't know, seems like there would be.

Gary King
07-09-2002, 03:42 PM
Originally posted by Birdie501
well i think there is one to allow users to delete posts or not, but they would still see the option to delete if they aren't allowed to delete posts! Like here on vb.org!

Actuallly, you ARE allowed to delete posts here LoL :p

Birdie501
07-09-2002, 03:50 PM
upps sorry thats correct!
just tried! :)

But this hack is usefull if your users are not allowed to delete posts as requested by Darren Lewis :)

old post was:
well i think there is one to allow users to delete posts or not, but they would still see the option to delete if they aren't allowed to delete posts! Like here on vb.org!

Darren Lewis
07-09-2002, 04:46 PM
Birdie501, thanks for releasing this for me.

I've set these options in the admin panel, but the when I checked (using a test member account) I can still see the delete post box, but clicking on the button brings up an error page saying "You do not have permission to access this page."

Darren Lewis
07-10-2002, 08:55 AM
I've set the option off for the usergroup, but the delete box still appears. When they click on the delete post button, then they get told that they can't do this.

What I want is for them to not be able to see the box to click on in the first place.

Birdie501
07-10-2002, 08:59 AM
Are you sure you entered your page as normal user? Maybe you have a cookie problem and you enter the page still as admin. Maybe thats the reason why you still see the box!????

Darren Lewis
07-10-2002, 09:10 AM
Originally posted by Birdie501
Are you sure you entered your page as normal user? Maybe you have a cookie problem and you enter the page still as admin. Maybe thats the reason why you still see the box!????

Yeah, I've even tried it from a different PC and I can still see that box as a normal user. It was one of my members who asking me about it that brought it to my attention.

Thanks anyway.

I may just delete the box from the template. If mods want to delete the whole post, it's probably best to edit it and leave a remark instead.

Darren.

Birdie501
07-10-2002, 09:26 AM
Darren do you have any hacks installed that uses different editpost templates like the wysiwyg hack? and did you try with my code?

Darren Lewis
07-10-2002, 09:44 AM
Originally posted by Birdie501
Darren do you have any hacks installed that uses different editpost templates like the wysiwyg hack? and did you try with my code?

The only one I've got that required modifying the standard editpost template is the Spell Checker hack that Parker Clack released. This just adds a button to the bottom of the form and a bit of javascript. None of the other hacks use different editpost templates.

I never thought to revert the template. Anyway, I've installed your hack just now and it works perfectly. A regular member cannot see the delete post box, but I can :)

Thanks for that.

Darren.

Birdie501
07-10-2002, 09:51 AM
Ok thanks! Even if only you will use it , it was worth to make it :)

Darren Lewis
07-10-2002, 10:00 AM
I'll play around with a clean fresh install of vbulletin on my local PC and maybe drop a comment to Jelsoft about it if I still get the same. My online vb has been hacked a little so this may be interfering with things - can't see how though.

Cheers,

Darren

Boofo
07-10-2002, 10:17 AM
Will this hack work with the WYSIWYG hack?

Originally posted by Birdie501
Darren do you have any hacks installed that uses different editpost templates like the wysiwyg hack? and did you try with my code?

Birdie501
07-10-2002, 10:35 AM
Yes it will, but you don't need this hack. This function is already included in vb. You just have to disable the function 'can delete post" in admin Cp for the specific usergroup.

Boofo
07-10-2002, 10:42 AM
I already did that but I never tried to log on under one of the groups I disabled it for to see if the button still shows up. Does the button show up if it is turned off?

Originally posted by Birdie501
Yes it will, but you don't need this hack. This function is already included in vb. You just have to disable the function 'can delete post" in admin Cp for the specific usergroup.

Birdie501
07-10-2002, 10:53 AM
Nothing will be shown.

Boofo
07-10-2002, 10:56 AM
You mean if I use this hack, nothing will be shown, right? Because I just tested it without the hack and the button is still there. :)

Originally posted by Birdie501
Nothing will be shown.

Birdie501
07-10-2002, 11:02 AM
Normally nothing will be shown if you turned it off!
Also if you use my code nothing will be shown! :)

Boofo
07-10-2002, 11:31 AM
The delete button is still there (without your hack installed) even if it is turned off. It just gives you the "Can't delete" error message. If your hack is installed, the button is NOT shown. It works great for that part of it. But if you have the WYSIWYG hack installed, it is still shown in there unless I put the $deletepost in there. Then it doesn't show. But is also doesn't show even if you are allowed to delete messages in the WYSIWYG editor for some reason. Any ideas on how to make it work for that too? :)

Birdie501
07-10-2002, 11:48 AM
Originally posted by Boofo
The delte button is still there (without your hack installed) even if it is turned off. It just gives you the "Can't delete" error message. If your hack is installed, the button is NOT shown. It works great for that part of it. But if you have the WYSIWYG hack installed, it is still shown in there unless I put the $deletepost in there. Then it doesn't show. But is also doesn't show even if you are allowed to delete messages in the WYSIWYG editor for some reason. Any ideas on how to make it work for that too? :)

in editpost.php i have this and it works:




if ( ($enableHTMLEdit == 1) AND ( ($bbuserinfo['enablewysiwyg']) ) ) {
if ( ($bbuserinfo[usergroupid] == 6) OR (ismoderator($threadinfo[forumid],"candeleteposts")) ){
eval("\$deletepost = \"".gettemplate("editpost_delete")."\";");
} else {
$deletepost = "";
}
eval("dooutput(\"".gettemplate("editpost_wysiwyg")."\");");
} else {

if ( ($bbuserinfo[usergroupid] == 6) OR (ismoderator($threadinfo[forumid],"candeleteposts")) ){
eval("\$deletepost = \"".gettemplate("editpost_delete")."\";");
} else {
$deletepost = "";
}
eval("dooutput(\"".gettemplate("editpost")."\");");
}


of course as you said you have to put $deletepost in template editpost_wysiwyg and delete the part of the form.

Boofo
07-10-2002, 12:12 PM
Excellent work, Birdie501! That did the trick. Now it works great in either one of them. Thanks again for an excellent hack! :)

Darren Lewis
07-10-2002, 12:17 PM
Originally posted by Boofo
The delete button is still there (without your hack installed) even if it is turned off. It just gives you the "Can't delete" error message. If your hack is installed, the button is NOT shown.....

So it wan't just me :)

This is something that should definitely be in the original vbulletin IMO.

I don't have the WYSIWYG hack installed (but it looks good).

Darren.

PS Admins please don't delete this thread as it is needed :)