boinc/html/inc/forum_moderators.inc

32 lines
1.3 KiB
PHP
Raw Normal View History

<?php
/**
* Show the links for possible moderation actions related to a single post
**/
function post_moderation_links($post,$admin=0,$tokens){
if ($post->isHidden()){
$x = " - <a href=\"forum_moderate_post_action.php?action=unhide&id=".$post->getID()."$tokens\">[undelete post]</a>";
} else {
$x = " - <a href=\"forum_moderate_post.php?action=hide&id=".$post->getID()."$tokens\">[delete post]</a> ";
}
$x.= " - <a href=\"forum_moderate_post.php?action=move&id=".$post->getID()."$tokens\">[move post]</a>";
if ($admin == 1) {
$x .= " - <a href=forum_moderate_post.php?action=banish_user&id=".$post->getID()."&userid=".$post->getOwnerID()."$tokens>[banish author]</a>";
}
return $x;
}
/**
* Show the links for possible moderation actions related to an entire thread
**/
function show_thread_moderation_links($thread){
echo "<a href=\"forum_moderate_thread.php?action=hide&id=".$thread->getID()."\">Hide thread</a><br>";
if($thread->sticky) {
echo "<a href=\"forum_moderate_thread_action.php?action=desticky&id=".$thread->getID()."\">De-sticky thread</a><br>";
} else {
echo "<a href=\"forum_moderate_thread_action.php?action=sticky&id=".$thread->getID()."\">Make thread sticky</a><br>";
}
}
?>