/*
[DISCUZ!] activity.inc.php
This is NOT a freeware, use is pay money
Version: 2.0.0 For Discuz!4.0.0 by 泡哥
Web: http://www.comsenz.com http://www.dpwin.net
Copyright: 2001-2005 Comsenz Technology Ltd.
Last Modified: 2006-1-25 24:00
*/
测试地址:d4.dpwin.net 2006-1-25 5:30前安装的 BUG修改见二楼
SQL5.0或以上版本暂时别装 语法有问题 正在解决中……
功能描述:
1.帖子中显示报名明细
2.会员参加活动可退出或编辑报名资料
3.召集者可查看会员认证资料
4.召集者可编辑或审核会员报名资料
5.需要认证才能参加活动
6.后台可设定发起者的权限
7.后台可选活动职务
8.后台可选参加者是否带宠物
9.后台可设定各种奖惩措施和积分挂钩
10.可关闭活动中心
11.增加活动排行功能
12.会员申请活动人数检查
13.可指定多个论坛发起活动
14.可设定禁止发起、参加黑名单
15.可补充报名认证须知
16.可反馈活动白鸽成员
17.配合D4发贴审核可以达到审核活动要求
18.点击状态图标审核、退出 点击会员名编辑!
数据升级:
升级主题表:
- ALTER TABLE `cdb_threads` ADD `condition` TINYINT( 1 ) NOT NULL ,
- ADD `activetime` VARCHAR( 100 ) NOT NULL ,
- ADD `upperlimit` INT( 10 ) DEFAULT '0' NOT NULL ,
- ADD `confirm` INT( 10 ) DEFAULT '0' NOT NULL ,
- ADD `acendtime` VARCHAR( 100 ) NOT NULL ;
复制代码
升级会员表:
- ALTER TABLE `cdb_members` ADD `activenum` MEDIUMINT( 8 ) UNSIGNED NOT NULL ,
- ADD `truename` varchar( 15 ) NOT NULL ,
- ADD `telephone` varchar( 20 ) NOT NULL ,
- ADD `idcard` varchar( 20 ) NOT NULL ,
- ADD `urgent` varchar( 20 ) NOT NULL ,
- ADD `initiates` INT( 10 ) DEFAULT '0' NOT NULL ,
- ADD `application` INT( 10 ) DEFAULT '0' NOT NULL ,
- ADD `pigeon` INT( 10 ) DEFAULT '0' NOT NULL ;
复制代码
增加活动表:
- DROP TABLE IF EXISTS cdb_activereg;
- CREATE TABLE `cdb_activereg` (
- `tid` INT( 10 ) UNSIGNED NOT NULL ,
- `uid` MEDIUMINT( 8 ) UNSIGNED NOT NULL ,
- `male` INT( 10 ) DEFAULT '0' NOT NULL ,
- `female` INT( 10 ) DEFAULT '0' NOT NULL ,
- `peter` INT( 10 ) DEFAULT '0' NOT NULL ,
- `applytime` INT( 10 ) DEFAULT '0' NOT NULL ,
- `activeduty` VARCHAR( 100 ) NOT NULL ,
- `memo` TEXT NOT NULL ,
- `operation` TINYINT( 1 ) NOT NULL ,
- PRIMARY KEY ( `tid` , `uid` )
- ) TYPE = MYISAM COMMENT = '活动中心申请表';
复制代码
插件修改:
1.修改./include/newthread.inc.php
找到
下面加
- @include_once DISCUZ_ROOT."./plugins/activity/ac_check.inc.php";
复制代码
找到
- $db->query("INSERT INTO {$tablepre}threads (fid, readperm, price, iconid, typeid, author, authorid, subject, dateline, lastpost, lastposter, displayorder, digest, blog, poll, attachment, moderated)
- VALUES ('$fid', '$readperm', '$price', '$iconid', '$typeid', '$discuz_user', '$discuz_uid', '$subject', '$timestamp', '$timestamp', '$discuz_user', '$displayorder', '$digest', '$blog', '$poll', '$attachment', '$moderated')");
复制代码
替换成
- if(isset($activity))$confirm=$confirm+$acmale+$acfemale;
- $db->query("INSERT INTO {$tablepre}threads (fid, readperm, price, iconid, typeid, author, authorid, subject, dateline, lastpost, lastposter, displayorder, digest, blog, poll, attachment, moderated, activetime, acendtime, upperlimit, condition, confirm)
- VALUES ('$fid', '$readperm', '$price', '$iconid', '$typeid', '$discuz_user', '$discuz_uid', '$subject', '$timestamp', '$timestamp', '$discuz_user', '$displayorder', '$digest', '$blog', '$poll', '$attachment', '$moderated', '$activetime', '$acendtime', '$upperlimit', '1', '$confirm')");
复制代码
找到
下面加
- if(isset($activity) && ($acmale || $acfemale)){
- if($acpeter)$acpeter=0;
- $db->query("INSERT INTO {$tablepre}activereg (tid, uid, male, female, peter, applytime, activeduty, memo, operation)
- VALUES ('$tid', '$discuz_uid', '$acmale', '$acfemale', '$acpeter', '$timestamp', '$acduty', '$acmome', '5')");
- }
复制代码
2.修改./forumdisplay.php
找到
- include template('forumdisplay');
复制代码
上面加
- @include_once DISCUZ_ROOT."./plugins/activity/ac_check.inc.php";
复制代码
3.修改./viewthread.php
找到
- include template('viewthread');
复制代码
上面加
- @include_once DISCUZ_ROOT."./plugins/activity/ac_register.inc.php";
复制代码
4.修改./templates/default/forumdisplay.htm
找到 (有两处)
- <!--{if ($allowpost || !$discuz_uid) && $allowposttrade}--> <a href="post.php?action=newthread&fid=$fid&extra=$extra&trade=yes"><img src="{IMGDIR}/newtrade.gif" border="0"></a><!--{/if}-->
复制代码
下面加
- <!--{if ($allowpost || !$discuz_uid) && $allowactivity}--> <a href="post.php?action=newthread&fid=$fid&extra=$extra&activity=yes"><img src="{IMGDIR}/activity.gif" border="0"></a><!--{/if}-->
复制代码
找到
- <!--{if $thread['attachment']}--><img src="images/attachicons/common.gif"><!--{/if}-->
复制代码
下面加
- <!--{if $thread['condition']==1 and $thread['upperlimit']}-->$activityl[ac_cond1]<!--{elseif $thread['condition']==2 and $thread['upperlimit']}-->$activityl[ac_cond2]<!--{elseif $thread['condition']==3 and $thread['upperlimit']}-->$activityl[ac_cond3]<!--{/if}-->
复制代码
5.修改./templates/default/viewthread.htm
找到 (有两处)
- <!--{if ($allowpost || !$discuz_uid) && $allowposttrade}--> <a href="post.php?action=newthread&fid=$fid&extra=$extra&trade=yes"><img src="{IMGDIR}/newtrade.gif" border="0"></a><!--{/if}-->
复制代码
下面加
- <!--{if ($allowpost || !$discuz_uid) && $allowactivity}--> <a href="post.php?action=newthread&fid=$fid&extra=$extra&activity=yes"><img src="{IMGDIR}/activity.gif" border="0"></a><!--{/if}-->
复制代码
找到
- <!--{if $post['signature']}--><br><br><br></td></tr><tr><td valign="bottom" $maxsigrows><img src="images/common/sigline.gif"><br>$post[signature]<!--{/if}-->
复制代码
上面加
- <!--{if $allowactivity and $thread[upperlimit] and $post['number'] == 1}-->{template activity_register}<!--{/if}-->
复制代码
6.修改./templates/default/post_newthread.htm
找到
- } else if (theform.subject.value == "" || theform.message.value == "") {
- alert("{lang post_subject_or_message_isnull}");
- return false;
复制代码
下面加
- } else if ($allowactivity==1 && (theform.activetime.value == "" || theform.acendtime.value == "" || theform.upperlimit.value == "" || (theform.acmale.value == 0 && theform.acfemale.value == 0))) {
- alert("$activityl[ac_qwcghdbt]");
- return false;
复制代码
找到
- {lang post_trade_transport_comment}<br>
- {lang post_trade_transport_mail} <input type="text" name="postage_mail" size="3" value="$postage_mail" $postagedisabled> {lang post_trade_transport_mail_unit}<br>
- {lang post_trade_transport_express} <input type="text" name="postage_express" size="3" value="$postage_express" $postagedisabled> {lang post_trade_transport_express_unit}
- </td>
- </tr>
复制代码
下面加
- <!--{elseif isset($activity) && $allowactivity}-->
- <input type="hidden" name="activity" value="yes">
- <tr>
- <td class="altbg1">$activityl[ac_hdkssj]:</td>
- <td class="altbg2"><input type="text" name="activetime" size="30" value="">$activityl[ac_btgs]: <?=gmdate("Y-n-j",time()+8*3600)?></td>
- </tr>
- <tr>
- <td class="altbg1">$activityl[ac_hdjssj]:</td>
- <td class="altbg2"><input type="text" name="acendtime" size="30" value="">$activityl[ac_btgs]: <?=gmdate("Y-n-j",time()+8*3600)?></td>
- </tr>
- <tr>
- <td class="altbg1">$activityl[ac_bmrssx]:</td>
- <td class="altbg2"><input type="text" name="upperlimit" size="30" value="$upperlimit">$activityl[ac_btxx]
- </td>
- </tr>
- <tr>
- <td class="altbg1">$activityl[ac_hdrs]:</td>
- <td class="altbg2"><input type=text size="1" name="acmale" value="0" maxlength="2"> $activityl[ac_sg]
- <input type=text size="1" name="acfemale" value="0" maxlength="2"> $activityl[ac_mv]
- <!--{if !$acsettings[peter]}-->
- <input type=text size="1" name="acpeter" value="0"> $activityl[ac_cw]
- <!--{/if}--> $activityl[ac_axbtx]</td>
- </tr>
- <tr>
- <td class="altbg1">$activityl[ac_hdzw]:</td>
- <td class="altbg2">
- <!--{if !$acsettings[closeduty]}-->
- <select name="acduty">
- <option value="">$activityl[ac_qxz]</option>
- <!--{loop $appliyduty $app}-->
- <option value="$app">$app</option>
- <!--{/loop}-->
- </select>
- <!--{/if}-->
- </td></tr>
- <tr>
- <td class="altbg1">$activityl[ac_hdbz1]:</td>
- <td class="altbg2"><textarea name="acmome" rows="4" style="width: 50%; word-break: break-all">$activityl[ac_hydjyybm]</textarea></td>
- </tr>
复制代码
7.修改./templates/default/actions.lang.php
找到
下面加
8.上传附件中plugins、templates、images文件夹
9.后台【插件管理】导入discuz_plugin_activity.txt的脚本文件内容
10.后台【插件设置】——活动中心——设置插件参数
11.更新缓存ok
[ 本帖最后由 泡哥 于 2006-1-25 21:01 编辑 ] |