全新安装方法:
[升级安装在下一层楼里面]
把cdb_改成你的数据表的前缀
升级数据库:
- ALTER TABLE `cdb_members` ADD `putsum` INT( 8 ) NOT NULL ,
- ADD `audsum` INT( 8 ) NOT NULL ,
- ADD `groomsum` INT( 8 ) NOT NULL ,
- ADD `delesum` INT( 8 ) NOT NULL ,
- ADD `audit` VARCHAR( 1 ) NOT NULL ;
复制代码
再升:
- CREATE TABLE `cdb_dsort` (
- `id` mediumint(10) unsigned NOT NULL auto_increment,
- `sup` int(10) NOT NULL default '1',
- `sort` varchar(12) NOT NULL default '',
- `idder` int(2) NOT NULL default '0',
- PRIMARY KEY (`id`)
- ) TYPE=MyISAM
复制代码
还升:
- CREATE TABLE `cdb_dsoft` (
- `id` mediumint(15) unsigned NOT NULL auto_increment,
- `name` varchar(50) NOT NULL default '',
- `sort` char(10) NOT NULL default '',
- `lang` varchar(16) NOT NULL default '',
- `edition` varchar(16) NOT NULL default '',
- `size` varchar(10) NOT NULL default '',
- `picture` varchar(120) NOT NULL default '',
- `star` int(1) NOT NULL default '0',
- `putdate` varchar(24) NOT NULL default '',
- `auddate` varchar(24) NOT NULL default '',
- `roof` varchar(50) NOT NULL default '',
- `groom` char(1) NOT NULL default '',
- `degree` int(8) NOT NULL default '0',
- `downcount` int(8) NOT NULL default '0',
- `needcredit` int(6) NOT NULL default '0',
- `payment` int(5) NOT NULL default '0',
- `putname` varchar(15) NOT NULL default '',
- `brief` mediumtext NOT NULL,
- `assessor` varchar(15) NOT NULL default '',
- `audit` char(1) NOT NULL default '',
- `addoneshow` VARCHAR( 12 ) NOT NULL default '',
- `addone` varchar(120) NOT NULL default '',
- `addtwoshow` VARCHAR( 12 ) NOT NULL default '',
- `addtwo` varchar(120) NOT NULL default '',
- `addthrshow` VARCHAR( 12 ) NOT NULL default '',
- `addthr` varchar(120) NOT NULL default '',
- `addfoushow` VARCHAR( 12 ) NOT NULL default '',
- `addfou` varchar(120) NOT NULL default '',
- `addfivshow` VARCHAR( 12 ) NOT NULL default '',
- `addfiv` varchar(120) NOT NULL default '',
- `rate` int( 10 ) DEFAULT '0' NOT NULL ,
- `groomdate` INT( 20 ) DEFAULT '0' NOT NULL,
- `softhold` VARCHAR( 30 ) DEFAULT '不详' NOT NULL ,
- `softurl` VARCHAR( 120 ) DEFAULT '###' NOT NULL ,
- `getuser` mediumtext NOT NULL,
- `getguest` int(5) NOT NULL default '0',
- PRIMARY KEY (`id`)
- ) TYPE=MyISAM
复制代码
最后升:
- CREATE TABLE `cdb_dlog` (
- `id` mediumint(20) unsigned NOT NULL auto_increment,
- `sort` varchar(1) NOT NULL default '',
- `name` varchar(15) NOT NULL default '0',
- `softid` varchar(15) NOT NULL default '0',
- `score` int(10) NOT NULL default '0',
- `aswhat` varchar(100) NOT NULL default '0',
- PRIMARY KEY (`id`)
- ) TYPE=MyISAM
复制代码
然后将附件上传
再到后台将plug_download.txt导入插件中心!
接下来开如改文件
1、include/cache.php
查找:
- 'pm' => array('bbcodes','smilies'),
复制代码
下面加:
- 'downsoft' => array('indexsoftnew','indexsoftdown','audittop','sortlist','sortsup','softcount'),
复制代码
查找:
- case ranks:
- $table = $GLOBALS['table_ranks'];
- $cols='ranktitle,postshigher,stars,color';
- $conditions = "WHERE 1 ORDER BY postshigher desc";
- break;
复制代码
下面加:
- //下载中心2.0-by-[oytktk]-start
-
- case indexsoftnew:
- $table = $GLOBALS['table_dsoft'];
- $cols = "id, name, downcount, auddate, putname";
- $conditions = "WHERE audit=1 ORDER BY id DESC LIMIT 10";
- break;
- case indexsoftdown:
- $table = $GLOBALS['table_dsoft'];
- $cols = "id, name, downcount, auddate, putname";
- $conditions = "WHERE audit=1 ORDER BY downcount DESC LIMIT 10";
- break;
- case audittop:
- @include DISCUZ_ROOT.'./forumdata/cache/cache_plugins.php';
- $downcfg = $_DCACHE['plugins_settings']['download'];
- $lims = $downcfg['homegr'];
- $lims = $lims ? $lims : 5;
- $table = $GLOBALS['table_dsoft'];
- $cols = "id, name, sort, picture, putname";
- $conditions = "WHERE groom=1 ORDER BY groomdate DESC LIMIT $lims";
- break;
- case sortlist:
- $table = $GLOBALS['table_dsort'];
- $conditions = "WHERE sup=0 ORDER BY idder, id";
- break;
- case sortsup:
- $table = $GLOBALS['table_dsort'];
- $conditions = "WHERE sup<>0 ORDER BY idder, id";
- break;
- case softcount:
- $table = $GLOBALS['table_dsoft'];
- $cols= 'count(*)';
- $conditions = "WHERE audit=1";
- break;
-
- //下载中心2.0-by-[oytktk]-end
复制代码
再找:
- case 'forums':
- while($forum = $db->fetch_array($query)) {
- $forum['name'] = strip_tags($forum['name']);
- $data[$forum['fid']] = $forum;
- unset($forum['fid']);
- }
- break;
复制代码
下面加:
- //下载中心2.0-by-[oytktk]-start
- case 'indexsoftnew':
- while($sort1 = $db->fetch_array($query)) {
- $sort1['name1']=cutstr($sort1['name'],24);
- $data[]=$sort1;
- }
- break;
- case 'indexsoftdown':
- while($sort2 = $db->fetch_array($query)) {
- $sort2['name1']=cutstr($sort2['name'],24);
- $data[]=$sort2;
- }
- break;
- case 'audittop':
- while($sort3 = $db->fetch_array($query)) {
- $sort3['picture']=$sort3['picture']==''?'<img border=0 src="images/download/download.jpg" title="单击打开['.$sort3['name'].']">':'<img border=0 src="'.$sort3['picture'].'" title="单击打开['.$sort3['name'].']" width=120 height=120>';
- $sort3['name1']=cutstr($sort3['name'],20);
- $data[]=$sort3;
- }
- break;
- case 'sortlist':
- while($sort4 = $db->fetch_array($query)) {
- $data[]=$sort4;
- }
- break;
- case 'sortsup':
- while($sort5 = $db->fetch_array($query)) {
- $data[]=$sort5;
- }
- break;
- case 'softcount':
- $data = $db->result($query,0);
- break;
- //下载中心2.0-by-[oytktk]-end
复制代码
1、admincp.php
查找:
- }elseif($action == 'plugin') {
- $cpscript = 'plugin.php';
- }
复制代码
请注意下,有三行内容,请在三行内容之下加,不然会出错!
下面加:
- elseif($action == 'softlist' || $action == 'softaudit' || $action == 'sortedit' || $action == 'sortnew' || $action == 'sortdele' || $action == 'softsort' || $action == 'softgrom' || $action == 'softdele' || $action == 'softedit') {
- $cpscript = 'download.php';
- }
复制代码
3.admin/menu.php
查找
- admincp.php?action=menu&expand=1_2_3_4_5_6_7_8_9_10_11_12_13
复制代码
看看最后一个数是多少.如果是13,再加一个_14, 如果是14,则再加上_15;
找到
- showmenu($lang['menu_plugins'], $pluginsarray);
复制代码
在上面添加
- showmenu('下载中心', array(
- array('name' => '软件审核', 'url' => 'admincp.php?action=softlist'),
- array('name' => '批量清理', 'url' => 'admincp.php?action=softdele'),
- array('name' => '免审会员管理', 'url' => 'admincp.php?action=softedit'),
- array('name' => '类别管理', 'url' => 'admincp.php?action=softsort')));
复制代码
4、admin/global.php
查找:
- function showforum($forum, $id, $type = '') {
复制代码
上面加:
- function showsort($sort, $id) {
- $dot = array(1 => "<li>", 2 => "<li type="circle">");
- $editforum = "--<a href="admincp.php?action=sortedit&sortid=$sort[id]">[编辑]</a>";
- echo $dot[$id]."$sort[sort]</b></a> - 顺序:<input type="text" name="order[{$sort[id]}]" value="$sort[idder]" size="1">".
- "$editforum--<a href="admincp.php?action=sortdele&sortid=$sort[id]">".
- "[删除]</a><br></li>\n";
- }
复制代码
基本安装已经完成,更新缓存;接下来的安装是一些可选功能
###如果你想在线列表中可以看到下载中心的动作
templates/default/actions.lang.php
查找:
上面加:
###如果想在贴子内作者信息中显示发布的软件信息
viewthread.php
查找
后面加:
viewthread.htm
查找
- {lang postnum} $post[postnum]<br>
复制代码
后面加:
- 软件 <!--{if $post[audsum]<>0}--> <a href="plugins.php?p=download&acti=softlist&username=$post[author]">$post[audsum]</a><!--{else}-->$post[audsum]<!--{/if}--><br>
- 推荐 <!--{if $post[audsum]<>0}--><a href="plugins.php?p=download&acti=softlist&groom=1&username=$post[author]">$post[groomsum]</a><!--{else}-->$post[audsum]<!--{/if}--><br>
复制代码
###如果想在查看会员资料页显示发布的软件信息
viewpro.htm
查找
- <tr><td width="45%" class="bold">{lang credit_title}:</td><td width="55%">$member[credit] {lang credit_unit}</td></tr>
复制代码
下面加:
- <tr><td width="45%" class="bold">发布软件:</td><td width="55%">$member[putsum]</td></tr>
- <tr><td width="45%" class="bold">通过审核:</td><td width="55%"><!--{if $member[audsum]<>0}--> <a href="plugins.php?p=download&acti=softlist&username=$member[username]">$member[audsum]</a><!--{else}-->$member[audsum]<!--{/if}--></td></tr>
- <tr><td width="45%" class="bold">加入推荐:</td><td width="55%"><!--{if $member[audsum]<>0}--> <a href="plugins.php?p=download&acti=softlist&groom=1&username=$member[username]">$member[groomsum]</a><!--{else}-->$member[groomsum]<!--{/if}--></td></tr>
- <tr><td width="45%" class="bold">被删除软件:</td><td width="55%">$member[delesum]</td></tr>
- <tr><td width="45%" class="bold">免审核权限:</td><td width="55%"><!--{if $member[audit]=='1'}-->是<!--{else}-->否<!--{/if}--></td></tr>
复制代码
###如果你想在后台可以控制会员的软件发布信息及免审核权限:
templates/default/admincp.lang.php
查找:
- 'members_edit_credit' => '积分:',
复制代码
下面加:
- 'members_edit_putsum' => '发布软件:',
- 'members_edit_audsum' => '通过审核:',
- 'members_edit_groomsum' => '加入推荐:',
- 'members_edit_delesum' => '已被删除:',
- 'members_edit_audit' => '免审核权限:',
复制代码
admin\members.php
查找
- showsetting('members_edit_credit', 'creditnew', $member['credit'], 'text');
复制代码
下面加:
- showsetting('members_edit_putsum', 'putsumnew', $member['putsum'], 'text');
- showsetting('members_edit_audsum', 'audsumnew', $member['audsum'], 'text');
- showsetting('members_edit_groomsum', 'groomnew', $member['groomsum'], 'text');
- showsetting('members_edit_delesum', 'delenew', $member['delesum'], 'text');
- showsetting('members_edit_audit', 'auditnew', $member['audit'], 'text');
复制代码
查找:
后面加:
- putsum='$putsumnew', audsum='$audsumnew', groomsum='$groomnew', delesum='$delesumnew', audit='$auditnew',
复制代码
最后还是给大家一个软件的分类,爱要不要。。。。
后台升级数据库:(其中不要的可以自行删去)
- INSERT INTO `cdb_dsort` VALUES (1, 0, '常用工具', 0);
- INSERT INTO `cdb_dsort` VALUES (2, 0, '系统工具', 1);
- INSERT INTO `cdb_dsort` VALUES (3, 0, '音乐视频', 4);
- INSERT INTO `cdb_dsort` VALUES (4, 0, '媒体工具', 2);
- INSERT INTO `cdb_dsort` VALUES (5, 0, '图形图像', 3);
- INSERT INTO `cdb_dsort` VALUES (6, 0, '网络工具', 5);
- INSERT INTO `cdb_dsort` VALUES (7, 0, '编程开发', 6);
- INSERT INTO `cdb_dsort` VALUES (8, 0, '游戏娱乐', 7);
- INSERT INTO `cdb_dsort` VALUES (9, 0, '安全相关', 8);
- INSERT INTO `cdb_dsort` VALUES (10, 0, '其他软件', 9);
- INSERT INTO `cdb_dsort` VALUES (43, 1, '转换翻译', 4);
- INSERT INTO `cdb_dsort` VALUES (26, 1, '汉字输入', 2);
- INSERT INTO `cdb_dsort` VALUES (27, 3, '音乐MP3', 1);
- INSERT INTO `cdb_dsort` VALUES (28, 3, '音乐MTV', 2);
- INSERT INTO `cdb_dsort` VALUES (32, 5, '图像处理', 0);
- INSERT INTO `cdb_dsort` VALUES (33, 5, '动画制作', 0);
- INSERT INTO `cdb_dsort` VALUES (34, 5, '虚拟现实', 0);
- INSERT INTO `cdb_dsort` VALUES (35, 5, '图像管理', 0);
- INSERT INTO `cdb_dsort` VALUES (36, 5, '插件Plus', 0);
- INSERT INTO `cdb_dsort` VALUES (37, 5, '图标工具', 0);
- INSERT INTO `cdb_dsort` VALUES (38, 5, '3D软件', 0);
- INSERT INTO `cdb_dsort` VALUES (39, 1, '文字办公', 0);
- INSERT INTO `cdb_dsort` VALUES (40, 1, '文件管理', 1);
- INSERT INTO `cdb_dsort` VALUES (41, 1, '光驱工具', 8);
- INSERT INTO `cdb_dsort` VALUES (42, 1, '压缩解压', 3);
- INSERT INTO `cdb_dsort` VALUES (45, 1, '学习应用', 6);
- INSERT INTO `cdb_dsort` VALUES (46, 1, '信息管理', 7);
- INSERT INTO `cdb_dsort` VALUES (48, 1, '数据备份', 9);
- INSERT INTO `cdb_dsort` VALUES (50, 4, '视频处理', 0);
- INSERT INTO `cdb_dsort` VALUES (51, 4, '媒体制作', 0);
- INSERT INTO `cdb_dsort` VALUES (52, 4, '音频编辑', 0);
- INSERT INTO `cdb_dsort` VALUES (53, 4, '媒体播放', 0);
- INSERT INTO `cdb_dsort` VALUES (54, 4, '媒体管理', 0);
- INSERT INTO `cdb_dsort` VALUES (55, 4, '媒体插件', 0);
- INSERT INTO `cdb_dsort` VALUES (56, 2, '操作系统', 0);
- INSERT INTO `cdb_dsort` VALUES (57, 2, '系统设置', 0);
- INSERT INTO `cdb_dsort` VALUES (58, 2, '系统备份', 0);
- INSERT INTO `cdb_dsort` VALUES (59, 2, '系统测试', 0);
- INSERT INTO `cdb_dsort` VALUES (60, 2, '卸载清除', 0);
- INSERT INTO `cdb_dsort` VALUES (61, 2, '磁盘工具', 0);
- INSERT INTO `cdb_dsort` VALUES (62, 2, '硬件维护', 0);
- INSERT INTO `cdb_dsort` VALUES (63, 2, '系统其它', 0);
- INSERT INTO `cdb_dsort` VALUES (64, 3, '搞笑视频', 5);
- INSERT INTO `cdb_dsort` VALUES (65, 3, '另类视频', 6);
- INSERT INTO `cdb_dsort` VALUES (66, 3, '电影下载', 3);
- INSERT INTO `cdb_dsort` VALUES (67, 3, '电视剧下载', 4);
- INSERT INTO `cdb_dsort` VALUES (68, 6, '服务器类', 0);
- INSERT INTO `cdb_dsort` VALUES (69, 6, '网页制作', 0);
- INSERT INTO `cdb_dsort` VALUES (70, 6, '网络辅助', 0);
- INSERT INTO `cdb_dsort` VALUES (71, 6, '网页浏览', 0);
- INSERT INTO `cdb_dsort` VALUES (72, 6, '联络聊天', 0);
- INSERT INTO `cdb_dsort` VALUES (73, 6, '上传下载', 0);
- INSERT INTO `cdb_dsort` VALUES (74, 6, '远程监控', 0);
- INSERT INTO `cdb_dsort` VALUES (75, 6, '邮件工具', 0);
- INSERT INTO `cdb_dsort` VALUES (76, 6, '网络共享', 0);
- INSERT INTO `cdb_dsort` VALUES (77, 7, '编程工具', 0);
- INSERT INTO `cdb_dsort` VALUES (78, 7, '数据库类', 1);
- INSERT INTO `cdb_dsort` VALUES (79, 7, '安装制作', 2);
- INSERT INTO `cdb_dsort` VALUES (80, 7, '控件插件', 3);
- INSERT INTO `cdb_dsort` VALUES (81, 7, '编译调试', 4);
- INSERT INTO `cdb_dsort` VALUES (82, 7, '.NET相关', 5);
- INSERT INTO `cdb_dsort` VALUES (83, 8, '电脑游戏', 0);
- INSERT INTO `cdb_dsort` VALUES (84, 8, '游戏开发', 0);
- INSERT INTO `cdb_dsort` VALUES (85, 8, '影视频道', 0);
- INSERT INTO `cdb_dsort` VALUES (86, 8, '音乐频道', 0);
- INSERT INTO `cdb_dsort` VALUES (87, 8, '游戏外挂', 0);
- INSERT INTO `cdb_dsort` VALUES (88, 8, '存档升级', 0);
- INSERT INTO `cdb_dsort` VALUES (89, 8, '小型游戏', 0);
- INSERT INTO `cdb_dsort` VALUES (90, 8, '娱乐其他', 0);
- INSERT INTO `cdb_dsort` VALUES (91, 9, '病毒防治', 0);
- INSERT INTO `cdb_dsort` VALUES (92, 9, '系统安全', 0);
- INSERT INTO `cdb_dsort` VALUES (93, 9, '网络安全', 0);
- INSERT INTO `cdb_dsort` VALUES (94, 9, '系统监视', 0);
- INSERT INTO `cdb_dsort` VALUES (95, 9, '密码管理', 0);
- INSERT INTO `cdb_dsort` VALUES (96, 9, '网吧管理', 0);
- INSERT INTO `cdb_dsort` VALUES (97, 9, '浏览安全', 0);
- INSERT INTO `cdb_dsort` VALUES (98, 10, '建站源码', 0);
- INSERT INTO `cdb_dsort` VALUES (99, 10, '汉化补丁', 0);
- INSERT INTO `cdb_dsort` VALUES (100, 10, '精彩动画', 0);
- INSERT INTO `cdb_dsort` VALUES (101, 10, '精品图库', 0);
- INSERT INTO `cdb_dsort` VALUES (102, 10, '经典珍藏', 0);
- INSERT INTO `cdb_dsort` VALUES (103, 10, '综合其他', 0);
- INSERT INTO `cdb_dsort` VALUES (104, 7, '开发助手', 0);
复制代码
繁体版下载:
https://discuz.dismall.com/attachment.php?aid=17036
[ 本帖最后由 oytktk 于 2005-9-8 22:57 编辑 ] |