예제 #1
0
function LOAD_MEDIA_RSS($t)
{
    global $root;
    $folder = treat_string($t);
    $arr = search_folder($root . "user/uploads/" . $folder);
    if (!$arr) {
        echo "No files to display";
    } else {
        foreach ($arr as $value) {
            $type = detect_type($value);
            $path = $folder . "/" . $value;
            show_media_rss($type, $path);
        }
    }
}
예제 #2
0
function FILE_LOAD($file)
{
    global $root, $entry_title;
    $path = $root . "user/uploads/" . treat_string($entry_title) . "/{$file}";
    if (is_file($path)) {
        show_media(detect_type($file), treat_string($entry_title) . "/{$file}");
    }
}
예제 #3
0
        echo $entry_id;
        ?>
})">Reset hits</p>
</fieldset>

<p class="clear"></p>
<p class="margin"></p>

<fieldset>
<legend>Files</legend>
<?php 
        $filearray = search_folder($dirpath);
        $i = 0;
        foreach ($filearray as $f) {
            detect_type($f);
            $type = detect_type($f);
            if ($type == "image") {
                $i++;
                echo "<p class=\"media-thumb img\">\n\t  <img src=\"../functions/phpThumb/phpThumb.php?src={$dirpath}/{$f}&w=100&h=60&zc=1&f=png\" /><br />\n\t  {$f}<br />\n\t  <span class=\"list-link\" onclick=\"delete_data('delete_file',{'path':'{$dirpath}/{$f}'},'get_edit_entry',{'id':{$entry_id}})\">Delete image</span>\n\t  </p>";
            } elseif ($type == "video") {
                $i++;
                echo "<p class=\"media-thumb vid\">\n\t  <img src=\"video.jpg\" /><br />\n\t  {$f}<br />\n\t  <span class=\"list-link\" onclick=\"delete_data('delete_file',{'path':'{$dirpath}/{$f}'},'get_edit_entry',{'id':{$entry_id}})\">Delete video</span>\n\t  </p>";
            } elseif ($type == "sound") {
                $i++;
                echo "<p class=\"media-thumb video\">\n\t  <img src=\"sound.jpg\" /><br />\n\t  {$f}<br />\n\t  <span class=\"list-link\" onclick=\"delete_data('delete_file',{'path':'{$dirpath}/{$f}'},'get_edit_entry',{'id':{$entry_id}})\">Delete sound</span>\n\t  </p>";
            } elseif ($type == "link") {
                $i++;
                echo "<p class=\"media-thumb link\">\n\t  <img src=\"link.jpg\" /><br />\n\t  {$f}<br />\n\t  <span class=\"list-link\" onclick=\"delete_data('delete_file',{'path':'{$dirpath}/{$f}'},'get_edit_entry',{'id':{$entry_id}})\">Delete link</span>\n\t  </p>";
            } elseif ($type == "thumbnail") {
                $i++;
                echo "<p class=\"media-thumb img\">\n\t  <img src=\"../functions/phpThumb/phpThumb.php?src={$dirpath}/{$f}&w=100&h=60&zc=1&f=png\" /><br />\n\t  {$f}<br />\n\t  <span class=\"list-link\" onclick=\"delete_data('delete_file',{'path':'{$dirpath}/{$f}'},'get_edit_entry',{'id':{$entry_id}})\">Delete thumbnail</span>\n\t  </p>";
예제 #4
0
<?php

error_reporting(0);
require "_headr.php";
if ($_SESSION["password"] != $pass || $_SESSION["sessid"] != session_id()) {
    die(logout());
}
debug("Password validated, logged in", 0);
$path = $_REQUEST["path"];
$valid = array("jpg", "png", "gif");
$ext = substr($path, strrpos($path, "."));
$file = substr($path, strrpos($path, "/") + 1);
if (detect_type($file) != "image") {
    debug("File is not a valid fileformat (jpg, png or gif)", 1);
}
$path_new = substr($path, 0, strlen($path) - strlen($ext)) . "_thumb" . $ext;
if (!copy($path, $path_new)) {
    debug("Failed to copy image to thumbnail", 1);
}