Welcome, Guest. Please Login or Register.
April 29, 2024, 05:41:45 AM
Home Help Search Log in Register
News: If you are still using YaBB SE, please consider upgrading to SMF as soon as possible.

YaBB SE Community  |  Development  |  Completed mods  |  [DONE] only admins/(global) moderators can delete posts *UPDATED* « previous next »
Pages: [1] Reply Ignore Print
Author Topic: [DONE] only admins/(global) moderators can delete posts *UPDATED*  (Read 3206 times)
sylvester
YaBB God
*****
Posts: 525


[DONE] only admins/(global) moderators can delete posts *UPDATED*
« on: July 06, 2002, 05:14:41 PM »
Reply with quote

<id>
only admins/(global) moderators can delete posts
</id>

<version>
1
</version>

<mod info>
With this mod, only admins and global moderators, and the moderator of that board can delete a post
</mod info>

<edit file>
Sources/ModifyMessage.php
</edit file>

<search for>
   if( $deletepost )
   {
</search for>

<add after>
      if(!in_array($username,$moderators) && $settings[7] != 'Administrator' && $settings[7] != 'Global Moderator' )  {
      fatal_error($txt[67]);
      }
</add after>

<edit file>
Sources/Display.php
</edit file>

<search for>
if (!$mstate)
{
      print "<font size=\"-1\">$menusep<a href=\"$cgi;action=post;threadid=$viewnum;quote=$mid;title=" . URLencode($txt[116]) . ";start=$start\">" . $img[replyquote] . '</a>';
</search for>

<add before>
if(in_array($username,$moderators) || $settings[7] == 'Administrator' || $settings[7] == 'Global Moderator') { $deletebutton = $img[delete];
   }
</add before>

<search for>
$img[delete]
</search for>

<replace>
$deletebutton
</replace>
« Last Edit: July 09, 2002, 08:11:43 AM by sylvester » Logged

I'm back
Swat
Noobie
*
Posts: 29


need some help with mods :P

Re:[DONE] only admins/(global) moderators can delete posts
« Reply #1 on: July 07, 2002, 05:35:20 PM »
Reply with quote

hey great i whas looking for this but...
can what do you mean with this?

<search for>
if (!$mstate)
{
      print "<font size=\"-1\">$menusep<a href=\"$cgi;action=post;threadid=$viewnum;quote=$mid;title=" . URLencode($txt[116]) . ";start=$start\">" . $img[replyquote] . '</a>';
</search for>

<add before>
if(in_array($username,$moderators) || $settings[7] == 'Administrator' || $settings[7] == 'Global Moderator') { $deletebutton = $img[delete];
   }
</add before>

Logged
itswheelie
Jr. Member
**
Posts: 88


I love YaBB SE!

Re:[DONE] only admins/(global) moderators can delete posts
« Reply #2 on: July 08, 2002, 03:28:03 AM »
Reply with quote

I did the following quick fix on my board a while back and it works perfectly.

Just edit Display.php

<search for>
                print "$menusep<a href=\"$cgi;action=modify;msg=$mid;threadid=$viewnum;start=$start\">$img[modify]</a>$menusep<a href=\"javascript:DoConfirm('$txt[154]?','$cgi;action=modify2;threadid=$viewnum;msg=$mid;d=1;start=$start');\">$img[delete]</a>";
      print "</font>";
</search for>

<replace>
                print "$menusep<a href=\"$cgi;action=modify;msg=$mid;threadid=$viewnum;start=$start\">$img[modify]</a>";
                if(in_array($username,$moderators) || $settings[7] == 'Administrator' || $settings[7] == 'Global Moderator')
                print "$menusep<a href=\"javascript:DoConfirm('$txt[154]?','$cgi;action=modify2;threadid=$viewnum;msg=$mid;d=1;start=$start');\">$img[delete]</a>";
      print "</font>";
</replace>

This allows Admins, Global Mods and Forum Mods only to delete posts.  Nothing else needed.  The delete button is removed for all other members.
Logged
sylvester
YaBB God
*****
Posts: 525


Re:[DONE] only admins/(global) moderators can delete posts
« Reply #3 on: July 08, 2002, 08:39:19 AM »
Reply with quote

if the deletebutton isn't visible, you can type in your address-bar the following URL:
http://ADDRESS/TO/YOUR/BOARD/index.php?board=BOARDID;action=modify2;threadid=THREAID;msg=MSGID;d=1;start=0
with my mod, even that isn't possible :)
Logged

I'm back
itswheelie
Jr. Member
**
Posts: 88


I love YaBB SE!

Re:[DONE] only admins/(global) moderators can delete posts
« Reply #4 on: July 08, 2002, 08:46:55 AM »
Reply with quote

Fair enough.
Logged
Gobalopper
Mod Team
YaBB God
*****
Posts: 993


Cookie Monster

WWW
Re:[DONE] only admins/(global) moderators can delete posts
« Reply #5 on: July 09, 2002, 06:17:58 AM »
Reply with quote

This doesn't allow them to edit their posts though. Or is that supposed to happen?
Logged
sylvester
YaBB God
*****
Posts: 525


Re:[DONE] only admins/(global) moderators can delete posts
« Reply #6 on: July 09, 2002, 08:11:59 AM »
Reply with quote

Quote from: Gobalopper on July 09, 2002, 06:17:58 AMThis doesn't allow them to edit their posts though. Or is that supposed to happen?
ok, the mod has been updated :)
Logged

I'm back
Swat
Noobie
*
Posts: 29


need some help with mods :P

Re:[DONE] only admins/(global) moderators can delete posts *UPDATED*
« Reply #7 on: July 09, 2002, 02:36:32 PM »
Reply with quote

itswheelie
what you are saying is pretty clear, i have change it thanx :D
Logged
lbyard
Noobie
*
Posts: 42


WWW
Re:[DONE] only admins/(global) moderators can delete posts
« Reply #8 on: August 26, 2002, 05:55:42 AM »
Reply with quote

Good.  Simple and good enough for me.  Now I need one that stops normal users from modifying posts after a given period of time as determined by a forum setting, but does not stop the admin from modifying one for an indefinte period (vacations, etc.).  Larry

Quote from: itswheelie on July 08, 2002, 03:28:03 AMI did the following quick fix on my board a while back and it works perfectly.

Just edit Display.php

<search for>
                print "$menusep<a href=\"$cgi;action=modify;msg=$mid;threadid=$viewnum;start=$start\">$img[modify]</a>$menusep<a href=\"javascript:DoConfirm('$txt[154]?','$cgi;action=modify2;threadid=$viewnum;msg=$mid;d=1;start=$start');\">$img[delete]</a>";
      print "</font>";
</search for>

<replace>
                print "$menusep<a href=\"$cgi;action=modify;msg=$mid;threadid=$viewnum;start=$start\">$img[modify]</a>";
                if(in_array($username,$moderators) || $settings[7] == 'Administrator' || $settings[7] == 'Global Moderator')
                print "$menusep<a href=\"javascript:DoConfirm('$txt[154]?','$cgi;action=modify2;threadid=$viewnum;msg=$mid;d=1;start=$start');\">$img[delete]</a>";
      print "</font>";
</replace>

This allows Admins, Global Mods and Forum Mods only to delete posts.  Nothing else needed.  The delete button is removed for all other members.
Logged
flipje
Noobie
*
Posts: 2


I'm a llama!

Re:[DONE] only admins/(global) moderators can delete posts *UPDATED*
« Reply #9 on: November 21, 2002, 09:51:37 PM »
Reply with quote

Thanx!!! Workinf fine for me!!!  

:)
Logged
Pages: [1] Reply Ignore Print 
YaBB SE Community  |  Development  |  Completed mods  |  [DONE] only admins/(global) moderators can delete posts *UPDATED* « previous - next »
 


Powered by MySQL Powered by PHP YaBB SE Community | Powered by YaBB SE
© 2001-2003, YaBB SE Dev Team. All Rights Reserved.
SMF 2.1.4 © 2023, Simple Machines
Valid XHTML 1.0! Valid CSS

Page created in 0.038 seconds with 21 queries.