PDA

View Full Version : Disable Usergroups From Deleting Posts


g-force2k2
07-07-2002, 10:00 PM
As requested [ Here ] (https://vborg.vbsupport.ru/showthread.php?s=&threadid=40795) by The Ghost :)

+++++++++++++++++++++++++++++++++++++++++++++++++
// +++++++ What to do? +++++++
// +++++++ Queries to Run (1) +++++++
// +++++++ File Modifications (7) +++++++
// +++++++ Templates To Add (1) +++++++
+++++++++++++++++++++++++++++++++++++++++++++++++

What does this do?
It restricts usergroups from deleting posts, pertaining mainly to Super Moderators and Moderators.
If you don't trust you moderators when it comes to deleting certain posts or trust their judgement then editing should be suffice enough.
Here you can disable those usergroups from deleting any posts.

Enjoy. ;)

Edit: big thanks to Boofo for helping me sort some issues out and getting things back on track :)

g-force2k2

g-force2k2
07-08-2002, 02:05 AM
I thought this hack was cool myself i'll probably be installing it on my own forum :D

Here's a screenshot of the added permission ;) thanks to The Ghost for confirming that an option like this didn't exist :p

Though i know you can restrict by forums but thats a much bigger task :) Enjoy

One more quick note if you disable administrators from deleting posts then they won't have access either... for security reasons all usergroups were set to no... so you have to activate the users you want to have permission ;) regular members wont' have access either way :p

g-force2k2

Boofo
07-08-2002, 02:34 AM
Will this also stop them from deleting threads? That's what the Ghost was looking for, I think.

VeRT3X
07-08-2002, 02:36 AM
woot very nice, very helpful hack = ]

g-force2k2
07-08-2002, 03:13 AM
Originally posted by Boofo
Will this also stop them from deleting threads? That's what the Ghost was looking for, I think.

yes it will :)

g-force2k2

Boofo
07-08-2002, 03:15 AM
Can we get a text version of this, too, please? :)

g-force2k2
07-08-2002, 03:18 AM
Boofo it is a text version :p just open the file in word pad i just have a tendency to write all my hacks on php files :)

g-force2k2

Boofo
07-08-2002, 03:20 AM
Thanks! Might not be a bad idea to say that in the first message. :)

Boofo
07-08-2002, 03:36 AM
I have this in 2 places in the editpost.php. Which one do I add the code after?

if ($action=="deletepost") {

g-force2k2
07-08-2002, 03:54 AM
sorry boofo ;\ totally missed that... i tested it on the first one but failed to see the second one... but correct me if i am wrong but if you place it on the first one can you edit the post then or does it give you an error?

g-force2k2

Boofo
07-08-2002, 04:02 AM
This line is in the usergroup.php not the user.php. You need to edit your instructions.

makeyesnocode("Can delete own threads by deleting the first post","candeletethread",0);

g-force2k2
07-08-2002, 04:04 AM
i made an error :p i will fix the changes and update tomarrow ;\ don't have a forum to test with at the moment so i'll re add later... sorry about that...

g-force2k2

g-force2k2
07-08-2002, 04:07 AM
Originally posted by Boofo
Tmakeyesnocode("Can delete own threads by deleting the first post","candeletethread",0);

yeah i know i make some techincal errors ;\ i ain't that great so sorry if a make a few mistakes... i ain't perfect i'll admit that just used to knowing where things are i forget a small thing like usergroup ;)

g-force2k2

Boofo
07-08-2002, 04:12 AM
After adding it after the first occurrance, I can still edit posts so that looks good. You haven't tested this yet? Shouldn't it be in the beta section until it is fully tested at least once? :)

g-force2k2
07-08-2002, 04:16 AM
I did test it boofo ;) just didn't notice that there were two differen't if ($action=="deletepost") {

my friend allows me to test on his forum but hes not on right now ;\

i tested it but after you stated the issue about two different actions that got me... so i'll do another final test tomarrow... and i'll have to take into consideration the editing perms...

but i did test and it didn't allow for deletion ;) but better sure to make sure there isn't anything added before reattaching something that is...

g-force2k2

Boofo
07-08-2002, 04:18 AM
Oh, ok. I guess I must have misunderstood you. I will test it now and let you know if all is well. :)

g-force2k2
07-08-2002, 04:24 AM
in the editpost.php

for security purposes... find both:

