コード例 #1
0
ファイル: download.php プロジェクト: armpit/e107
if (deftrue('BOOTSTRAP')) {
    define("IMAGE_DOWNLOAD", file_exists(THEME . "images/download.png") ? THEME . "images/download.png" : e_IMAGE . "generic/download.png");
    define("IMAGE_NEW", file_exists(THEME . "images/new.png") ? THEME . "images/new.png" : 'icon-star.glyph');
} else {
    define("IMAGE_DOWNLOAD", file_exists(THEME . "images/download.png") ? THEME . "images/download.png" : e_IMAGE . "generic/download.png");
    define("IMAGE_NEW", file_exists(THEME . "images/new.png") ? THEME . "images/new.png" : e_IMAGE . "generic/new.png");
}
$dl->init();
// Legacy Comment Save.
if (isset($_POST['commentsubmit'])) {
    if (!$sql->select("download", "download_comment", "download_id = '{$id}' ")) {
        header("location:" . e_BASE . "index.php");
        exit;
    } else {
        $dlrow = $sql->fetch();
        if ($dlrow['download_comment'] && (ANON === TRUE || USER === TRUE)) {
            $clean_authorname = $_POST['author_name'];
            $clean_comment = $_POST['comment'];
            $clean_subject = $_POST['subject'];
            e107::getComment()->enter_comment($clean_authorname, $clean_comment, "download", $id, $pid, $clean_subject);
            //			$e107cache->clear("comment.download.{$sub_action}");	$sub_action not used here
            e107::getCache()->clear("comment.download");
        }
    }
}
$texts = $dl->render();
// Load before header.
require_once HEADERF;
echo $texts;
require_once FOOTERF;
exit;