cache_fields_connect_register.php
1.16 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
<?php
/**
* [Discuz!] (C)2001-2099 Comsenz Inc.
* This is NOT a freeware, use is subject to license terms
*
* $Id: cache_fields_connect_register.php 24935 2011-10-17 07:41:48Z zhangguosheng $
*/
if(!defined('IN_DISCUZ')) {
exit('Access Denied');
}
function build_cache_fields_connect_register() {
global $_G;
$data = array();
$fields = array();
if($_G['setting']['connect']['register_gender']) {
$fields[] = 'gender';
}
if($_G['setting']['connect']['register_birthday']) {
$fields[] = 'birthyear';
$fields[] = 'birthmonth';
$fields[] = 'birthday';
}
if($fields) {
foreach(C::t('common_member_profile_setting')->fetch_all($fields) as $field) {
$choices = array();
if($field['selective']) {
foreach(explode("\n", $field['choices']) as $item) {
list($index, $choice) = explode('=', $item);
$choices[trim($index)] = trim($choice);
}
$field['choices'] = $choices;
} else {
unset($field['choices']);
}
$field['showinregister'] = 1;
$field['available'] = 1;
$data['field_'.$field['fieldid']] = $field;
}
}
savecache('fields_connect_register', $data);
}
?>