function domaincheck($domain, $domainroot, $domainlength, $msgtype = 1) { if (strlen($domain) < $domainlength) { showmessage('domain_length_error', '', array('length' => $domainlength), array('return' => true)); } if (strlen($domain) > 30) { $msgtype ? showmessage('two_domain_length_not_more_than_30_characters', '', array(), array('return' => true)) : cpmsg('two_domain_length_not_more_than_30_characters', '', 'error'); } if (!preg_match("/^[a-z0-9]*\$/", $domain)) { $msgtype ? showmessage('only_two_names_from_english_composition_and_figures', '', array(), array('return' => true)) : cpmsg('only_two_names_from_english_composition_and_figures', '', 'error'); } if ($msgtype && isholddomain($domain)) { showmessage('domain_be_retained', '', array(), array('return' => true)); } if (existdomain($domain, $domainroot)) { $msgtype ? showmessage('two_domain_have_been_occupied', '', array(), array('return' => true)) : cpmsg('two_domain_have_been_occupied', '', 'error'); } return true; }
[UCenter Home] (C) 2007-2008 Comsenz Inc. $Id: index.php 13003 2009-08-05 06:46:06Z liguode $ */ include_once './common.php'; include_once './language/lang_openid_utf-8.php'; //openid语言信息 $openidlang = $_SGLOBAL['openidlang']; $lang_login_add = $openidlang['openid_login']; if (is_numeric($_SERVER['QUERY_STRING'])) { showmessage('enter_the_space', "space.php?uid={$_SERVER['QUERY_STRING']}", 0); } //二级域名 if (!isset($_GET['do']) && $_SCONFIG['allowdomain']) { $hostarr = explode('.', $_SERVER['HTTP_HOST']); $domainrootarr = explode('.', $_SCONFIG['domainroot']); if (count($hostarr) > 2 && count($hostarr) > count($domainrootarr) && $hostarr[0] != 'www' && !isholddomain($hostarr[0])) { showmessage('enter_the_space', $_SCONFIG['siteallurl'] . 'space.php?domain=' . $hostarr[0], 0); } } if ($_SGLOBAL['supe_uid']) { //已登录,直接跳转个人首页 showmessage('enter_the_space', 'space.php?do=home', 0); } if (empty($_SCONFIG['networkpublic'])) { $cachefile = S_ROOT . './data/cache_index.txt'; $cachetime = @filemtime($cachefile); $spacelist = array(); if ($_SGLOBAL['timestamp'] - $cachetime > 900) { //20位热门用户 $query = $_SGLOBAL['db']->query("SELECT s.*, sf.resideprovince, sf.residecity\r\n\t\t\tFROM " . tname('space') . " s\r\n\t\t\tLEFT JOIN " . tname('spacefield') . " sf ON sf.uid=s.uid\r\n\t\t\tORDER BY s.friendnum DESC LIMIT 0,20"); while ($value = $_SGLOBAL['db']->fetch_array($query)) {
showmessage('integral_inadequate', '', 1, array($space['credit'], $dcredit)); } } if (empty($domainlength) || empty($_POST['domain'])) { $setarr['domain'] = ''; } else { if (strlen($_POST['domain']) < $domainlength) { showmessage('domain_length_error', '', 1, array($domainlength)); } if (strlen($_POST['domain']) > 30) { showmessage('two_domain_length_not_more_than_30_characters'); } if (!preg_match("/^[a-z][a-z0-9]*\$/", $_POST['domain'])) { showmessage('only_two_names_from_english_composition_and_figures'); } if (isholddomain($_POST['domain'])) { showmessage('domain_be_retained'); //debug } $count = getcount('space', array('domain' => $_POST['domain'])); if ($count) { showmessage('two_domain_have_been_occupied'); } $setarr['domain'] = $_POST['domain']; } } if ($setarr) { updatetable('space', $setarr, array('uid' => $_SGLOBAL['supe_uid'])); } showmessage('do_success', 'cp.php?ac=domain'); }