示例#1
0
    $license = '<a target="_blank" href="' . $download->data['lizenz_url'] . '">' . $locale['PDP203'] . '</a>';
} elseif ($download->data['lizenz_packet'] == "Y") {
    //	$license = "<span class='small2'>".$locale['PDP030']."</span>";
    $license = $locale['PDP030'];
} else {
    //FIXME	$license = "<span class='small2'>".$locale['PDP204']."</span>";
}
// files
$files = array();
$res = dbquery("SELECT file_id, file_version, file_desc, file_size,\n\tfile_timestamp, file_url, download_count\n\tFROM " . DB_PDP_FILES . "\n\tWHERE download_id='" . $download->id . "' AND file_status='0'\n\tORDER BY file_timestamp DESC");
while ($data = dbarray($res)) {
    $pos = strpos($data['file_url'], '/');
    if ($pos !== false) {
        $data['file_url'] = substr($data['file_url'], $pos + 1);
    }
    $files[] = array('id' => $data['file_id'], 'is_external' => pdp_is_external($data['file_url']), 'url' => $data['file_url'], 'ver' => $data['file_version'], 'timestamp' => $data['file_timestamp'], 'size' => $data['file_size'], 'desc' => $data['file_desc'], 'download_count' => $data['download_count']);
}
// images
$images = array();
$res = dbquery("SELECT pic_id, pic_desc, pic_url\n\tFROM " . DB_PDP_IMAGES . "\n\tWHERE download_id='" . $download->id . "' AND pic_status='0'");
while ($data = dbarray($res)) {
    $images[] = array('desc' => $data['pic_desc'], 'id' => $data['pic_id'], 'url' => $data['pic_url']);
}
$desc = parseubb(parsesmileys($download->data['description']));
$old_data = array('down' => $download->data['down'], 'link_extern' => $download->data['link_extern'], 'version' => $download->data['version'], 'size' => $download->data['dl_size']);
$data = array('name' => $download->data['dl_name'], 'can_download' => $download->can_download, 'mtime' => $download->data['dl_mtime'], 'count' => $download->data['dl_count'], 'license' => $license, 'desc' => $desc, 'copyright' => $download->data['dl_copyright'], 'pic' => $download->data['dl_pic'], 'homepage' => $download->data['dl_homepage'], 'is_subscribing' => $is_subscribing, 'count_votes' => $download->data['count_votes'], 'count_comments' => $download->data['count_comments'], 'count_visitors' => $download->data['count_visitors'], 'can_subscribe' => iMEMBER, 'subscibers' => $download->data['count_subscribers'], 'allow_notify' => $pdp->settings['allow_notify'] == "yes");
if ($pdp->settings['hide_user_allow'] == "yes" && $download->data['hide_user'] == "yes" && !$download->can_edit) {
    $data['user_id'] = 0;
} else {
    $data['user_id'] = $download->data['user_id'];
    $data['user_name'] = $download->data['user_name'];
        if ($pic['pic_id']) {
            $upload = '<strong>' . $pic['pic_url'] . '</strong>';
        } else {
            $upload = "<input type='file' name='upload'" . " class='textbox' size='50'><br />" . "<span class='small2'>" . parsebytesize($pdp->settings['image_max']) . " / " . str_replace(",", ", ", $pdp->settings['image_ext']);
            if ($pdp->settings['image_max_w']) {
                $upload .= "<br>" . $pdp->settings['image_max_w'] . "x" . $pdp->settings['image_max_h'];
                if ($pdp->settings['image_scale'] == "yes") {
                    $upload .= " (" . $locale['PDP150'] . ")";
                }
            }
            $upload .= "</span>";
        }
    }
}
$src_url = '-';
if (!$pic['pic_id'] || pdp_is_external($pic['pic_url'])) {
    $src_url = '<input type="text" class="textbox" name="url" maxlegth="255" size="60" value="' . $pic['pic_url'] . '">';
}
pdp_close_tab();
/****************************************************************************
 * GUI
 */
