summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSavetheinternet <savetheinternet@n0v4.com>2010-12-16 17:04:10 +1100
committerSavetheinternet <savetheinternet@n0v4.com>2010-12-16 17:04:10 +1100
commitbe1f1192279772f83454d5c543ecc51b242dd08d (patch)
tree0060b1f90c96bd9531b8b968321cc85dca024d64
parent9554c7ecb26b7e26cb395532c26845886a5d3541 (diff)
Mod controls for OP
-rw-r--r--inc/display.php76
1 files changed, 48 insertions, 28 deletions
diff --git a/inc/display.php b/inc/display.php
index b8a58e2b..b0980fa3 100644
--- a/inc/display.php
+++ b/inc/display.php
@@ -48,6 +48,50 @@
)));
}
+ function postControls($id, $thread=false) {
+ global $mod;
+
+ $built = '';
+ if($mod) {
+ // Mod controls (on posts)
+ if($thread) {
+ $built .= '<span class="controls op">';
+ } else {
+ $built .= '<span class="controls">';
+ }
+
+ // Delete
+ if($mod['type'] >= MOD_DELETE)
+ $built .= ' <a title="Delete" href="?/b/delete/' . $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/' . $id . '">' . MOD_LINK_DELETEBYIP . '</a>';
+
+ // Ban
+ if($mod['type'] >= MOD_BAN)
+ $built .= ' <a title="Ban" href="?/b/ban/' . $id . '">' . MOD_LINK_BAN . '</a>';
+
+ // Ban & Delete
+ if($mod['type'] >= MOD_BANDELETE)
+ $built .= ' <a title="Ban & Delete" href="?/b/ban&delete/' . $id . '">' . MOD_LINK_BANDELETE . '</a>';
+
+ // Delete file (keep post)
+ if(!$thread && $mod['type'] >= MOD_DELETEFILE)
+ $built .= ' <a title="Remove file" href="?/b/file/' . $id . '">' . MOD_LINK_DELETEFILE . '</a>';
+
+ if($thread) {
+ // Delete file (keep post)
+ if($mod['type'] >= MOD_STICKY)
+ $built .= ' <a title="Make thread sticky" href="?/b/sticky/' . $id . '">' . MOD_LINK_STICKY . '</a>';
+
+ }
+
+ $built .= '</span>';
+ }
+ return $built;
+ }
+
class Post {
public function __construct($id, $thread, $subject, $email, $name, $trip, $body, $time, $thumb, $thumbx, $thumby, $file, $filex, $filey, $filesize, $filename, $ip, $root=ROOT) {
$this->id = $id;
@@ -125,33 +169,7 @@
'<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>';
- }
+ $built .= postControls($this->id);
// Body
$built .= '<p class="body">' . $this->body . '</p></div><br class="clear"/>';
@@ -239,8 +257,10 @@
'<a class="post_no"' . ($index?'':'onclick="citeReply(' . $this->id . ');"') . 'href="' . ($index?$this->root . $board['dir'] . DIR_RES . $this->id . '.html' . '#q' . $this->id:'javascript:void(0);') . '">'.$this->id.'</a>' .
// [Reply]
($index ? '<a href="' . $this->root . $board['dir'] . DIR_RES . $this->id . '.html">[Reply]</a>' : '') .
+ // Mod controls
+ postControls($this->id, true) .
'</p>';
-
+
// Body
$built .= $this->body .