Browse Source

Post moderation controls

pull/40/head
Savetheinternet 13 years ago
parent
commit
5adfff925b
  1. 23
      inc/config.php
  2. 31
      inc/display.php

23
inc/config.php

@ -143,8 +143,29 @@
define('MOD_MOD', 1, true);
define('MOD_ADMIN', 2, true);
// What level of administration you need to view IP addresses
// Permissions
// What level of administration you need to:
// View IP addresses
define('MOD_SHOW_IP', MOD_MOD, true);
// Delete a post
define('MOD_DELETE', MOD_JANITOR, true);
// Ban a user for a post
define('MOD_BAN', MOD_MOD, true);
// Ban and delete (one click; instant)
define('MOD_BANDELETE', MOD_BAN, true);
// Delete file (and keep post)
define('MOD_DELETEFILE', MOD_JANITOR, true);
// Delete all posts by IP
define('MOD_DELETEBYIP', MOD_BAN, true);
// Mod links (full HTML)
// Correspond to above permission directives
define('MOD_LINK_DELETE', '[D]', true);
define('MOD_LINK_BAN', '[B]', true);
define('MOD_LINK_BANDELETE', '[B&D]', true);
define('MOD_LINK_DELETEFILE', '[F]', true);
define('MOD_LINK_DELETEBYIP', '[D+]', true);
// A small file in the main directory indicating that the script has been ran and the board(s) have been generated.
// This keeps the script from querying the database and causing strain when not needed.

31
inc/display.php

@ -120,8 +120,37 @@
}
// Filename
$built .= ', ' . $this->filename . ')</span></p>' .
// Thumbnail
'<a href="' . ROOT . $board['dir'] . DIR_IMG . $this->file.'"><img src="' . ROOT . $board['dir'] . DIR_THUMB . $this->thumb.'" style="width:'.$this->thumbx.'px;height:'.$this->thumby.'px;" /></a>';
'<a href="' . ROOT . $board['dir'] . DIR_IMG . $this->file.'"><img src="' . ROOT . $board['dir'] . DIR_THUMB . $this->thumb.'" style="width:'.$this->thumbx.'px;height:'.$this->thumby.'px;" /></a>';
}
if($mod) {
// Mod controls (on posts)
$built .= '<p style="float:right;margin:0;padding:0;font-size:80%;">';
// Delete
if($mod['type'] >= MOD_DELETE)
$built .= ' <a title="Delete" href="?/b/delete/' . $this->id . '">' . MOD_LINK_DELETE . '</a>';
// Delete all posts by IP
if($mod['type'] >= MOD_DELETEBYIP)
$built .= ' <a title="Delete all posts by IP" href="?/b/deletebyip/' . $this->id . '">' . MOD_LINK_DELETEBYIP . '</a>';
// Ban
if($mod['type'] >= MOD_BAN)
$built .= ' <a title="Ban" href="?/b/ban/' . $this->id . '">' . MOD_LINK_BAN . '</a>';
// Ban & Delete
if($mod['type'] >= MOD_BANDELETE)
$built .= ' <a title="Ban & Delete" href="?/b/ban&delete/' . $this->id . '">' . MOD_LINK_BANDELETE . '</a>';
// Delete file (keep post)
if($mod['type'] >= MOD_DELETEFILE)
$built .= ' <a title="Remove file" href="?/b/file/' . $this->id . '">' . MOD_LINK_DELETEFILE . '</a>';
$built .= '</p>';
}
// Body

Loading…
Cancel
Save