PDA

View Full Version : Allow Mods to delete Shoutbox posts!


Mr H
01-03-2003, 07:23 PM
I'm in desperate need of this hack.

The original hack is here:
https://vborg.vbsupport.ru/showthread.php?s=&threadid=38698

Unfortunately moderators are not able to delete posts and since I'm not on all day and the shoutbox is busy, it can get out of hand.

Thanks.

Kars10
01-03-2003, 07:46 PM
If you want them to delete posts just place "admin_shoutbox.php" in the mod-folder.

In mod/index.php

place

makenavoption("Delete Shouts", "admin_shoutbox.php?s=$session[sessionhash]", "<br/>");

after

makenavoption("New Posts","moderate.php?action=posts","<br>");

That should work.. ;)

Chris M
01-03-2003, 07:58 PM
Open shoutbox.php

There should be some code below:

require("./global.php");

It will look vaguely like:
$DB_site->query("DELETE FROM shoutbox WHERE shoutid = $shoutid");
header("Location: $PHP_SELF?s=$sessionhash[sessionid]");
}
with an "if" line at the beginning...

Replace that section with:
if (($bbuserinfo[usergroupid] == 5 || $bbuserinfo[usergroupid] == 6 || $bbuserinfo[usergroupid] == 7) && $action == 'delete' && $shoutid) {
$DB_site->query("DELETE FROM shoutbox WHERE shoutid = $shoutid");
header("Location: $PHP_SELF?s=$sessionhash[sessionid]");
}

:)

Satan

Logik
01-03-2003, 08:09 PM
Lord. I need to study more PHP. Cause this is confusing.. :(. If anyone is wanting to help a poooooor little starter at PHP. AIM me at bacheloring.. Thanks.

Mr H
01-04-2003, 07:19 AM
Neither works :(

I even tried enabling access masks and turning them off.

Only the admin has the ability to delete.

Any ideas?

Chris M
01-04-2003, 12:57 PM
@Mr H - My code should work - Its what I have on my shoutbox, and last time I checked my mods could delete shouts;)

You would have to remove the "if" line too;)

Satan

Logik
01-04-2003, 07:18 PM
He probably pasted it in the wrong place ;)

Mr H
01-04-2003, 08:19 PM
I removed the line that started with "if" and replaced it with this....

if (($bbuserinfo[usergroupid] == 5 || $bbuserinfo[usergroupid] == 6 || $bbuserinfo[usergroupid] == 7) && $action == 'delete' && $shoutid) {
$DB_site->query("DELETE FROM shoutbox WHERE shoutid = $shoutid");
header("Location: $PHP_SELF?s=$sessionhash[sessionid]");

Yet still no delete ability for mods :(

MetroSports82
01-23-2003, 01:56 AM
Mr H, I had the same problem as you. I tried doing this, and it worked... give it a try, and let me know if it works for you.

Open shoutbox.php-

REPLACE
if ($bbuserinfo[usergroupid] == 6) {
eval("\$adminoptions = \"".gettemplate("shoutbox_adminoptions",1,0)."\";");
}

WITH
if ($bbuserinfo[usergroupid] == 5 || $bbuserinfo[usergroupid] == 6 || $bbuserinfo[usergroupid] == 7) {
eval("\$adminoptions = \"".gettemplate("shoutbox_adminoptions",1,0)."\";");
}

this should do the trick. :)

Mr H
01-24-2003, 08:03 PM
MetroSports, you're the man! :D

For a while there I just figured I was out of luck.

Thanks again!,
H