if ($pic['pic_id'] || $more_pics) {
    pdp_open_tab('edit', $pic['pic_id'] ? $locale['pdp_edit_entry'] : $locale['pdp_new']);
    echo '
<form method="post" action="' . $action . '" enctype="multipart/form-data">

<label for="desc">' . $locale['PDP025'] . ':</label><br />
<input type="textbox" name="desc" id="desc" maxlegth="255" size="40"
	value="' . $pic['pic_desc'] . '" /><br />
<span class="small2">' . $locale['PDP056'] . '</span>
}
if ($do_edit || empty($pdp->settings['file_ext'])) {
    $src_upload = '';
} else {
    $src_upload = "\n<tr>\n\t<td></td>\n\t<td><strong>" . $locale['PDP133'] . "</strong></td>\n</tr>\n<tr>\n\t<td valign='top'>" . $locale['PDP219'] . ":</td>\n";
    if (!$upload_dir_access) {
        $src_upload .= "<td><span class='small2'>" . str_replace("%s", '<strong>' . $upload_dir . '</strong>', $locale['PDP900'][PDP_EUPDIR]) . "</span></td>";
    } else {
        $src_upload .= "<td><input type='file' class='textbox' name='upload' size='50'></td>\n</tr>\n<tr>\n\t<td></td>\n\t<td><span class='small2'>" . $locale['PDP034'] . ": " . parsebytesize($pdp->settings['file_max']) . " (" . str_replace(",", ", ", $pdp->settings['file_ext']) . ")</span></td>\n";
    }
    $src_upload .= "</tr>\n";
}
// determine what to show and why
$src_read_only = "";
if ($do_edit) {
    $is_external = pdp_is_external($url);
    if (iPDP_MOD) {
    } else {
        $src_ftp = "";
        if (!$is_external) {
            $src_url = "";
            $src_read_only = "<tr><td><b>" . pdp_cleanup_filename($url) . "</b></td></tr>\n";
        }
    }
} else {
    if (iPDP_MOD) {
    } else {
    }
}
echo '
<form action="' . $action . '" method="post" name="editform"
示例#4
0
}
if (dbrows($res)) {
    echo '
	<dd>' . $locale['PDP886'] . '
	<ul>';
}
if ($do_del) {
    if (isset($_POST['del_pic'])) {
        $del_this = $_POST['del_pic'];
    } else {
        $del_this = array();
    }
}
while ($data = dbarray($res)) {
    $del = "";
    if ($do_del && !pdp_is_external($data['pic_url']) && in_array($data['pic_id'], $del_this)) {
        $ok = unlink($pdp->settings['upload_image'] . $data['pic_url']);
        if ($ok) {
            $del = " - " . $locale['PDP883'];
        }
    }
    echo "<input type='checkbox' name='del_pic[]'" . " value='" . $data['pic_id'] . "'> " . pdp_cleanup_filename($data['pic_url']) . "{$del}<br>\n";
}
if (dbrows($res)) {
    echo '
	</ul>
	</dd>';
}
if ($do_del) {
    $ok = dbquery("DELETE FROM " . DB_PDP_IMAGES . "\n\t\tWHERE download_id='" . $download->id . "'");
    if ($ok) {
}
/* CHECK FOR ILL FILES */
echo '<hr />
<p>
<a href="' . FUSION_SELF . '?check_all_files">' . $locale['pdp_check_files'] . '</a>
</p>';
if (isset($_GET['check_all_files'])) {
    $res = dbquery("SELECT d.download_id, dl_name, dir_files, file_url\n\t\tFROM " . DB_PDP_DOWNLOADS . " AS d\n\t\tLEFT JOIN " . DB_PDP_FILES . " USING(download_id)\n\t\tORDER BY download_id ASC");
    if (dbrows($res)) {
        echo '
' . $locale['pdp_ill_files'] . ':
<ul>';
    }
    $ill_files = 0;
    while ($row = dbarray($res)) {
        if (pdp_is_external($row['file_url'])) {
            continue;
        }
        if (!file_exists($pdp->settings['upload_file'] . $row['dir_files'] . $row['file_url'])) {
            ++$ill_files;
            echo '
	<li><a href="download.php?did=' . $row['download_id'] . '">' . $row['dl_name'] . '</a>: ' . $row['file_url'] . '</li>';
        }
    }
    if (!$ill_files) {
        echo '<li>' . $locale['pdp_none'] . '</li>';
    }
    if (dbrows($res)) {
        echo '
</ul>';
    }
    $file = dbarray($res);
}
if ($download->data['lizenz_okay'] == 'N' || isset($_GET['dlok'])) {
    $url = "";
    $filename = "";
    $parse_url = true;
    if (!empty($file['file_url'])) {
        $url = $file['file_url'];
    } elseif (!empty($download->data['down'])) {
        $url = $download->data['down'];
    } else {
        $url = $download->data['link_extern'];
        $parse_url = false;
    }
    if ($parse_url) {
        if (pdp_is_external($url)) {
            $downlink = $url;
        } else {
            $downlink = $pdp->settings['upload_file'] . $download->data['dir_files'] . $url;
            $filename = pdp_cleanup_filename($url);
        }
    } else {
        $downlink = $url;
    }
    dbquery("UPDATE " . DB_PDP_DOWNLOADS . "\n\t\tSET\n\t\tdl_count=dl_count+1\n\t\tWHERE download_id='" . $download->id . "'");
    dbquery("UPDATE " . DB_PDP_FILES . "\n\t\tSET\n\t\tdownload_count=download_count+1\n\t\tWHERE file_id='" . $file['file_id'] . "'\n\t\t\tAND download_id='" . $download->id . "'");
    if (empty($filename)) {
        fallback($downlink);
    } else {
        error_reporting(0);
        require_once INCLUDES . 'class.httpdownload.php';