توسط اين سيستم مي توانيد قسمتي در سايتتون ايجاد كنيد كه كاربران بتوانند فايل دانلود كنند.
امكانات: موضوع بندي - ارسال نظر و امتياز دادن به فايل - گزارش فايل خراب - آپلود فايل و تصوير هنگام ارسال فايل و....
فايل زير رو دانلود كنين و بجاي مشخص شده كپي كنين:
Download
وارد phpMyAdmin شويد و پس از انتخاب ديتابيس، روي SQL كليك كنيد و موارد زير رو در آن اجرا كنيد:
CREATE TABLE `dle_downloads` (
`id` int(11) NOT NULL auto_increment,
`autor` varchar(40) NOT NULL default '',
`date` datetime NOT NULL default '0000-00-00 00:00:00',
`url` varchar(255) NOT NULL default '',
`url1` varchar(255) NOT NULL default '',
`desc_url1` text NOT NULL,
`url2` varchar(255) NOT NULL default '',
`desc_url2` text NOT NULL,
`size` int(10) unsigned NOT NULL default '0',
`version` varchar(10) NOT NULL default '',
`platform` varchar(30) NOT NULL default '',
`description` text NOT NULL,
`title` varchar(255) NOT NULL default '',
`screenshot` varchar(250) NOT NULL default '',
`filename` varchar(255) NOT NULL default '0',
`descr` varchar(200) NOT NULL default '',
`keywords` text NOT NULL,
`category` varchar(200) NOT NULL default '0',
`comm_num` smallint(5) unsigned NOT NULL default '0',
`allow_comm` tinyint(1) NOT NULL default '1',
`approve` tinyint(1) NOT NULL default '0',
`rating` smallint(5) NOT NULL default '0',
`vote_num` smallint(5) unsigned NOT NULL default '0',
`news_read` smallint(5) unsigned NOT NULL default '0',
`allow_rate` tinyint(1) NOT NULL default '1',
PRIMARY KEY (`id`),
KEY `autor` (`autor`),
KEY `category` (`category`),
KEY `approve` (`approve`),
KEY `date` (`date`),
KEY `news_read` (`news_read`),
FULLTEXT KEY `description` (`description`)
) TYPE=MyISAM /*!40101 DEFAULT CHARACTER SET cp1251 COLLATE cp1251_general_ci */;
CREATE TABLE `dle_downloads_broken` (
`reportid` mediumint(8) unsigned NOT NULL auto_increment,
`fileid` mediumint(8) unsigned NOT NULL default '0',
`sender` varchar(100) NOT NULL default '',
`ip` varchar(15) NOT NULL default '',
PRIMARY KEY (`reportid`)
) TYPE=MyISAM /*!40101 DEFAULT CHARACTER SET cp1251 COLLATE cp1251_general_ci */;
CREATE TABLE `dle_downloads_com` (
`id` int(10) unsigned NOT NULL auto_increment,
`post_id` varchar(20) NOT NULL default '',
`user_id` mediumint(8) NOT NULL default '0',
`date` datetime NOT NULL default '0000-00-00 00:00:00',
`autor` varchar(100) NOT NULL default '',
`email` varchar(100) NOT NULL default '',
`text` text NOT NULL,
`ip` varchar(16) NOT NULL default '',
`is_register` tinyint(1) NOT NULL default '0',
PRIMARY KEY (`id`),
KEY `post_id` (`post_id`),
KEY `user_id` (`user_id`)
) TYPE=MyISAM /*!40101 DEFAULT CHARACTER SET cp1251 COLLATE cp1251_general_ci */;
CREATE TABLE `dle_downloads_logs` (
`id` int(10) unsigned NOT NULL auto_increment,
`files_id` int(10) NOT NULL default '0',
`member` varchar(40) NOT NULL default '',
`ip` varchar(16) NOT NULL default '',
PRIMARY KEY (`id`),
KEY `news_id` (`files_id`),
KEY `member` (`member`),
KEY `ip` (`ip`)
) TYPE=MyISAM /*!40101 DEFAULT CHARACTER SET cp1251 COLLATE cp1251_general_ci */;
CREATE TABLE `dle_cat_downloads` (
`id` smallint( 5 ) NOT NULL AUTO_INCREMENT ,
`parentid` smallint( 5 ) NOT NULL default '0',
`posi` smallint( 5 ) NOT NULL default '1',
`name` varchar( 50 ) NOT NULL default '',
`dir` varchar( 25 ) NOT NULL default '',
`alt_name` varchar( 50 ) NOT NULL default '',
`descr` varchar( 200 ) NOT NULL default '',
`keywords` text NOT NULL ,
`news_sort` varchar( 10 ) NOT NULL default '',
`news_msort` varchar( 4 ) NOT NULL default '',
`news_number` smallint( 5 ) NOT NULL default '0',
`status_down` int( 1 ) unsigned NOT NULL default '0',
PRIMARY KEY ( `id` )
) TYPE=MyISAM /*!40101 DEFAULT CHARACTER SET cp1251 COLLATE cp1251_general_ci */;
`id` int(11) NOT NULL auto_increment,
`autor` varchar(40) NOT NULL default '',
`date` datetime NOT NULL default '0000-00-00 00:00:00',
`url` varchar(255) NOT NULL default '',
`url1` varchar(255) NOT NULL default '',
`desc_url1` text NOT NULL,
`url2` varchar(255) NOT NULL default '',
`desc_url2` text NOT NULL,
`size` int(10) unsigned NOT NULL default '0',
`version` varchar(10) NOT NULL default '',
`platform` varchar(30) NOT NULL default '',
`description` text NOT NULL,
`title` varchar(255) NOT NULL default '',
`screenshot` varchar(250) NOT NULL default '',
`filename` varchar(255) NOT NULL default '0',
`descr` varchar(200) NOT NULL default '',
`keywords` text NOT NULL,
`category` varchar(200) NOT NULL default '0',
`comm_num` smallint(5) unsigned NOT NULL default '0',
`allow_comm` tinyint(1) NOT NULL default '1',
`approve` tinyint(1) NOT NULL default '0',
`rating` smallint(5) NOT NULL default '0',
`vote_num` smallint(5) unsigned NOT NULL default '0',
`news_read` smallint(5) unsigned NOT NULL default '0',
`allow_rate` tinyint(1) NOT NULL default '1',
PRIMARY KEY (`id`),
KEY `autor` (`autor`),
KEY `category` (`category`),
KEY `approve` (`approve`),
KEY `date` (`date`),
KEY `news_read` (`news_read`),
FULLTEXT KEY `description` (`description`)
) TYPE=MyISAM /*!40101 DEFAULT CHARACTER SET cp1251 COLLATE cp1251_general_ci */;
CREATE TABLE `dle_downloads_broken` (
`reportid` mediumint(8) unsigned NOT NULL auto_increment,
`fileid` mediumint(8) unsigned NOT NULL default '0',
`sender` varchar(100) NOT NULL default '',
`ip` varchar(15) NOT NULL default '',
PRIMARY KEY (`reportid`)
) TYPE=MyISAM /*!40101 DEFAULT CHARACTER SET cp1251 COLLATE cp1251_general_ci */;
CREATE TABLE `dle_downloads_com` (
`id` int(10) unsigned NOT NULL auto_increment,
`post_id` varchar(20) NOT NULL default '',
`user_id` mediumint(8) NOT NULL default '0',
`date` datetime NOT NULL default '0000-00-00 00:00:00',
`autor` varchar(100) NOT NULL default '',
`email` varchar(100) NOT NULL default '',
`text` text NOT NULL,
`ip` varchar(16) NOT NULL default '',
`is_register` tinyint(1) NOT NULL default '0',
PRIMARY KEY (`id`),
KEY `post_id` (`post_id`),
KEY `user_id` (`user_id`)
) TYPE=MyISAM /*!40101 DEFAULT CHARACTER SET cp1251 COLLATE cp1251_general_ci */;
CREATE TABLE `dle_downloads_logs` (
`id` int(10) unsigned NOT NULL auto_increment,
`files_id` int(10) NOT NULL default '0',
`member` varchar(40) NOT NULL default '',
`ip` varchar(16) NOT NULL default '',
PRIMARY KEY (`id`),
KEY `news_id` (`files_id`),
KEY `member` (`member`),
KEY `ip` (`ip`)
) TYPE=MyISAM /*!40101 DEFAULT CHARACTER SET cp1251 COLLATE cp1251_general_ci */;
CREATE TABLE `dle_cat_downloads` (
`id` smallint( 5 ) NOT NULL AUTO_INCREMENT ,
`parentid` smallint( 5 ) NOT NULL default '0',
`posi` smallint( 5 ) NOT NULL default '1',
`name` varchar( 50 ) NOT NULL default '',
`dir` varchar( 25 ) NOT NULL default '',
`alt_name` varchar( 50 ) NOT NULL default '',
`descr` varchar( 200 ) NOT NULL default '',
`keywords` text NOT NULL ,
`news_sort` varchar( 10 ) NOT NULL default '',
`news_msort` varchar( 4 ) NOT NULL default '',
`news_number` smallint( 5 ) NOT NULL default '0',
`status_down` int( 1 ) unsigned NOT NULL default '0',
PRIMARY KEY ( `id` )
) TYPE=MyISAM /*!40101 DEFAULT CHARACTER SET cp1251 COLLATE cp1251_general_ci */;
فايل Admin.php رو باز كنين و به دنبال كد زير بگرديد:
'addnews' => 'user',
پس از آن، كد زير رو قرار دهيد:
'admin_files' => 'admin',
فايل Engine/Inc/Options.php رو با Notepad2 باز كنين و پس از تنظيم Encoding روي UTF-8 به دنبال كد زير بگرديد:
$options['others'] = array(
پس از آن، كدهاي زير رو اضافه كنيد:
array(
'name' => "سيستم مديريت فايل",
'url' => "$PHP_SELF?mod=admin_files&action=list",
'descr' => "",
'image' => "files.png",
'access' => "1",
),
'name' => "سيستم مديريت فايل",
'url' => "$PHP_SELF?mod=admin_files&action=list",
'descr' => "",
'image' => "files.png",
'access' => "1",
),
فايل Engine/Engine.php رو باز كنيد و به دنبال كد زير بگرديد:
case "comments" :
include ENGINE_DIR.'/modules/comments.php';
break;
include ENGINE_DIR.'/modules/comments.php';
break;
پس از آن، كدهاي زير رو قرار دهيد:
case "files" :
include ENGINE_DIR.'/modules/files.php';
break;
case "addfile" :
include ENGINE_DIR.'/modules/addfile.php';
break;
case "fileslastcomments" :
include ENGINE_DIR.'/modules/fileslastcomments.php';
break;
include ENGINE_DIR.'/modules/files.php';
break;
case "addfile" :
include ENGINE_DIR.'/modules/addfile.php';
break;
case "fileslastcomments" :
include ENGINE_DIR.'/modules/fileslastcomments.php';
break;
در همين فايل به دنبال كد زير بگرديد:
elseif ($do == 'static') $titl_e=$static_descr;
پس از آن، كدهاي زير رو قرار دهيد:
elseif ($do == 'files') $nam_e="Download Files";
elseif ($do == 'addfile') $nam_e="Add File";
elseif ($do == 'addfile') $nam_e="Add File";
فايل Index.php رو باز كنين و به دنبال كد زير بگرديد:
<script type="text/javascript" src="{$config['http_home_url']}engine/ajax/js_edit.js"></script>
پس از آن، كد زير رو قرار دهيد:
<script type="text/javascript" src="{$config['http_home_url']}engine/ajax/js_edit_files.js"></script>
در همين فايل به دنبال كد زير بگرديد:
$tpl->set('{calendar}', $tpl->result['calendar']);
پس از آن، كدهاي زير رو قرار دهيد:
require_once ROOT_DIR.'/engine/modules/newfiles.php';
$tpl->set('{newfiles}',$newfiles);
$tpl->set('{newfiles}',$newfiles);
فايل Engine/Modules/Functions.php رو باز كنين و به دنبال كد زير بگرديد:
function ShowRating ($id, $rating, $vote_num, $allow = true){
در بالاي آن، كدهاي زير رو قرار دهيد:
function Rating_files ($id, $rating, $vote_num, $allow = true){
global $lang;
if ($rating)
if ($vote_num!=0) $rating = round(($rating / $vote_num), 0); else $rating = 0;
$rating = $rating * 17;
if (!$allow) {
$rated = <<<HTML
<div class="rating" style="float:right;">
<ul class="unit-rating">
<li class="current-rating" style="width:{$rating}px;">{$rating}</li>
</ul>
</div><div class="rating" style="float:right; padding-top:2px;"> ({$lang['voten']} {$vote_num})</div>
HTML;
return $rated;
}
$rated .= <<<HTML
<div id='ratig-layer'><div class="rating" style="float:right;">
<ul class="unit-rating">
<li class="current-rating" style="width:{$rating}px;">{$rating}</li>
<li><a href="#" title="{$lang['useless']}" class="r1-unit" onclick="doRate_files('1', '{$id}'); return false;">1</a></li>
<li><a href="#" title="{$lang['poor']}" class="r2-unit" onclick="doRate_files('2', '{$id}'); return false;">2</a></li>
<li><a href="#" title="{$lang['fair']}" class="r3-unit" onclick="doRate_files('3', '{$id}'); return false;">3</a></li>
<li><a href="#" title="{$lang['good']}" class="r4-unit" onclick="doRate_files('4', '{$id}'); return false;">4</a></li>
<li><a href="#" title="{$lang['excellent']}" class="r5-unit" onclick="doRate_files('5', '{$id}'); return false;">5</a></li>
</ul>
</div><div class="rating" style="float:left; padding-top:2px;"> ({$lang['voten']} {$vote_num})</div></div>
HTML;
return $rated;
}
global $lang;
if ($rating)
if ($vote_num!=0) $rating = round(($rating / $vote_num), 0); else $rating = 0;
$rating = $rating * 17;
if (!$allow) {
$rated = <<<HTML
<div class="rating" style="float:right;">
<ul class="unit-rating">
<li class="current-rating" style="width:{$rating}px;">{$rating}</li>
</ul>
</div><div class="rating" style="float:right; padding-top:2px;"> ({$lang['voten']} {$vote_num})</div>
HTML;
return $rated;
}
$rated .= <<<HTML
<div id='ratig-layer'><div class="rating" style="float:right;">
<ul class="unit-rating">
<li class="current-rating" style="width:{$rating}px;">{$rating}</li>
<li><a href="#" title="{$lang['useless']}" class="r1-unit" onclick="doRate_files('1', '{$id}'); return false;">1</a></li>
<li><a href="#" title="{$lang['poor']}" class="r2-unit" onclick="doRate_files('2', '{$id}'); return false;">2</a></li>
<li><a href="#" title="{$lang['fair']}" class="r3-unit" onclick="doRate_files('3', '{$id}'); return false;">3</a></li>
<li><a href="#" title="{$lang['good']}" class="r4-unit" onclick="doRate_files('4', '{$id}'); return false;">4</a></li>
<li><a href="#" title="{$lang['excellent']}" class="r5-unit" onclick="doRate_files('5', '{$id}'); return false;">5</a></li>
</ul>
</div><div class="rating" style="float:left; padding-top:2px;"> ({$lang['voten']} {$vote_num})</div></div>
HTML;
return $rated;
}
فايل htaccess. رو باز كنيد و كدهاي زير رو به آخر فايلش اضافه كنيد:
RewriteRule ^files(/?)+$ index.php?do=files
RewriteRule ^addfile(/?)+$ index.php?do=addfile
RewriteRule ^files/file([1-9][0-9]*).html index.php?do=files&op=download&fileid=$1
RewriteRule ^files/cat([1-9][0-9]*).html index.php?do=files&op=cat&id=$1
RewriteRule ^files/cat([1-9][0-9]*)-titleA.html index.php?do=files&op=cat&id=$1&orderby=titleA
RewriteRule ^files/cat([1-9][0-9]*)-titleD.html index.php?do=files&op=cat&id=$1&orderby=titleD
RewriteRule ^files/cat([1-9][0-9]*)-dateA.html index.php?do=files&op=cat&id=$1&orderby=dateA
RewriteRule ^files/cat([1-9][0-9]*)-dateD.html index.php?do=files&op=cat&id=$1&orderby=dateD
RewriteRule ^files/cat([1-9][0-9]*)-hitsA.html index.php?do=files&op=cat&id=$1&orderby=hitsA
RewriteRule ^files/cat([1-9][0-9]*)-hitsD.html index.php?do=files&op=cat&id=$1&orderby=hitsD
RewriteRule ^files/cat([0-9][0-9]*)_(.*)-(.*).html index.php?cstart=$2&do=files&op=cat&id=$1&orderby=$3
RewriteRule ^files/comments/(.*)/file([1-9][0-9]*).html index.php?cstart=$1&do=files&op=download&fileid=$2
RewriteRule ^files/page(.*)/ index.php?cstart=$1&do=files
RewriteRule ^files/file([1-9][0-9]*)-comdel([1-9][0-9]*).html index.php?do=files&op=del&fileid=$1&id=$2
RewriteRule ^files/brokenfile_([1-9][0-9]*).html index.php?do=files&op=brokenfile&fileid=$1
RewriteRule ^addfile(/?)+$ index.php?do=addfile
RewriteRule ^files/file([1-9][0-9]*).html index.php?do=files&op=download&fileid=$1
RewriteRule ^files/cat([1-9][0-9]*).html index.php?do=files&op=cat&id=$1
RewriteRule ^files/cat([1-9][0-9]*)-titleA.html index.php?do=files&op=cat&id=$1&orderby=titleA
RewriteRule ^files/cat([1-9][0-9]*)-titleD.html index.php?do=files&op=cat&id=$1&orderby=titleD
RewriteRule ^files/cat([1-9][0-9]*)-dateA.html index.php?do=files&op=cat&id=$1&orderby=dateA
RewriteRule ^files/cat([1-9][0-9]*)-dateD.html index.php?do=files&op=cat&id=$1&orderby=dateD
RewriteRule ^files/cat([1-9][0-9]*)-hitsA.html index.php?do=files&op=cat&id=$1&orderby=hitsA
RewriteRule ^files/cat([1-9][0-9]*)-hitsD.html index.php?do=files&op=cat&id=$1&orderby=hitsD
RewriteRule ^files/cat([0-9][0-9]*)_(.*)-(.*).html index.php?cstart=$2&do=files&op=cat&id=$1&orderby=$3
RewriteRule ^files/comments/(.*)/file([1-9][0-9]*).html index.php?cstart=$1&do=files&op=download&fileid=$2
RewriteRule ^files/page(.*)/ index.php?cstart=$1&do=files
RewriteRule ^files/file([1-9][0-9]*)-comdel([1-9][0-9]*).html index.php?do=files&op=del&fileid=$1&id=$2
RewriteRule ^files/brokenfile_([1-9][0-9]*).html index.php?do=files&op=brokenfile&fileid=$1
سطح دسترسي فولدر هاي زير رو هم 777 بگذاريد:
/uploads
/uploads/download
/uploads/download
حالا با آدرس هاي زير مي توانيد اين ماژول رو مديريت و مشاهده كنيد
توجه: براي نمايش فايل هاي جديد در قالب سايت، فايل Main.tpl رو باز كنين و جايي كه مي خواهيد فايل ها به نمايش در بياد، كد {newfiles} رو قرار دهيد.