示例#1
0
/**
 * Used to remove a comment
 * @global type $input
 */
function comment_delete()
{
    global $input;
    $id = $input['comment_id'];
    comment_delete_by_id($id);
    cache_asset_threads_unset($_SESSION['album'], $_SESSION['asset']);
    $_SESSION['current_thread'] = $input['thread_id'];
    trace_append(array('3', 'comment_delete', $_SESSION['album'], $_SESSION['asset'], $input['thread_id'], $id));
    return thread_details_update();
}
示例#2
0
/**
 * Returns the content of the asset cache as an associcative array
 * @global string $repository_basedir
 * @param string $album
 * @param string $asset
 * @return array
 */
function cache_asset_threads_get($album, $asset)
{
    global $repository_basedir;
    $path_to_threadsfile = $repository_basedir . "/repository/" . $album . "/" . $asset . "/_threads.json";
    $json_data = file_get_contents($path_to_threadsfile);
    // --- LOG
    file_put_contents($repository_basedir . "/log/cache.log", date('Y-m-d H:i:s') . " // Cache get (Asset threads) : " . $album . ' / ' . $asset . PHP_EOL, FILE_APPEND);
    $file_content = json_decode($json_data, true);
    if (!$file_content) {
        cache_asset_threads_unset($album, $asset);
    }
    return $file_content;
}