if ($action=="deletepost") {

after that place:

// +++++++ Start Checking Delete Post Permission [ Start ] +++++++

$perms=getpermissions();
if(!$perms[candeleteposts]) {
eval("standarderror(\"".gettemplate("error_cantdeleteposts")."\");");
exit;
}
// +++++++ Start Checking Delete Post Permissions [ End ] +++++++

I don't see what harm that could do and i've overlooked the coding and the first seems to be checking permissions and the second seems to carry out the actions... so adding to both is probably the best way to go until i can further look into it :)

g-force2k2

Boofo
07-08-2002, 04:28 AM
It worked fine with just doing it after the first one. If they can't get the permisssion, they can't carry anything out. :) Go ahead and test it with both if you want and let me know how it goes. I am going to leave it as is for now. If it ain't broke, I don't want to break it. :)

g-force2k2
07-08-2002, 04:32 AM
yeah i know what you mean... but i guess better safe then sorry thanks for the help alot Boofo :) and thanks for testing the edit option for me... just so you know i reattached and added the template addon to the

$templatesused if you wanted to just add that in... but thanks for the help :D

g-force2k2

Boofo
07-08-2002, 04:35 AM
No problem. Glad to help. Now I expect to see my name up in lights as the Ultimate Beta Tester (is there such a thing and if there is, isn't being proud of that a little strange?) :)

Boofo
07-08-2002, 04:43 AM
That templatesused line is commented out. How will adding anything to that do any good? :)

Originally posted by g-force2k2
yeah i know what you mean... but i guess better safe then sorry thanks for the help alot Boofo :) and thanks for testing the edit option for me... just so you know i reattached and added the template addon to the

$templatesused if you wanted to just add that in... but thanks for the help :D

g-force2k2

afterlab
07-08-2002, 04:51 AM
Why not just use the Usergroup Forum Permissions? In there, it has an option for "Can delete own threads and posts?" for specific forums.

Boofo
07-08-2002, 04:54 AM
But that just pertains to their own threads and posts, doesn't it? This hack makes it so they can't delete others posts and threads. :)

Steve Machol
07-08-2002, 04:58 AM
There's an option in Forums & Moderators where you can set 'Can delete posts' to 'No' for any Moderator you want. :)

g-force2k2
07-08-2002, 04:59 AM
yeah afterlab i stated that in the second post that you can update each usergroups permissions by each forum... but i think it's more of an advantage to make it a more easier feature to work with... just my input though besides it was requested ;)

g-force2k2

g-force2k2
07-08-2002, 05:02 AM
Originally posted by smachol
There's an option in Forums & Moderators where you can set 'Can delete posts' to 'No' for any Moderator you want. :)

oh i didn't know that ;\ but i think that The Ghost was looking for Super Moderators to not be able to delete posts... but then theres the user feature for oneself and then the forum permissions for each usergroup and now the mod permissions when assigning mods and then you can also of just added some other coding instead of what i added... but i guess this could've been accomplised in a number of ways ;) just my insight i guess... btw smachol does that include super moderators?

g-force2k2

Velocd
07-08-2002, 05:22 AM
Yup, I'm using this hack, but well, without the hack on my forums right now. ^_^

Boofo
07-08-2002, 05:24 AM
What???

Originally posted by Velocd
Yup, I'm using this hack, but well, without the hack on my forums right now. ^_^

The Ghost
07-13-2002, 05:37 PM
hi,

thx g-force2k2 for writing this hack, but the hack doesn't work in my Forum...... :ermm:

I've created a Super Moderator Account and I still can delete.....

I've editet both files (editpost.php and Usergroup.php) and I have added the Template.

In the Groups Permission I see the function "Can Delete Post", this is set to "no", but it doesn't works.......

Please help me.....

thx

Boofo
07-13-2002, 09:00 PM
Make sure you delete your cookies before logging in under another account. It might still be picking up the old cookie. :)

Originally posted by The Ghost
hi,

thx g-force2k2 for writing this hack, but the hack doesn't work in my Forum...... :ermm:

I've created a Super Moderator Account and I still can delete.....

I've editet both files (editpost.php and Usergroup.php) and I have added the Template.

In the Groups Permission I see the function "Can Delete Post", this is set to "no", but it doesn't works.......

Please help me.....

thx

The Ghost
07-13-2002, 09:45 PM
Hi,

I tryed this, but it still don't work........

The Ghost
07-17-2002, 07:04 PM
hi,

please help me!!! I need this hack!!! :)

Sweet Cheeks
01-22-2003, 10:32 AM
SMods can still delete threads using the pull down admin options :( Any fix for this yet?

**Edit** I just removed the option out of the pull down menu so Im all set now :p Thank you for the hack :D

Sweet Cheeks
02-12-2003, 12:23 AM
Ack! Now admins cant delete posts :paranoid: lol