本文整理汇总了PHP中showdistrict函数的典型用法代码示例。如果您正苦于以下问题:PHP showdistrict函数的具体用法?PHP showdistrict怎么用?PHP showdistrict使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了showdistrict函数的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: foreach
if (empty($_GET['all'])) {
$selectstr = $i == $space['birthday'] ? ' selected=\\"selected\\"' : '';
}
$birthdayhtml .= "<option value=\"{$i}\"{$selectstr}>{$i}</option>";
}
$bloodhtml = '';
foreach (array('A', 'B', 'O', 'AB') as $value) {
if (empty($_GET['all'])) {
$selectstr = $value == $space['blood'] ? ' selected=\\"selected\\"' : '';
}
$bloodhtml .= "<option value=\"{$value}\"{$selectstr}>{$value}</option>";
}
$marryarr = array($space['marry'] => ' selected');
include_once libfile('function/profile');
$birthcityhtml = showdistrict(array(0, 0), array('birthprovince', 'birthcity'), 'birthcitybox');
$residecityhtml = showdistrict(array(0, 0, 0, 0), array('resideprovince', 'residecity', 'residedist', 'residecommunity'), 'residecitybox');
foreach ($fields as $fkey => $fvalue) {
if (empty($fvalue['choices'])) {
$fvalue['html'] = '<input type="text" name="field_' . $fkey . '" class="px" value="" />';
} else {
$fvalue['html'] = "<select name=\"field_{$fkey}\"><option value=\"\">---</option>";
$optionarr = explode("\n", $fvalue['choices']);
foreach ($optionarr as $ov) {
$ov = trim($ov);
if ($ov) {
$fvalue['html'] .= "<option value=\"{$ov}\">{$ov}</option>";
}
}
$fvalue['html'] .= "</select>";
}
$fields[$fkey] = $fvalue;
示例2: showsearchform
function showsearchform($operation = '')
{
global $_G, $lang;
$groupselect = array();
$usergroupid = isset($_G['gp_usergroupid']) && is_array($_G['gp_usergroupid']) ? $_G['gp_usergroupid'] : array();
$query = DB::query("SELECT type, groupid, grouptitle, radminid FROM " . DB::table('common_usergroup') . " WHERE groupid NOT IN ('6', '7') ORDER BY (creditshigher<>'0' || creditslower<>'0'), creditslower, groupid");
while ($group = DB::fetch($query)) {
$group['type'] = $group['type'] == 'special' && $group['radminid'] ? 'specialadmin' : $group['type'];
$groupselect[$group['type']] .= "<option value=\"{$group['groupid']}\" " . (in_array($group['groupid'], $usergroupid) ? 'selected' : '') . ">{$group['grouptitle']}</option>\n";
}
$groupselect = '<optgroup label="' . $lang['usergroups_member'] . '">' . $groupselect['member'] . '</optgroup>' . ($groupselect['special'] ? '<optgroup label="' . $lang['usergroups_special'] . '">' . $groupselect['special'] . '</optgroup>' : '') . ($groupselect['specialadmin'] ? '<optgroup label="' . $lang['usergroups_specialadmin'] . '">' . $groupselect['specialadmin'] . '</optgroup>' : '') . '<optgroup label="' . $lang['usergroups_system'] . '">' . $groupselect['system'] . '</optgroup>';
showtagheader('div', 'searchmembers', !$_G['gp_submit']);
echo '<script src="static/js/calendar.js" type="text/javascript"></script>';
echo '<style type="text/css">#residedistrictbox select, #birthdistrictbox select{width: auto;}</style>';
showformheader("plugins&operation=config&do=" . $_G['gp_do'] . "&identifier=smstong&pmod=sendsms", "onSubmit=\"if(\$('updatecredittype1') && \$('updatecredittype1').checked && !window.confirm('{$lang['members_reward_clean_alarm']}')){return false;} else {return true;}\"");
showtableheader();
showsetting('members_search_user', 'username', $_G['gp_username'], 'text');
showsetting('members_search_uid', 'uid', $_G['gp_uid'], 'text');
showsetting('members_search_group', '', '', '<select name="groupid[]" multiple="multiple" size="10">' . $groupselect . '</select>');
showtablefooter();
showtableheader();
$_G['showsetting_multirow'] = 1;
showtagheader('tbody', 'advanceoption');
if (!empty($_G['setting']['connect']['allow'])) {
showsetting('members_search_conisbind', array('conisbind', array(array(1, $lang['yes']), array(0, $lang['no'])), 1), $_G['gp_conisbind'], 'mradio');
showsetting('members_search_uinblacklist', array('uin_low', array(array(1, $lang['yes']), array(0, $lang['no'])), 1), $_G['gp_uin_low'], 'mradio');
}
showsetting('members_search_online', array('sid_noempty', array(array(1, $lang['yes']), array(0, $lang['no'])), 1), $_G['gp_online'], 'mradio');
showsetting('members_search_lockstatus', array('status', array(array(-1, $lang['yes']), array(0, $lang['no'])), 1), $_G['gp_status'], 'mradio');
showsetting('members_search_emailstatus', array('emailstatus', array(array(1, $lang['yes']), array(0, $lang['no'])), 1), $_G['gp_emailstatus'], 'mradio');
showsetting('members_search_avatarstatus', array('avatarstatus', array(array(1, $lang['yes']), array(0, $lang['no'])), 1), $_G['gp_avatarstatus'], 'mradio');
showsetting('members_search_email', 'email', $_G['gp_email'], 'text');
showsetting("{$lang['credits']} {$lang['members_search_between']}", array("credits_low", "credits_high"), array($_G['gp_credits_low'], $_G['gp_credtis_high']), 'range');
if (!empty($_G['setting']['extcredits'])) {
foreach ($_G['setting']['extcredits'] as $id => $credit) {
showsetting("{$credit['title']} {$lang['members_search_between']}", array("extcredits{$id}" . "_low", "extcredits{$id}" . "_high"), array($_G['gp_extcredits' . $id . '_low'], $_G['gp_extcredits' . $id . '_high']), 'range');
}
}
showsetting('members_search_friendsrange', array('friends_low', 'friends_high'), array($_G['gp_friends_low'], $_G['gp_friends_high']), 'range');
showsetting('members_search_postsrange', array('posts_low', 'posts_high'), array($_G['gp_posts_low'], $_G['gp_posts_high']), 'range');
showsetting('members_search_regip', 'regip', $_G['gp_regip'], 'text');
showsetting('members_search_lastip', 'lastip', $_G['gp_lastip'], 'text');
showsetting('members_search_regdaterange', array('regdate_after', 'regdate_before'), array($_G['gp_regdate_after'], $_G['gp_regdate_before']), 'daterange');
showsetting('members_search_lastvisitrange', array('lastvisit_after', 'lastvisit_before'), array($_G['gp_lastvisit_after'], $_G['gp_lastvisit_before']), 'daterange');
showsetting('members_search_lastpostrange', array('lastpost_after', 'lastpost_before'), array($_G['gp_lastpost_after'], $_G['gp_lastpost_before']), 'daterange');
showsetting('members_search_group_fid', 'fid', $_G['gp_fid'], 'text');
if ($_G['setting']['verify']) {
$verifydata = array();
foreach ($_G['setting']['verify'] as $key => $value) {
if ($value['available']) {
$verifydata[] = array('verify' . $key, $value['title']);
}
}
if (!empty($verifydata)) {
showsetting('members_search_verify', array('verify', $verifydata), $_G['gp_verify'], 'mcheckbox');
}
}
$yearselect = $monthselect = $dayselect = "<option value=\"\">" . cplang('nolimit') . "</option>\n";
$yy = dgmdate(TIMESTAMP, 'Y');
for ($y = $yy; $y >= $yy - 100; $y--) {
$y = sprintf("%04d", $y);
$yearselect .= "<option value=\"{$y}\" " . ($_G['gp_birthyear'] == $y ? 'selected' : '') . ">{$y}</option>\n";
}
for ($m = 1; $m <= 12; $m++) {
$m = sprintf("%02d", $m);
$monthselect .= "<option value=\"{$m}\" " . ($_G['gp_birthmonth'] == $m ? 'selected' : '') . ">{$m}</option>\n";
}
for ($d = 1; $d <= 31; $d++) {
$d = sprintf("%02d", $d);
$dayselect .= "<option value=\"{$d}\" " . ($_G['gp_birthday'] == $d ? 'selected' : '') . ">{$d}</option>\n";
}
showsetting('members_search_birthday', '', '', '<select class="txt" name="birthyear" style="width:75px; margin-right:0">' . $yearselect . '</select> ' . $lang['year'] . ' <select class="txt" name="birthmonth" style="width:75px; margin-right:0">' . $monthselect . '</select> ' . $lang['month'] . ' <select class="txt" name="birthday" style="width:75px; margin-right:0">' . $dayselect . '</select> ' . $lang['day']);
loadcache('profilesetting');
unset($_G['cache']['profilesetting']['uid']);
unset($_G['cache']['profilesetting']['birthyear']);
unset($_G['cache']['profilesetting']['birthmonth']);
unset($_G['cache']['profilesetting']['birthday']);
require_once libfile('function/profile');
foreach ($_G['cache']['profilesetting'] as $fieldid => $value) {
if (!$value['available'] || in_array($fieldid, array('birthprovince', 'birthdist', 'birthcommunity', 'resideprovince', 'residedist', 'residecommunity'))) {
continue;
}
if ($fieldid == 'gender') {
$select = "<option value=\"\">" . cplang('nolimit') . "</option>\n";
$select .= "<option value=\"0\">" . cplang('members_edit_gender_secret') . "</option>\n";
$select .= "<option value=\"1\">" . cplang('members_edit_gender_male') . "</option>\n";
$select .= "<option value=\"2\">" . cplang('members_edit_gender_female') . "</option>\n";
showsetting($value['title'], '', '', '<select class="txt" name="gender">' . $select . '</select>');
} elseif ($fieldid == 'birthcity') {
$elems = array('birthprovince', 'birthcity', 'birthdist', 'birthcommunity');
showsetting($value['title'], '', '', '<div id="birthdistrictbox">' . showdistrict(array(0, 0, 0, 0), $elems, 'birthdistrictbox', 1) . '</div>');
} elseif ($fieldid == 'residecity') {
$elems = array('resideprovince', 'residecity', 'residedist', 'residecommunity');
showsetting($value['title'], '', '', '<div id="residedistrictbox">' . showdistrict(array(0, 0, 0, 0), $elems, 'residedistrictbox', 1) . '</div>');
} elseif ($fieldid == 'constellation') {
$select = "<option value=\"\">" . cplang('nolimit') . "</option>\n";
for ($i = 1; $i <= 12; $i++) {
$name = lang('space', 'constellation_' . $i);
$select .= "<option value=\"{$name}\">{$name}</option>\n";
}
//.........这里部分代码省略.........
示例3: block_makeform
function block_makeform($blocksetting, $values)
{
global $_G;
static $randomid = 0, $calendar_loaded = false;
$return = array();
foreach ($blocksetting as $settingvar => $setting) {
$varname = in_array($setting['type'], array('mradio', 'mcheckbox', 'select', 'mselect')) ? $setting['type'] == 'mselect' ? array('parameter[' . $settingvar . '][]', $setting['value']) : array('parameter[' . $settingvar . ']', $setting['value']) : 'parameter[' . $settingvar . ']';
$value = isset($values[$settingvar]) ? $values[$settingvar] : $setting['default'];
$type = $setting['type'];
$s = $comment = '';
if (preg_match('/^([\\w]+?)_[\\w]+$/i', $setting['title'], $match)) {
$langscript = $match[1];
$setname = lang('block/' . $langscript, $setting['title']);
$comment = lang('block/' . $langscript, $setting['title'] . '_comment', array(), '');
} else {
$langscript = '';
$setname = $setting['title'];
}
$check = array();
if ($type == 'radio') {
$value ? $check['true'] = "checked" : ($check['false'] = "checked");
$value ? $check['false'] = '' : ($check['true'] = '');
$s .= '<label for="randomid_' . ++$randomid . '" class="lb"><input type="radio" name="' . $varname . '" id="randomid_' . $randomid . '" class="pr" value="1" ' . $check['true'] . '>' . lang('core', 'yes') . '</label>' . '<label for="randomid_' . ++$randomid . '" class="lb"><input type="radio" name="' . $varname . '" id="randomid_' . $randomid . '" class="pr" value="0" ' . $check['false'] . '>' . lang('core', 'no') . '</label>';
} elseif ($type == 'text' || $type == 'password' || $type == 'number') {
$s .= '<input type="' . $type . '" name="' . $varname . '" class="px" value="' . dhtmlspecialchars($value) . '" />';
} elseif ($type == 'textarea') {
$s .= '<textarea name="' . $varname . '" class="pt" rows="4" cols="40">' . dhtmlspecialchars($value) . '</textarea>';
} elseif ($type == 'mtextarea') {
$s .= '<textarea name="' . $varname . '" class="pt" rows="4" cols="40" onblur="blockCheckTag(this);">' . dhtmlspecialchars($value) . '</textarea>';
} elseif ($type == 'select') {
$s .= '<select name="' . $varname[0] . '" class="ps">';
foreach ($varname[1] as $option) {
$selected = $option[0] == $value ? ' selected="selected"' : '';
$s .= '<option value="' . $option[0] . '"' . $selected . '>' . ($langscript ? lang('block/' . $langscript, $option[1]) : $option[1]) . '</option>';
}
$s .= '</select>';
} elseif ($type == 'mradio') {
if (is_array($varname)) {
$radiocheck = array($value => ' checked');
$s .= '<ul' . (empty($varname[2]) ? ' class="pr"' : '') . '>';
foreach ($varname[1] as $varary) {
if (is_array($varary) && !empty($varary)) {
$s .= '<li' . ($radiocheck[$varary[0]] ? ' class="checked"' : '') . '><label for="randomid_' . ++$randomid . '"><input type="radio" name="' . $varname[0] . '" id="randomid_' . $randomid . '" class="pr" value="' . $varary[0] . '"' . $radiocheck[$varary[0]] . '>' . ($langscript ? lang('block/' . $langscript, $varary[1]) : $varary[1]) . '</label></li>';
}
}
$s .= '</ul>';
}
} elseif ($type == 'mcheckbox') {
$s .= '<ul class="nofloat">';
foreach ($varname[1] as $varary) {
if (is_array($varary) && !empty($varary)) {
$checked = is_array($value) && in_array($varary[0], $value) ? ' checked' : '';
$s .= '<li' . ($checked ? ' class="checked"' : '') . '><label for="randomid_' . ++$randomid . '"><input type="checkbox" name="' . $varname[0] . '[]" id="randomid_' . $randomid . '" class="pc" value="' . $varary[0] . '"' . $checked . '>' . ($langscript ? lang('block/' . $langscript, $varary[1]) : $varary[1]) . '</label></li>';
}
}
$s .= '</ul>';
} elseif ($type == 'mselect') {
$s .= '<select name="' . $varname[0] . '" class="ps" multiple="multiple" size="10">';
foreach ($varname[1] as $option) {
$selected = is_array($value) && in_array($option[0], $value) ? ' selected="selected"' : '';
$s .= '<option value="' . $option[0] . '"' . $selected . '>' . ($langscript ? lang('block/' . $langscript, $option[1]) : $option[1]) . '</option>';
}
$s .= '</select>';
} elseif ($type == 'calendar') {
if (!$calendar_loaded) {
$s .= "<script type=\"text/javascript\" src=\"{$_G[setting][jspath]}calendar.js?" . VERHASH . "\"></script>";
$calendar_loaded = true;
}
$s .= '<input type="text" name="' . $varname . '" class="px" value="' . dhtmlspecialchars($value) . '" onclick="showcalendar(event, this, true)" />';
} elseif ($type == 'district') {
include_once libfile('function/profile');
$elems = $vals = array();
$districthtml = '';
foreach ($setting['value'] as $fieldid) {
$elems[] = 'parameter[' . $fieldid . ']';
$vals[$fieldid] = $values[$fieldid];
if (!empty($values[$fieldid])) {
$districthtml .= $values[$fieldid] . '<input type="hidden" name="parameter[' . $fieldid . ']" value="' . $values[$fieldid] . '" /> ';
}
}
$containertype = strpos($setting['title'], 'birthcity') !== false ? 'birth' : 'reside';
$containerid = 'randomid_' . ++$randomid;
if ($districthtml) {
$s .= $districthtml;
$s .= ' <a href="javascript:;" onclick="showdistrict(\'' . $containerid . '\', [' . dimplode($elems) . '], ' . count($elems) . ', \'\', \'' . $containertype . '\'); return false;">' . lang('spacecp', 'profile_edit') . '</a>';
$s .= '<p id="' . $containerid . '"></p>';
} else {
$s .= "<div id=\"{$containerid}\">" . showdistrict($vals, $elems, $containerid, null, $containertype) . '</div>';
}
} elseif ($type == 'file') {
$s .= '<input type="' . $type . '" name="' . $varname . '" class="pf" value="' . dhtmlspecialchars($value) . '" />';
} elseif ($type == 'mfile') {
$s .= '<label for="' . $settingvar . 'way_remote"' . ' class="lb"><input type="radio" name="' . $settingvar . '_chk" id="' . $settingvar . 'way_remote" class="pr" onclick="showpicedit(\'' . $settingvar . '\');" checked="checked">' . lang('portalcp', 'remote') . '</label>';
$s .= '<label for="' . $settingvar . 'way_upload"' . ' class="lb"><input type="radio" name="' . $settingvar . '_chk" id="' . $settingvar . 'way_upload" class="pr" onclick="showpicedit(\'' . $settingvar . '\');">' . lang('portalcp', 'upload') . '</label><br />';
$s .= '<input type="text" name="' . $varname . '" id="' . $settingvar . '_remote" class="px" value="' . dhtmlspecialchars($value) . '" />';
$s .= '<input type="file" name="' . $settingvar . '" id="' . $settingvar . '_upload" class="pf" value="" style="display:none" />';
} else {
$s .= $type;
}
$return[] = array('title' => $setname, 'html' => $s, 'comment' => $comment);
//.........这里部分代码省略.........
示例4: foreach
if (!empty($district)) {
foreach (C::t('common_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();
if ($_GET['province']) {
$elems = array($_GET['province'], $_GET['city'], $_GET['district'], $_GET['community']);
}
include_once libfile('function/profile');
$html = showdistrict($values, $elems, $container, $showlevel, $containertype);
} elseif ($_GET['op'] == 'createalbum') {
$albumname = 'new:' . $_GET['name'];
require_once libfile('function/spacecp');
$albumid = album_creat_by_id($albumname, intval($_GET['catid']));
}
include template('home/misc_ajax');
示例5: profile_setting
function profile_setting($fieldid, $space = array(), $showstatus = false, $ignoreunchangable = false)
{
global $_G;
if (empty($_G['cache']['profilesetting'])) {
loadcache('profilesetting');
}
$field = $_G['cache']['profilesetting'][$fieldid];
if (empty($field) || !$field['available'] || in_array($fieldid, array('uid', 'constellation', 'zodiac', 'birthmonth', 'birthyear', 'birthprovince', 'birthdist', 'birthcommunity', 'resideprovince', 'residedist', 'residecommunity'))) {
return '';
}
if ($showstatus) {
$uid = intval($space['uid']);
if ($uid && !isset($_G['profile_verifys'][$uid])) {
$_G['profile_verifys'][$uid] = array();
$query = DB::query('SELECT field FROM ' . DB::table('common_member_verify_info') . " WHERE uid = '{$uid}' AND verifytype='0'");
while ($value = DB::fetch($query)) {
$fields = unserialize($value['field']);
foreach ($fields as $key => $fvalue) {
if ($_G['cache']['profilesetting'][$key]['needverify']) {
$_G['profile_verifys'][$uid][$key] = $fvalue;
}
}
}
}
$verifyvalue = NULL;
if (isset($_G['profile_verifys'][$uid][$fieldid])) {
if ($fieldid == 'gender') {
$verifyvalue = lang('space', 'gender_' . intval($_G['profile_verifys'][$uid][$fieldid]));
} elseif ($fieldid == 'birthday') {
$verifyvalue = $_G['profile_verifys'][$uid]['birthyear'] . '-' . $_G['profile_verifys'][$uid]['birthmonth'] . '-' . $_G['profile_verifys'][$uid]['birthday'];
} else {
$verifyvalue = $_G['profile_verifys'][$uid][$fieldid];
}
}
}
$html = '';
$field['unchangeable'] = !$ignoreunchangable && $field['unchangeable'] ? 1 : 0;
if ($fieldid == 'birthday') {
if ($field['unchangeable'] && !empty($space[$fieldid])) {
return '<span>' . $space['birthyear'] . '-' . $space['birthmonth'] . '-' . $space['birthday'] . '</span>';
}
$birthyeayhtml = '';
$nowy = dgmdate($_G['timestamp'], 'Y');
for ($i = 0; $i < 100; $i++) {
$they = $nowy - $i;
$selectstr = $they == $space['birthyear'] ? ' selected' : '';
$birthyeayhtml .= "<option value=\"{$they}\"{$selectstr}>{$they}</option>";
}
$birthmonthhtml = '';
for ($i = 1; $i < 13; $i++) {
$selectstr = $i == $space['birthmonth'] ? ' selected' : '';
$birthmonthhtml .= "<option value=\"{$i}\"{$selectstr}>{$i}</option>";
}
$birthdayhtml = '';
if (empty($space['birthmonth']) || in_array($space['birthmonth'], array(1, 3, 5, 7, 8, 10, 12))) {
$days = 31;
} elseif (in_array($space['birthmonth'], array(4, 6, 9, 11))) {
$days = 30;
} elseif ($space['birthyear'] && ($space['birthyear'] % 400 == 0 || $space['birthyear'] % 4 == 0 && $space['birthyear'] % 400 != 0)) {
$days = 29;
} else {
$days = 28;
}
for ($i = 1; $i <= $days; $i++) {
$selectstr = $i == $space['birthday'] ? ' selected' : '';
$birthdayhtml .= "<option value=\"{$i}\"{$selectstr}>{$i}</option>";
}
$html = '<select id="birthyear" name="birthyear" onchange="showbirthday();" tabindex="1">' . '<option value="">' . lang('space', 'year') . '</option>' . $birthyeayhtml . '</select>' . ' ' . '<select id="birthmonth" name="birthmonth" onchange="showbirthday();" tabindex="1">' . '<option value="">' . lang('space', 'month') . '</option>' . $birthmonthhtml . '</select>' . ' ' . '<select id="birthday" name="birthday" tabindex="1">' . '<option value="">' . lang('space', 'day') . '</option>' . $birthdayhtml . '</select>';
} elseif ($fieldid == 'gender') {
if ($field['unchangeable'] && $space[$fieldid] > 0) {
return '<span>' . lang('space', 'gender_' . intval($space[$fieldid])) . '</span>';
}
$selected = array($space[$fieldid] => ' selected="selected"');
$html = '<select name="gender" id="gender" tabindex="1">';
if ($field['unchangeable']) {
$html .= '<option value="">' . lang('space', 'gender') . '</option>';
} else {
$html .= '<option value="0"' . ($space[$fieldid] == '0' ? ' selected="selected"' : '') . '>' . lang('space', 'gender_0') . '</option>';
}
$html .= '<option value="1"' . ($space[$fieldid] == '1' ? ' selected="selected"' : '') . '>' . lang('space', 'gender_1') . '</option>' . '<option value="2"' . ($space[$fieldid] == '2' ? ' selected="selected"' : '') . '>' . lang('space', 'gender_2') . '</option>' . '</select>';
} elseif ($fieldid == 'birthcity') {
if ($field['unchangeable'] && !empty($space[$fieldid])) {
return '<span>' . $space['birthprovince'] . '-' . $space['birthcity'] . '</span>';
}
$values = array(0, 0);
$elems = array('birthprovince', 'birthcity');
if (!empty($space['birthprovince'])) {
$html = profile_show('birthcity', $space);
$html .= ' <a href="javascript:;" onclick="showdistrict(\'birthdistrictbox\', [\'birthprovince\', \'birthcity\'], 2); return false;">' . lang('spacecp', 'profile_edit') . '</a>';
$html .= '<p id="birthdistrictbox"></p>';
} else {
$html = '<p id="birthdistrictbox">' . showdistrict($values, $elems, 'birthdistrictbox') . '</p>';
}
} elseif ($fieldid == 'residecity') {
if ($field['unchangeable'] && !empty($space[$fieldid])) {
return '<span>' . $space['resideprovince'] . '-' . $space['residecity'] . '</span>';
}
$values = array(0, 0, 0, 0);
$elems = array('resideprovince', 'residecity', 'residedist', 'residecommunity');
if (!empty($space['resideprovince'])) {
//.........这里部分代码省略.........
示例6: showsearchform
//.........这里部分代码省略.........
showsetting('members_search_email', 'email', $_GET['email'], 'text');
showsetting("$lang[credits] $lang[members_search_between]", array("credits_low", "credits_high"), array($_GET['credits_low'], $_GET['credtis_high']), 'range');
if(!empty($_G['setting']['extcredits'])) {
foreach($_G['setting']['extcredits'] as $id => $credit) {
showsetting("$credit[title] $lang[members_search_between]", array("extcredits$id"."_low", "extcredits$id"."_high"), array($_GET['extcredits'.$id.'_low'], $_GET['extcredits'.$id.'_high']), 'range');
}
}
showsetting('members_search_friendsrange', array('friends_low', 'friends_high'), array($_GET['friends_low'], $_GET['friends_high']), 'range');
showsetting('members_search_postsrange', array('posts_low', 'posts_high'), array($_GET['posts_low'], $_GET['posts_high']), 'range');
showsetting('members_search_regip', 'regip', $_GET['regip'], 'text');
showsetting('members_search_lastip', 'lastip', $_GET['lastip'], 'text');
showsetting('members_search_oltimerange', array('oltime_low', 'oltime_high'), array($_GET['oltime_low'], $_GET['oltime_high']), 'range');
showsetting('members_search_regdaterange', array('regdate_after', 'regdate_before'), array($_GET['regdate_after'], $_GET['regdate_before']), 'daterange');
showsetting('members_search_lastvisitrange', array('lastvisit_after', 'lastvisit_before'), array($_GET['lastvisit_after'], $_GET['lastvisit_before']), 'daterange');
showsetting('members_search_lastpostrange', array('lastpost_after', 'lastpost_before'), array($_GET['lastpost_after'], $_GET['lastpost_before']), 'daterange');
showsetting('members_search_group_fid', 'fid', $_GET['fid'], 'text');
if($_G['setting']['verify']) {
$verifydata = array();
foreach($_G['setting']['verify'] as $key => $value) {
if($value['available']) {
$verifydata[] = array('verify'.$key, $value['title']);
}
}
if(!empty($verifydata)) {
showsetting('members_search_verify', array('verify', $verifydata), $_GET['verify'], 'mcheckbox');
}
}
$yearselect = $monthselect = $dayselect = "<option value=\"\">".cplang('nolimit')."</option>\n";
$yy=dgmdate(TIMESTAMP, 'Y');
for($y=$yy; $y>=$yy-100; $y--) {
$y = sprintf("%04d", $y);
$yearselect .= "<option value=\"$y\" ".($_GET['birthyear'] == $y ? 'selected' : '').">$y</option>\n";
}
for($m=1; $m<=12; $m++) {
$m = sprintf("%02d", $m);
$monthselect .= "<option value=\"$m\" ".($_GET['birthmonth'] == $m ? 'selected' : '').">$m</option>\n";
}
for($d=1; $d<=31; $d++) {
$d = sprintf("%02d", $d);
$dayselect .= "<option value=\"$d\" ".($_GET['birthday'] == $d ? 'selected' : '').">$d</option>\n";
}
showsetting('members_search_birthday', '', '', '<select class="txt" name="birthyear" style="width:75px; margin-right:0">'.$yearselect.'</select> '.$lang['year'].' <select class="txt" name="birthmonth" style="width:75px; margin-right:0">'.$monthselect.'</select> '.$lang['month'].' <select class="txt" name="birthday" style="width:75px; margin-right:0">'.$dayselect.'</select> '.$lang['day']);
loadcache('profilesetting');
unset($_G['cache']['profilesetting']['uid']);
unset($_G['cache']['profilesetting']['birthyear']);
unset($_G['cache']['profilesetting']['birthmonth']);
unset($_G['cache']['profilesetting']['birthday']);
require_once libfile('function/profile');
foreach($_G['cache']['profilesetting'] as $fieldid=>$value) {
if(!$value['available'] || in_array($fieldid, array('birthprovince', 'birthdist', 'birthcommunity', 'resideprovince', 'residedist', 'residecommunity'))) {
continue;
}
if($fieldid == 'gender') {
$select = "<option value=\"\">".cplang('nolimit')."</option>\n";
$select .= "<option value=\"0\">".cplang('members_edit_gender_secret')."</option>\n";
$select .= "<option value=\"1\">".cplang('members_edit_gender_male')."</option>\n";
$select .= "<option value=\"2\">".cplang('members_edit_gender_female')."</option>\n";
showsetting($value['title'], '', '', '<select class="txt" name="gender">'.$select.'</select>');
} elseif($fieldid == 'birthcity') {
$elems = array('birthprovince', 'birthcity', 'birthdist', 'birthcommunity');
showsetting($value['title'], '', '', '<div id="birthdistrictbox">'.showdistrict(array(0,0,0,0), $elems, 'birthdistrictbox', 1, 'birth').'</div>');
} elseif($fieldid == 'residecity') {
$elems = array('resideprovince', 'residecity', 'residedist', 'residecommunity');
showsetting($value['title'], '', '', '<div id="residedistrictbox">'.showdistrict(array(0,0,0,0), $elems, 'residedistrictbox', 1, 'reside').'</div>');
} elseif($fieldid == 'constellation') {
$select = "<option value=\"\">".cplang('nolimit')."</option>\n";
for($i=1; $i<=12; $i++) {
$name = lang('space', 'constellation_'.$i);
$select .= "<option value=\"$name\">$name</option>\n";
}
showsetting($value['title'], '', '', '<select class="txt" name="constellation">'.$select.'</select>');
} elseif($fieldid == 'zodiac') {
$select = "<option value=\"\">".cplang('nolimit')."</option>\n";
for($i=1; $i<=12; $i++) {
$option = lang('space', 'zodiac_'.$i);
$select .= "<option value=\"$option\">$option</option>\n";
}
showsetting($value['title'], '', '', '<select class="txt" name="zodiac">'.$select.'</select>');
} elseif($value['formtype'] == 'select' || $value['formtype'] == 'list') {
$select = "<option value=\"\">".cplang('nolimit')."</option>\n";
$value['choices'] = explode("\n",$value['choices']);
foreach($value['choices'] as $option) {
$option = trim($option);
$select .= "<option value=\"$option\">$option</option>\n";
}
showsetting($value['title'], '', '', '<select class="txt" name="'.$fieldid.'">'.$select.'</select>');
} else {
showsetting($value['title'], '', '', '<input class="txt" name="'.$fieldid.'" />');
}
}
showtagfooter('tbody');
$_G['showsetting_multirow'] = 0;
showsubmit('submit', $operation == 'clean' ? 'members_delete' : 'search', '', 'more_options');
showtablefooter();
showformfooter();
showtagfooter('div');
}
示例7: profile_setting
//.........这里部分代码省略.........
}
$selected = array($space[$fieldid]=>' selected="selected"');
$html = '<select name="gender" id="gender" class="ps" tabindex="1">';
if($field['unchangeable']) {
$html .= '<option value="">'.lang('space', 'gender').'</option>';
} else {
$html .= '<option value="0"'.($space[$fieldid]=='0' ? ' selected="selected"' : '').'>'.lang('space', 'gender_0').'</option>';
}
$html .= '<option value="1"'.($space[$fieldid]=='1' ? ' selected="selected"' : '').'>'.lang('space', 'gender_1').'</option>'
.'<option value="2"'.($space[$fieldid]=='2' ? ' selected="selected"' : '').'>'.lang('space', 'gender_2').'</option>'
.'</select>';
/*vot*/
/*
} elseif($fieldid=='birthcountry') {
if($field['unchangeable'] && !empty($space[$fieldid])) {
return '<span>'.$space['birtcountry'].'</span>';
}
if(!empty($space['birthcountry'])) {
$html = profile_show('birthcountry', $space);
$html .= ' (<a href="javascript:;" onclick="showcountry(\'birthcountrybox\', [\'birthcountry\'], 4, \'\', \'birth\'); return false;">'.lang('spacecp', 'profile_edit').'</a>)';
$html .= '<p id="birthcountrybox"></p>';
} else {
$html = '<p id="birthcountrybox">'.showcountry($values, $elems, 'birthcountrybox', 1, 'birth').'</p>';
}
*/
} elseif($fieldid=='birthcity') {
if($field['unchangeable'] && !empty($space[$fieldid])) {
return '<span>'.$space['birthprovince'].'-'.$space['birthcity'].'</span>';
}
$values = array(0,0,0,0);
$elems = array('birthprovince', 'birthcity', 'birthdist', 'birthcommunity');
if(!empty($space['birthprovince'])) {
$html = profile_show('birthcity', $space);
$html .= ' (<a href="javascript:;" onclick="showdistrict(\'birthdistrictbox\', [\'birthprovince\', \'birthcity\', \'birthdist\', \'birthcommunity\'], 4, \'\', \'birth\'); return false;">'.lang('spacecp', 'profile_edit').'</a>)';
$html .= '<p id="birthdistrictbox"></p>';
} else {
$html = '<p id="birthdistrictbox">'.showdistrict($values, $elems, 'birthdistrictbox', 1, 'birth').'</p>';
}
/*vot*/
/*
} elseif($fieldid=='residecountry') {
if($field['unchangeable'] && !empty($space[$fieldid])) {
return '<span>'.$space['residecountry'].'</span>';
}
if(!empty($space['residecountry'])) {
$html = profile_show('residecountry', $space);
$html .= ' (<a href="javascript:;" onclick="showcountry(\'residecountrybox\', [\'residecountry\'], 4, \'\', \'reside\'); return false;">'.lang('spacecp', 'profile_edit').'</a>)';
$html .= '<p id="residecountrybox"></p>';
} else {
$html = '<p id="residecountrybox">'.showcountry($values, $elems, 'residecountrybox', 1, 'reside').'</p>';
}
*/
} elseif($fieldid=='residecity') {
if($field['unchangeable'] && !empty($space[$fieldid])) {
return '<span>'.$space['resideprovince'].'-'.$space['residecity'].'</span>';
}
$values = array(0,0,0,0);
$elems = array('resideprovince', 'residecity', 'residedist', 'residecommunity');
if(!empty($space['resideprovince'])) {
$html = profile_show('residecity', $space);
$html .= ' (<a href="javascript:;" onclick="showdistrict(\'residedistrictbox\', [\'resideprovince\', \'residecity\', \'residedist\', \'residecommunity\'], 4, \'\', \'reside\'); return false;">'.lang('spacecp', 'profile_edit').'</a>)';
$html .= '<p id="residedistrictbox"></p>';
} else {
$html = '<p id="residedistrictbox">'.showdistrict($values, $elems, 'residedistrictbox', 1, 'reside').'</p>';
}