2009-01-11 02:59:10 +00:00
|
|
|
<?php
|
|
|
|
/*
|
2009-11-17 10:46:35 +00:00
|
|
|
* e107 website system
|
|
|
|
*
|
2013-06-23 19:06:46 -07:00
|
|
|
* Copyright (C) 2008-2013 e107 Inc (e107.org)
|
2009-11-17 10:46:35 +00:00
|
|
|
* Released under the terms and conditions of the
|
|
|
|
* GNU General Public License (http://www.gnu.org/licenses/gpl.txt)
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
2009-09-17 20:38:20 +00:00
|
|
|
if (!defined('e107_INIT'))
|
2009-12-03 00:48:28 +00:00
|
|
|
{
|
2009-09-17 20:38:20 +00:00
|
|
|
require_once("../../class2.php");
|
|
|
|
}
|
|
|
|
|
2009-09-18 19:07:09 +00:00
|
|
|
if (!e107::isInstalled('download'))
|
|
|
|
{
|
2016-01-13 19:17:37 -08:00
|
|
|
e107::redirect();
|
2009-09-18 19:07:09 +00:00
|
|
|
}
|
2009-09-17 20:38:20 +00:00
|
|
|
|
2015-01-22 22:05:25 -08:00
|
|
|
e107::lan('download',false, true); // Loads e_PLUGIN.'download/languages/'.e_LANGUAGE.'/English_front.php'
|
2016-04-19 16:57:44 -07:00
|
|
|
|
|
|
|
$bcList = array(
|
|
|
|
'LAN_dl_19' => 'LAN_CATEGORY',
|
|
|
|
'LAN_dl_17' => 'LAN_FILES',
|
|
|
|
"LAN_dl_20" => "LAN_FILES",
|
|
|
|
"LAN_dl_21" => "LAN_SIZE",
|
|
|
|
"LAN_dl_22" => "LAN_DATE",
|
|
|
|
"LAN_dl_23" => "LAN_FILE",
|
|
|
|
"LAN_dl_24" => "LAN_AUTHOR",
|
|
|
|
"LAN_dl_25" => "LAN_ASCENDING",
|
|
|
|
"LAN_dl_26" => "LAN_DESCENDING",
|
|
|
|
"LAN_dl_27" => "LAN_GO",
|
|
|
|
"LAN_dl_28" => "LAN_NAME"
|
|
|
|
);
|
|
|
|
|
|
|
|
e107::getLanguage()->bcDefs($bcList);
|
|
|
|
|
|
|
|
|
2013-06-22 18:24:43 -07:00
|
|
|
|
2013-06-23 19:06:46 -07:00
|
|
|
require_once(e_PLUGIN.'download/handlers/download_class.php');
|
|
|
|
require_once(e_PLUGIN.'download/handlers/category_class.php');
|
2009-01-11 02:59:10 +00:00
|
|
|
|
|
|
|
|
2013-06-23 19:06:46 -07:00
|
|
|
$dl = new download();
|
2009-01-11 02:59:10 +00:00
|
|
|
|
|
|
|
|
2013-06-25 16:03:00 -07:00
|
|
|
if(!defined("USER_WIDTH") && !deftrue('BOOTSTRAP')) { define("USER_WIDTH","width:100%"); }
|
2013-06-22 18:24:43 -07:00
|
|
|
|
2013-06-23 19:06:46 -07:00
|
|
|
/* define images */
|
2013-06-22 18:24:43 -07:00
|
|
|
|
2013-06-25 16:03:00 -07:00
|
|
|
if(deftrue('BOOTSTRAP'))
|
|
|
|
{
|
|
|
|
define("IMAGE_DOWNLOAD", (file_exists(THEME."images/download.png") ? THEME."images/download.png" : e_IMAGE."generic/download.png"));
|
2014-01-05 11:26:19 -08:00
|
|
|
define("IMAGE_NEW", (file_exists(THEME."images/new.png") ? THEME."images/new.png" : 'icon-star.glyph'));
|
2013-06-25 16:03:00 -07:00
|
|
|
}
|
|
|
|
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"));
|
|
|
|
}
|
2013-06-22 18:24:43 -07:00
|
|
|
|
2009-01-11 02:59:10 +00:00
|
|
|
|
2013-06-22 18:24:43 -07:00
|
|
|
|
2013-06-23 19:06:46 -07:00
|
|
|
$dl->init();
|
2013-06-22 18:24:43 -07:00
|
|
|
|
2013-06-23 19:06:46 -07:00
|
|
|
// Legacy Comment Save.
|
|
|
|
if (isset($_POST['commentsubmit']))
|
2009-01-11 02:59:10 +00:00
|
|
|
{
|
2013-06-23 19:06:46 -07:00
|
|
|
if (!$sql->select("download", "download_comment", "download_id = '{$id}' "))
|
2013-06-22 18:24:43 -07:00
|
|
|
{
|
2016-01-13 19:17:37 -08:00
|
|
|
e107::redirect();
|
2013-06-23 19:06:46 -07:00
|
|
|
exit;
|
2013-06-22 18:24:43 -07:00
|
|
|
}
|
2013-06-23 19:06:46 -07:00
|
|
|
else
|
2013-06-22 18:24:43 -07:00
|
|
|
{
|
2013-06-23 19:06:46 -07:00
|
|
|
$dlrow = $sql->fetch();
|
|
|
|
if ($dlrow['download_comment'] && (ANON === TRUE || USER === TRUE))
|
2013-06-22 18:24:43 -07:00
|
|
|
{
|
2013-06-23 19:06:46 -07:00
|
|
|
$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
|
2015-02-15 16:07:27 -08:00
|
|
|
e107::getCache()->clear("comment.download");
|
2013-06-22 18:24:43 -07:00
|
|
|
}
|
|
|
|
}
|
2009-01-11 02:59:10 +00:00
|
|
|
}
|
|
|
|
|
2013-12-24 02:33:14 -08:00
|
|
|
|
2013-06-23 19:06:46 -07:00
|
|
|
$texts = $dl->render(); // Load before header.
|
2009-01-11 02:59:10 +00:00
|
|
|
|
2013-06-23 19:06:46 -07:00
|
|
|
require_once (HEADERF);
|
|
|
|
|
2013-12-24 02:33:14 -08:00
|
|
|
|
|
|
|
|
2013-06-23 19:06:46 -07:00
|
|
|
echo $texts;
|
|
|
|
|
|
|
|
require_once (FOOTERF);
|
|
|
|
|
|
|
|
|
|
|
|
exit ;
|
2009-02-11 21:41:54 +00:00
|
|
|
?>
|