예제 #1
0
/**
 * Used to remove a thread
 * @global array $input
 * @return boolean
 */
function thread_delete()
{
    global $input;
    $id = $input['thread_id'];
    $album = $input['thread_album'];
    $asset = $input['thread_asset'];
    if (!acl_is_admin()) {
        return false;
    }
    if (!isset($album) || $album == '') {
        $album = $_SESSION['album'];
    }
    if (!isset($asset) || $asset == '') {
        $asset = $_SESSION['asset'];
    }
    thread_delete_by_id($id, $album, $asset);
    cache_asset_threads_unset($album, $asset);
    cache_album_threads_unset($album);
    trace_append(array('3', 'thread_delete', $album, $asset, $id));
    return threads_list_update();
}
예제 #2
0
/**
 * Updates the message of a comment
 * @global null $db
 * @param type $id
 * @param type $message
 * @param string $album
 * @param string $asset
 * @param string $thread
 * 
 * @return boolean true if succed
 */
function comment_update($id, $message, $album, $asset, $thread, $author = 'Unknown')
{
    global $statements;
    $date = date('Y-m-d H:i:s');
    $statements['comment_update']->bindParam(':message', $message);
    $statements['comment_update']->bindParam(':lastEditDate', $date);
    $statements['comment_update']->bindParam(':id', $id);
    $res = $statements['comment_update']->execute();
    thread_update_lastEdit($thread, $author);
    cache_album_threads_unset($album);
    log_append('Edit comment: ', 'Edit comment with id = ' . $id);
    return $res;
}