【文件属性】:
文件名称:Discuz! X1.5礼品兑换插件
文件大小:715KB
文件格式:RAR
更新时间:2013-12-09 12:50:23
礼品兑换插件
礼品兑换插件1.5 正式版
适用版本:discuz X 的任何版本
版权所属:银领创业协会
支持网站: http://www.ylcyxh.cn
重要申明:请您在安装之前务必备份相关数据和相关文件。因任何未备份相关数据和相关文件造成的数据丢失我们概不负责。
----------------------------------------全新安装---------------------------------------
一、文件拷贝
打开 插件源文件 的文件夹。
将以下文件拷贝到 discuzX版的网站的根目录下
,各个文件都是独立开的,不会与原来程序有冲突
二、执行数据库表
//升级之前请先备份好数据库,因任何未备份相关数据和相关文件造成的数据丢失我们概不负责
①:打开 数据库文件 文件夹 --> gift_db.sql 文件,
②:如果你的数据库表前缀为pre_
那么可以直接复制内容,若不是请全局替换
gift _db.sql
下的表的前缀 pre_ => 您原来的表前缀。
③:打开数据库操作工具
如:phpmyadmin
将复制的数据表代码
黏贴到 phpmyadmin 操作工具上,点击执行即可
三、手动添加礼品图片上传分类代码
打开source\class\class_upload.php
大概在 139 行 找到 function get_target_dir
function check_dir_type
在这两个方法中添加图片类表
原来代码:
function get_target_dir($type, $extid = '', $check_exists = true) {
$subdir = $subdir1 = $subdir2 = '';
if($type == 'album' || $type == 'forum' || $type == 'portal' || $type == 'category') {
$subdir1 = date('Ym');
$subdir2 = date('d');
$subdir = $subdir1.'/'.$subdir2.'/';
} elseif($type == 'group' || $type == 'common') {
$subdir = $subdir1 = substr(md5($extid), 0, 2).'/';
}
$check_exists && discuz_upload::check_dir_exists($type, $subdir1, $subdir2);
return $subdir;
}
function check_dir_type($type) {
return !in_array($type, array('forum', 'group', 'album', 'portal', 'paimai','common', 'temp', 'category')) ? 'temp' : $type;
}
----------------------------------------------------------------------------------------------------------------------
修改后代码:红色字体为添加的新代码
function get_target_dir($type, $extid = '', $check_exists = true) {
$subdir = $subdir1 = $subdir2 = '';
//e动代码
//xiaozhi edit 2010-8-5 14:48:24
//增加图片存储文件夹中日期分类'eg_gift'
if($type == 'eg_gift' || $type == 'album' || $type == 'forum' || $type == 'portal' || $type == 'paimai' || $type == 'category') {
$subdir1 = date('Ym');
$subdir2 = date('d');
$subdir = $subdir1.'/'.$subdir2.'/';
} elseif($type == 'group' || $type == 'common') {
$subdir = $subdir1 = substr(md5($extid), 0, 2).'/';
}
$check_exists && discuz_upload::check_dir_exists($type, $subdir1, $subdir2);
return $subdir;
}
function check_dir_type($type) {
//e动代码
//xiaozhi edit 2010-8-5 14:48:24
//增加图片存储文件夹'eg_gift'
return !in_array($type, array('eg_gift','forum', 'group', 'album', 'portal', 'paimai','common', 'temp', 'category')) ? 'temp' : $type;
}
详细看图片:
四、登陆网站后台更新缓存 ok
插件前台:http://您的域名/gift.php
插件后台:http://您的域名/giftadmin.php
插件个人中心:http://您的域名/giftmember.php
四、首次使用进行 基本配置
其他说明:
合作单位页面:egbaba_gift\template\default\gift_partner.htm
广告页面:egbaba_gift\template\default\gift_ads.htm