} if (!empty($_G['member']['residedist'])) { $district[] = $_G['member']['residedist']; } if (!empty($_G['member']['residecommunity'])) { $district[] = $_G['member']['residecommunity']; } } } if (!empty($district)) { foreach (C::t('#sanree_brand#sanree_brand_district')->fetch_all_by_name($district) as $value) { $key = $value['level'] - 1; $values[$key] = $value['id']; } $level++; } } } if ($values[1]) { $level++; } if ($values[2]) { $level++; } if ($values[3]) { $level++; } $showlevel = $level; $elems = array('srbirthprovince', 'srbirthcity', 'srbirthdist', 'srbirthcommunity'); $districthtml = srshowdistrict($values, $elems, $container, $showlevel, $containertype); include templateEx($plugin['identifier'] . ':' . $template . '/district');
function brand_setting($fieldid, $space = array(), $showstatus = false, $ignoreunchangable = false, $ignoreshowerror = false) { global $_G; if (empty($_G['cache']['profilesetting'])) { loadcache('profilesetting'); } $field = $_G['cache']['profilesetting'][$fieldid]; if ($fieldid == 'birthcity') { if ($field['unchangeable'] && !empty($space[$fieldid])) { return '<span>' . $space['srbirthprovince'] . '-' . $space['srbirthcity'] . '</span>'; } $values = array(0, 0, 0, 0); $elems = array('srbirthprovince', 'srbirthcity', 'srbirthdist', 'srbirthcommunity'); if (!empty($space['srbirthprovince'])) { $html = srprofile_show('birthcity', $space); $html .= ' (<a href="javascript:;" onclick="srshowdistrict(\'birthdistrictbox\', [\'birthprovince\', \'birthcity\', \'birthdist\', \'birthcommunity\'], 4, \'\', \'birth\'); return false;">' . lang('spacecp', 'profile_edit') . '</a>)'; $html .= '<p id="birthdistrictbox"></p>'; } else { $html = '<p id="birthdistrictbox">' . srshowdistrict($values, $elems, 'birthdistrictbox', 1, 'birth') . '</p>'; } } return $html; }