event_setting.inc.php 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126
  1. <?php
  2. /**
  3. * [超级活动(xj_event.{modulename})] (C)2012-2099 Powered by 逍遥工作室.
  4. * Version: 1.0
  5. * Date: 2012-9-15 10:27
  6. */
  7. if(!defined('IN_DISCUZ')) {
  8. exit('Access Denied');
  9. }
  10. $tid = intval($_GET['tid']);
  11. //权限验证
  12. $thread = DB::fetch_first("SELECT A.authorid,B.setting FROM ".DB::table('forum_thread')." A,".DB::table('xj_event')." B WHERE A.tid='$tid' and A.tid = B.tid");
  13. $setting = unserialize($thread['setting']);
  14. //判断是不是管理团队
  15. $event_admin = false;
  16. if(in_array($_G['username'],$setting['event_admin'])){
  17. $event_admin = true;
  18. }
  19. if($_G['groupid']>1 && $_G['uid']!=$thread['authorid'] && !$event_admin){
  20. showmessage('quickclear_noperm');
  21. }
  22. if($_GET['action']=='save'){
  23. if($_GET['formhash'] != $_G['formhash']){
  24. showmessage('submit_invalid');
  25. }
  26. $upload = new discuz_upload();
  27. $uploadtype = 'profile';
  28. if($upload->init($_FILES['group_qrcode'], $uploadtype)){
  29. $upload->save();
  30. $setting['group_qrcode'] = $upload->attach['attachment'];
  31. $setting['group_qrcode'] = 'data/attachment/profile/'.$setting['group_qrcode'];
  32. }
  33. //投票
  34. $vote['openvote'] = intval($_GET['openvote']);
  35. $vote['votestarttime'] = strtotime($_GET['votestarttime']);
  36. $vote['voteendtime'] = strtotime($_GET['voteendtime']);
  37. $vote['votecheckhour'] = intval($_GET['votecheckhour']);
  38. $vote['votechecknumber'] = intval($_GET['votechecknumber']);
  39. $vote['ipcheck'] = intval($_GET['ipcheck']);
  40. $vote['usercheck'] = intval($_GET['usercheck']);
  41. $setting['vote'] = $vote;
  42. //报名
  43. $setting['noverify'] = intval($_GET['noverify']);
  44. $setting['canceljoin'] = intval($_GET['canceljoin']);
  45. $setting['onlyappbymejoin'] = intval($_GET['onlyappbymejoin']);
  46. $setting['onlyvip'] = intval($_GET['onlyvip']);
  47. $setting['onlysubscribeweixin'] = intval($_GET['onlysubscribeweixin']);
  48. //邀请报名
  49. $setting['invitation']['open'] = intval($_GET['invitationcodeopen']);
  50. $setting['invitation']['code'] = intval($_GET['invitationcode']);
  51. //活动签到
  52. if(file_exists(DISCUZ_ROOT.'./source/plugin/xj_event/module/signed/wsq_signed.php')) {
  53. $setting['signed']['open'] = intval($_GET['signed_open']);
  54. }
  55. //大转盘
  56. $setting['zhuanpan']['open'] = intval($_GET['zhuanpan_open']);
  57. $setting['zhuanpan']['vcode'] = addslashes($_GET['zhuanpan_vcode']);
  58. $setting['zhuanpan']['sign'] = addslashes($_GET['zhuanpan_sign']);
  59. $setting['zhuanpan']['zuoye'] = addslashes($_GET['zhuanpan_zuoye']);
  60. //邀请报名奖励积分
  61. if(file_exists(DISCUZ_ROOT.'./source/plugin/xj_event/module/invitation/event_yqjl.php')) {
  62. $setting['yqjl_jfs'] = intval($_GET['yqjl_jfs']);
  63. $setting['yqjl_jflx'] = intval($_GET['yqjl_jflx']);
  64. }
  65. //海报背景
  66. if($upload->init($_FILES['posterbg'], $uploadtype)){
  67. $upload->save();
  68. $setting['posterbg'] = $upload->attach['attachment'];
  69. $setting['posterbg'] = 'data/attachment/profile/'.$setting['posterbg'];
  70. }
  71. $setting_str = serialize($setting);
  72. DB::query("UPDATE ".DB::table('xj_event')." set setting = '$setting_str' WHERE tid = '$tid'");
  73. showmessage(lang('plugin/xj_event', 'bccg'), 'forum.php?mod=viewthread&tid='.$tid);
  74. }
  75. $items = DB::fetch_first("SELECT setting FROM ".DB::table('xj_event')." WHERE tid='$tid'");
  76. $setting = unserialize($items['setting']);
  77. if($setting['vote']['votestarttime'] and $setting['vote']['voteendtime']){
  78. $votestarttime = dgmdate($setting['vote']['votestarttime'],'dt');
  79. $voteendtime = dgmdate($setting['vote']['voteendtime'],'dt');
  80. $votecheckhour = $setting['vote']['votecheckhour'];
  81. $votechecknumber = $setting['vote']['votechecknumber'];
  82. }else{
  83. $votestarttime =dgmdate($_G['timestamp'],'dt');
  84. $voteendtime = dgmdate($_G['timestamp'],'dt');
  85. $votecheckhour = 1;
  86. $votechecknumber = 1;
  87. }
  88. //活动签到
  89. if(file_exists(DISCUZ_ROOT.'./source/plugin/xj_event/module/signed/wsq_signed.php')) {
  90. $signed_enable = true;
  91. }
  92. if(file_exists(DISCUZ_ROOT.'./source/plugin/xj_event/module/invitation/event_yqjl.php')) {
  93. $invitation_enable = true;
  94. }
  95. $extcredits = $_G['setting']['extcredits'];
  96. include template('xj_event:event_setting');
  97. ?>