thread_activity.php
3.4 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
<?php
/**
* [Discuz!] (C)2001-2099 Comsenz Inc.
* This is NOT a freeware, use is subject to license terms
*
* $Id: thread_activity.php 28709 2012-03-08 08:53:48Z liulanbo $
*/
if(!defined('IN_DISCUZ')) {
exit('Access Denied');
}
$isverified = $applied = 0;
$ufielddata = $applyinfo = '';
if($_G['uid']) {
$applyinfo = C::t('forum_activityapply')->fetch_info_for_user($_G['uid'], $_G['tid']);
if($applyinfo) {
$isverified = $applyinfo['verified'];
if($applyinfo['ufielddata']) {
$ufielddata = dunserialize($applyinfo['ufielddata']);
}
$applied = 1;
}
}
$applylist = array();
$activity = C::t('forum_activity')->fetch($_G['tid']);
$activityclose = $activity['expiration'] ? ($activity['expiration'] > TIMESTAMP ? 0 : 1) : 0;
$activity['starttimefrom'] = dgmdate($activity['starttimefrom'], 'u');
$activity['starttimeto'] = $activity['starttimeto'] ? dgmdate($activity['starttimeto']) : 0;
$activity['expiration'] = $activity['expiration'] ? dgmdate($activity['expiration']) : 0;
$activity['attachurl'] = $activity['thumb'] = '';
if($activity['ufield']) {
$activity['ufield'] = dunserialize($activity['ufield']);
if($activity['ufield']['userfield']) {
$htmls = $settings = array();
require_once libfile('function/profile');
foreach($activity['ufield']['userfield'] as $fieldid) {
if(empty($ufielddata['userfield'])) {
$memberprofile = C::t('common_member_profile')->fetch($_G['uid']);
foreach($activity['ufield']['userfield'] as $val) {
$ufielddata['userfield'][$val] = $memberprofile[$val];
}
unset($memberprofile);
}
$html = profile_setting($fieldid, $ufielddata['userfield'], false, true);
if($html) {
$settings[$fieldid] = $_G['cache']['profilesetting'][$fieldid];
$htmls[$fieldid] = $html;
}
}
}
} else {
$activity['ufield'] = '';
}
if($activity['aid']) {
$attach = C::t('forum_attachment_n')->fetch('tid:'.$_G['tid'], $activity['aid']);
if($attach['isimage']) {
$activity['attachurl'] = ($attach['remote'] ? $_G['setting']['ftp']['attachurl'] : $_G['setting']['attachurl']).'forum/'.$attach['attachment'];
$activity['thumb'] = $attach['thumb'] ? getimgthumbname($activity['attachurl']) : $activity['attachurl'];
$activity['width'] = $attach['thumb'] && $_G['setting']['thumbwidth'] < $attach['width'] ? $_G['setting']['thumbwidth'] : $attach['width'];
}
$skipaids[] = $activity['aid'];
}
$applylistverified = array();
$noverifiednum = 0;
$query = C::t('forum_activityapply')->fetch_all_for_thread($_G['tid'], 0, 0, 0, 1);
foreach($query as $activityapplies) {
$activityapplies['dateline'] = dgmdate($activityapplies['dateline'], 'u');
if($activityapplies['verified'] == 1) {
$activityapplies['ufielddata'] = dunserialize($activityapplies['ufielddata']);
if(count($applylist) < $_G['setting']['activitypp']) {
$activityapplies['message'] = preg_replace("/(".lang('forum/misc', 'contact').".*)/", '', $activityapplies['message']);
$applylist[] = $activityapplies;
}
} else {
if(count($applylistverified) < 8) {
$applylistverified[] = $activityapplies;
}
$noverifiednum++;
}
}
$applynumbers = $activity['applynumber'];
$aboutmembers = $activity['number'] >= $applynumbers ? $activity['number'] - $applynumbers : 0;
$allapplynum = $applynumbers + $noverifiednum;
if($_G['forum']['status'] == 3) {
$isgroupuser = groupperm($_G['forum'], $_G['uid']);
}
?>